Repository: gobuffalo/buffalo
Pull request #1708 (2019-06-22 22:17:30)

removes the direct dependency on gobuffalo/x


Patch:
diff --git a/binding/binding.go b/binding/binding.go
index 403919fa..03a0d4c1 100644
--- a/binding/binding.go
+++ b/binding/binding.go
@@ -12,7 +12,7 @@ import (
 	"errors"
 
 	"github.com/gobuffalo/nulls"
-	"github.com/gobuffalo/x/httpx"
+	"github.com/gobuffalo/buffalo/internal/httpx"
 	"github.com/monoculum/formam"
 )
 
diff --git a/buffalo/cmd/fix/dep.go b/buffalo/cmd/fix/dep.go
index 49a91a21..09f6bf84 100644
--- a/buffalo/cmd/fix/dep.go
+++ b/buffalo/cmd/fix/dep.go
@@ -9,7 +9,7 @@ import (
 
 	"github.com/gobuffalo/buffalo/runtime"
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 )
 
 // packages to add to Gopkg.toml
diff --git a/buffalo/cmd/fix/tools.go b/buffalo/cmd/fix/tools.go
index 4b2bc0b2..c4db43f5 100644
--- a/buffalo/cmd/fix/tools.go
+++ b/buffalo/cmd/fix/tools.go
@@ -6,7 +6,7 @@ import (
 	"os/exec"
 
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 )
 
 var rTools = []string{}
diff --git a/buffalo/cmd/generate/mailer.go b/buffalo/cmd/generate/mailer.go
index 32b9713a..6282dfec 100644
--- a/buffalo/cmd/generate/mailer.go
+++ b/buffalo/cmd/generate/mailer.go
@@ -6,7 +6,7 @@ import (
 	"github.com/gobuffalo/buffalo/genny/mail"
 	"github.com/gobuffalo/flect/name"
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 	"github.com/gobuffalo/meta"
 	"github.com/spf13/cobra"
 )
diff --git a/buffalo/cmd/generate/task.go b/buffalo/cmd/generate/task.go
index 85741ea1..a7568a8a 100644
--- a/buffalo/cmd/generate/task.go
+++ b/buffalo/cmd/generate/task.go
@@ -6,7 +6,7 @@ import (
 
 	"github.com/gobuffalo/buffalo/genny/grift"
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 	"github.com/spf13/cobra"
 )
 
diff --git a/buffalo/cmd/new.go b/buffalo/cmd/new.go
index aa1ac0e5..b2a62b9b 100644
--- a/buffalo/cmd/new.go
+++ b/buffalo/cmd/new.go
@@ -22,7 +22,7 @@ import (
 	"github.com/gobuffalo/envy"
 	fname "github.com/gobuffalo/flect/name"
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 	"github.com/gobuffalo/logger"
 	"github.com/gobuffalo/meta"
 	"github.com/gobuffalo/packr/v2/plog"
diff --git a/buffalo/cmd/plugins/generate.go b/buffalo/cmd/plugins/generate.go
index 713b65f9..a8003f89 100644
--- a/buffalo/cmd/plugins/generate.go
+++ b/buffalo/cmd/plugins/generate.go
@@ -10,7 +10,7 @@ import (
 	"github.com/gobuffalo/buffalo/genny/plugins/plugin/with"
 	"github.com/gobuffalo/envy"
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 	"github.com/gobuffalo/licenser/genny/licenser"
 	"github.com/gobuffalo/logger"
 	"github.com/pkg/errors"
diff --git a/context.go b/context.go
index ffa7f869..7b2dad56 100644
--- a/context.go
+++ b/context.go
@@ -7,7 +7,7 @@ import (
 
 	"github.com/gobuffalo/buffalo/binding"
 	"github.com/gobuffalo/buffalo/render"
-	"github.com/gobuffalo/x/httpx"
+	"github.com/gobuffalo/buffalo/internal/httpx"
 	"github.com/gorilla/mux"
 )
 
diff --git a/errors.go b/errors.go
index ae7475e2..06271f7b 100644
--- a/errors.go
+++ b/errors.go
@@ -9,10 +9,10 @@ import (
 	"sort"
 	"strings"
 
+	"github.com/gobuffalo/buffalo/internal/defaults"
+	"github.com/gobuffalo/buffalo/internal/httpx"
 	"github.com/gobuffalo/events"
 	"github.com/gobuffalo/plush"
-	"github.com/gobuffalo/x/defaults"
-	"github.com/gobuffalo/x/httpx"
 	"github.com/pkg/errors"
 )
 
diff --git a/genny/actions/actions.go b/genny/actions/actions.go
index b6317788..e4ffad8b 100644
--- a/genny/actions/actions.go
+++ b/genny/actions/actions.go
@@ -6,7 +6,7 @@ import (
 
 	"github.com/gobuffalo/flect/name"
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 	"github.com/gobuffalo/packr/v2"
 )
 
diff --git a/genny/assets/standard/standard.go b/genny/assets/standard/standard.go
index ec7660a7..232b6ea2 100644
--- a/genny/assets/standard/standard.go
+++ b/genny/assets/standard/standard.go
@@ -5,7 +5,7 @@ import (
 	"text/template"
 
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 	"github.com/gobuffalo/packr/v2"
 )
 
diff --git a/genny/assets/webpack/webpack.go b/genny/assets/webpack/webpack.go
index 962b14b5..ecfcc39d 100644
--- a/genny/assets/webpack/webpack.go
+++ b/genny/assets/webpack/webpack.go
@@ -8,7 +8,7 @@ import (
 	"errors"
 
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 	"github.com/gobuffalo/packr/v2"
 )
 
diff --git a/genny/build/bin.go b/genny/build/bin.go
index f056374d..e95d7033 100644
--- a/genny/build/bin.go
+++ b/genny/build/bin.go
@@ -6,7 +6,7 @@ import (
 	"strings"
 
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen/gomods"
+	"github.com/gobuffalo/genny/gogen/gomods"
 )
 
 func buildCmd(opts *Options) (*exec.Cmd, error) {
diff --git a/genny/build/build.go b/genny/build/build.go
index e50f4865..41b30e0f 100644
--- a/genny/build/build.go
+++ b/genny/build/build.go
@@ -7,10 +7,10 @@ import (
 
 	"github.com/gobuffalo/events"
 	"github.com/gobuffalo/genny"
+	"github.com/gobuffalo/genny/plushgen"
 	"github.com/gobuffalo/packr/v2"
 	"github.com/gobuffalo/packr/v2/jam"
 	"github.com/gobuffalo/plush"
-	"github.com/gobuffalo/plushgen"
 )
 
 // New generator for building a Buffalo application
diff --git a/genny/build/build_deps.go b/genny/build/build_deps.go
index 83a2c49c..ce536605 100644
--- a/genny/build/build_deps.go
+++ b/genny/build/build_deps.go
@@ -1,10 +1,10 @@
 package build
 
 import (
-	"github.com/gobuffalo/depgen"
+	"github.com/gobuffalo/genny/depgen"
 	"github.com/gobuffalo/envy"
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 )
 
 func buildDeps(opts *Options) (*genny.Generator, error) {
diff --git a/genny/ci/ci.go b/genny/ci/ci.go
index 1f491c7e..3fe489be 100644
--- a/genny/ci/ci.go
+++ b/genny/ci/ci.go
@@ -5,7 +5,7 @@ import (
 	"html/template"
 
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 	"github.com/gobuffalo/packr/v2"
 )
 
diff --git a/genny/grift/grift.go b/genny/grift/grift.go
index f6f69f27..b6282048 100644
--- a/genny/grift/grift.go
+++ b/genny/grift/grift.go
@@ -5,7 +5,7 @@ import (
 	"text/template"
 
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 )
 
 // New generator to create a grift task
diff --git a/genny/mail/mail.go b/genny/mail/mail.go
index 9fa3edac..de4de0da 100644
--- a/genny/mail/mail.go
+++ b/genny/mail/mail.go
@@ -4,7 +4,7 @@ import (
 	"text/template"
 
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 	"github.com/gobuffalo/packr/v2"
 )
 
diff --git a/genny/newapp/api/api.go b/genny/newapp/api/api.go
index b15501b5..933a7d2b 100644
--- a/genny/newapp/api/api.go
+++ b/genny/newapp/api/api.go
@@ -5,8 +5,8 @@ import (
 
 	"github.com/gobuffalo/buffalo/genny/newapp/core"
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
-	"github.com/gobuffalo/gogen/gomods"
+	"github.com/gobuffalo/genny/gogen"
+	"github.com/gobuffalo/genny/gogen/gomods"
 	"github.com/gobuffalo/packr/v2"
 )
 
diff --git a/genny/newapp/core/core.go b/genny/newapp/core/core.go
index f8c3d28c..3d0d6324 100644
--- a/genny/newapp/core/core.go
+++ b/genny/newapp/core/core.go
@@ -8,10 +8,10 @@ import (
 	"github.com/gobuffalo/buffalo/genny/refresh"
 	"github.com/gobuffalo/buffalo/plugins/plugdeps"
 	"github.com/gobuffalo/buffalo/runtime"
-	"github.com/gobuffalo/depgen"
+	"github.com/gobuffalo/genny/depgen"
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
-	"github.com/gobuffalo/gogen/gomods"
+	"github.com/gobuffalo/genny/gogen"
+	"github.com/gobuffalo/genny/gogen/gomods"
 	"github.com/gobuffalo/meta"
 	"github.com/pkg/errors"
 )
diff --git a/genny/newapp/core/root.go b/genny/newapp/core/root.go
index bae54b09..6a1e6957 100644
--- a/genny/newapp/core/root.go
+++ b/genny/newapp/core/root.go
@@ -7,7 +7,7 @@ import (
 	"github.com/BurntSushi/toml"
 	"github.com/gobuffalo/envy"
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 	"github.com/gobuffalo/packr/v2"
 )
 
diff --git a/genny/newapp/web/web.go b/genny/newapp/web/web.go
index f492fab7..1613b51e 100644
--- a/genny/newapp/web/web.go
+++ b/genny/newapp/web/web.go
@@ -7,8 +7,8 @@ import (
 	"github.com/gobuffalo/buffalo/genny/assets/webpack"
 	"github.com/gobuffalo/buffalo/genny/newapp/core"
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
-	"github.com/gobuffalo/gogen/gomods"
+	"github.com/gobuffalo/genny/gogen"
+	"github.com/gobuffalo/genny/gogen/gomods"
 	"github.com/gobuffalo/packr/v2"
 )
 
diff --git a/genny/plugins/install/install.go b/genny/plugins/install/install.go
index dc540602..0b7366c3 100644
--- a/genny/plugins/install/install.go
+++ b/genny/plugins/install/install.go
@@ -8,7 +8,7 @@ import (
 	"github.com/gobuffalo/buffalo/genny/add"
 	"github.com/gobuffalo/buffalo/plugins/plugdeps"
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 	"github.com/pkg/errors"
 )
 
diff --git a/genny/plugins/plugin/plugin.go b/genny/plugins/plugin/plugin.go
index b14916a1..3f26cb80 100644
--- a/genny/plugins/plugin/plugin.go
+++ b/genny/plugins/plugin/plugin.go
@@ -4,10 +4,10 @@ import (
 	"path/filepath"
 
 	"github.com/gobuffalo/genny"
+	"github.com/gobuffalo/genny/plushgen"
 	"github.com/gobuffalo/licenser/genny/licenser"
 	"github.com/gobuffalo/packr/v2"
 	"github.com/gobuffalo/plush"
-	"github.com/gobuffalo/plushgen"
 	"github.com/gobuffalo/release/genny/initgen"
 	"github.com/gobuffalo/release/genny/makefile"
 	"github.com/pkg/errors"
diff --git a/genny/plugins/plugin/with/generate.go b/genny/plugins/plugin/with/generate.go
index efe2d7a1..1ec5de32 100644
--- a/genny/plugins/plugin/with/generate.go
+++ b/genny/plugins/plugin/with/generate.go
@@ -7,9 +7,9 @@ import (
 	"github.com/gobuffalo/buffalo/genny/plugins/plugin"
 	"github.com/gobuffalo/genny"
 	"github.com/gobuffalo/genny/genny/new"
+	"github.com/gobuffalo/genny/plushgen"
 	"github.com/gobuffalo/packr/v2"
 	"github.com/gobuffalo/plush"
-	"github.com/gobuffalo/plushgen"
 	"github.com/pkg/errors"
 )
 
diff --git a/genny/refresh/refresh.go b/genny/refresh/refresh.go
index 013850c4..0c425bf3 100644
--- a/genny/refresh/refresh.go
+++ b/genny/refresh/refresh.go
@@ -2,9 +2,9 @@ package refresh
 
 import (
 	"github.com/gobuffalo/genny"
+	"github.com/gobuffalo/genny/plushgen"
 	"github.com/gobuffalo/packr/v2"
 	"github.com/gobuffalo/plush"
-	"github.com/gobuffalo/plushgen"
 )
 
 // New generator to generate refresh templates
diff --git a/genny/resource/actions.go b/genny/resource/actions.go
index 6fca3ae4..e0181390 100644
--- a/genny/resource/actions.go
+++ b/genny/resource/actions.go
@@ -5,7 +5,7 @@ import (
 
 	"github.com/gobuffalo/flect/name"
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 )
 
 func addResource(pres presenter) genny.RunFn {
diff --git a/genny/resource/models.go b/genny/resource/models.go
index 94766e64..be5663d0 100644
--- a/genny/resource/models.go
+++ b/genny/resource/models.go
@@ -5,7 +5,7 @@ import (
 
 	"github.com/gobuffalo/flect/name"
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 )
 
 func modelCommand(model name.Ident, opts *Options) *exec.Cmd {
diff --git a/genny/resource/resource.go b/genny/resource/resource.go
index eff15b9d..6da8deec 100644
--- a/genny/resource/resource.go
+++ b/genny/resource/resource.go
@@ -6,7 +6,7 @@ import (
 	"github.com/gobuffalo/flect"
 	"github.com/gobuffalo/flect/name"
 	"github.com/gobuffalo/genny"
-	"github.com/gobuffalo/gogen"
+	"github.com/gobuffalo/genny/gogen"
 	"github.com/gobuffalo/packd"
 	"github.com/gobuffalo/packr/v2"
 )
diff --git a/go.mod b/go.mod
index cee186d6..3c0adfdd 100644
--- a/go.mod
+++ b/go.mod
@@ -10,14 +10,12 @@ require (
 	github.com/gobuffalo/buffalo-docker v1.1.0
 	github.com/gobuffalo/buffalo-pop v1.14.0
 	github.com/gobuffalo/clara v0.6.0
-	github.com/gobuffalo/depgen v0.2.0
 	github.com/gobuffalo/envy v1.7.0
 	github.com/gobuffalo/events v1.3.1
 	github.com/gobuffalo/fizz v1.9.1 // indirect
 	github.com/gobuffalo/flect v0.1.5
 	github.com/gobuffalo/genny v0.3.0
 	github.com/gobuffalo/github_flavored_markdown v1.1.0
-	github.com/gobuffalo/gogen v0.2.0
 	github.com/gobuffalo/helpers v0.2.2
 	github.com/gobuffalo/httptest v1.3.0
 	github.com/gobuffalo/licenser v1.1.0
@@ -27,13 +25,12 @@ require (
 	github.com/gobuffalo/packd v0.2.0
 	github.com/gobuffalo/packr/v2 v2.4.0
 	github.com/gobuffalo/plush v3.8.2+incompatible
-	github.com/gobuffalo/plushgen v0.1.2
 	github.com/gobuffalo/pop v4.11.1+incompatible
 	github.com/gobuffalo/release v1.7.0
 	github.com/gobuffalo/shoulders v1.1.0 // indirect
 	github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754
 	github.com/gobuffalo/tags v2.1.0+incompatible
-	github.com/gobuffalo/x v0.0.0-20190614162758-d80e318e1bb4
+	github.com/gobuffalo/x v0.0.0-20190614162758-d80e318e1bb4 // indirect
 	github.com/gorilla/mux v1.7.2
 	github.com/gorilla/sessions v1.1.3
 	github.com/karrick/godirwalk v1.10.12
@@ -50,7 +47,6 @@ require (
 	github.com/spf13/pflag v1.0.3
 	github.com/spf13/viper v1.4.0
 	github.com/stretchr/testify v1.3.0
-	golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4
 	golang.org/x/sync v0.0.0-20190423024810-112230192c58
 	golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac
 	gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc
diff --git a/go.sum b/go.sum
index d31e7c24..fe92a78d 100644
--- a/go.sum
+++ b/go.sum
@@ -783,9 +783,8 @@ golang.org/x/crypto v0.0.0-20190403202508-8e1b8d32e692/go.mod h1:WFFai1msRO1wXaE
 golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
 golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
 golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 h1:1wopBVtVdWnn03fZelqdXTqk7U7zPQCb+T4rbU9ZEoU=
 golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 h1:ydJNl0ENAG67pFbB+9tfhiL2pYqLhfoaZFw/cjLhY4A=
-golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
 golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
diff --git a/grifts.go b/grifts.go
index 435725d8..84af4a77 100644
--- a/grifts.go
+++ b/grifts.go
@@ -1,15 +1,13 @@
 package buffalo
 
 import (
+	"crypto/rand"
 	"fmt"
 	"os"
-	"regexp"
 	"strings"
 	"text/tabwriter"
 
-	"github.com/gobuffalo/x/randx"
 	"github.com/markbates/grift/grift"
-	"golang.org/x/crypto/bcrypt"
 )
 
 // Grifts decorates the app with tasks
@@ -22,19 +20,12 @@ func Grifts(app *App) {
 func secretGrift() {
 	grift.Desc("secret", "Generate a cryptographically secure secret key")
 	grift.Add("secret", func(c *grift.Context) error {
-		bb := []byte{}
-		for i := 0; i < 4; i++ {
-			b := []byte(randx.String(64))
-			b, err := bcrypt.GenerateFromPassword(b, bcrypt.DefaultCost)
-			if err != nil {
-				return err
-			}
-			bb = append(bb, b...)
+		b := make([]byte, 64)
+		_, err := rand.Read(b)
+		if err != nil {
+			return err
 		}
-		rx := regexp.MustCompile(`(\W+)`)
-		bb = rx.ReplaceAll(bb, []byte(""))
-		s := randx.String(6) + string(bb)
-		fmt.Println(s[:127])
+		fmt.Println(string(b))
 		return nil
 	})
 }
diff --git a/internal/defaults/defaults.go b/internal/defaults/defaults.go
new file mode 100644
index 00000000..0d81de6f
--- /dev/null
+++ b/internal/defaults/defaults.go
@@ -0,0 +1,36 @@
+package defaults
+
+func String(s1, s2 string) string {
+	if s1 == "" {
+		return s2
+	}
+	return s1
+}
+
+func Int(i1, i2 int) int {
+	if i1 == 0 {
+		return i2
+	}
+	return i1
+}
+
+func Int64(i1, i2 int64) int64 {
+	if i1 == 0 {
+		return i2
+	}
+	return i1
+}
+
+func Float32(i1, i2 float32) float32 {
+	if i1 == 0.0 {
+		return i2
+	}
+	return i1
+}
+
+func Float64(i1, i2 float64) float64 {
+	if i1 == 0.0 {
+		return i2
+	}
+	return i1
+}
diff --git a/internal/fakesmtp/connection.go b/internal/fakesmtp/connection.go
new file mode 100644
index 00000000..e757b404
--- /dev/null
+++ b/internal/fakesmtp/connection.go
@@ -0,0 +1,32 @@
+package fakesmtp
+
+import (
+	"bufio"
+	"fmt"
+	"net"
+)
+
+//Connection of a client with our server
+type Connection struct {
+	conn    net.Conn
+	address string
+	time    int64
+	bufin   *bufio.Reader
+	bufout  *bufio.Writer
+}
+
+//write something to the client on the connection
+func (c *Connection) write(s string) {
+	c.bufout.WriteString(s + "\r\n")
+	c.bufout.Flush()
+}
+
+//read a string from the connected client
+func (c *Connection) read() string {
+	reply, err := c.bufin.ReadString('\n')
+
+	if err != nil {
+		fmt.Println("e ", err)
+	}
+	return reply
+}
diff --git a/internal/fakesmtp/server.go b/internal/fakesmtp/server.go
new file mode 100644
index 00000000..4e9649a9
--- /dev/null
+++ b/internal/fakesmtp/server.go
@@ -0,0 +1,138 @@
+package fakesmtp
+
+// This server is inspired by https://github.com/andrewarrow/jungle_smtp
+// and most of its functionality have been taken from the original repo and updated to
+// work better for buffalo.
+
+import (
+	"bufio"
+	"net"
+	"strings"
+	"sync"
+	"time"
+)
+
+//Server is our fake server that will be listening for SMTP connections.
+type Server struct {
+	Listener net.Listener
+	messages []string
+	mutex    sync.Mutex
+}
+
+//Start listens for connections on the given port
+func (s *Server) Start(port string) error {
+	for {
+		conn, err := s.Listener.Accept()
+		if err != nil {
+			return err
+		}
+
+		s.Handle(&Connection{
+			conn:    conn,
+			address: conn.RemoteAddr().String(),
+			time:    time.Now().Unix(),
+			bufin:   bufio.NewReader(conn),
+			bufout:  bufio.NewWriter(conn),
+		})
+	}
+}
+
+//Handle a connection from a client
+func (s *Server) Handle(c *Connection) {
+	s.mutex.Lock()
+	defer s.mutex.Unlock()
+
+	s.messages = append(s.messages, "")
+
+	s.readHello(c)
+	s.readSender(c)
+	s.readRecipients(c)
+	s.readData(c)
+
+	c.conn.Close()
+}
+
+//Requests and notifies readed the Hello
+func (s *Server) readHello(c *Connection) {
+	c.write("220 Welcome")
+	text := c.read()
+	s.addMessageLine(text)
+
+	c.write("250 Received")
+}
+
+//readSender reads the Sender from the connection
+func (s *Server) readSender(c *Connection) {
+	text := c.read()
+	s.addMessageLine(text)
+	c.write("250 Sender")
+}
+
+//readRecipients reads recipients from the connection
+func (s *Server) readRecipients(c *Connection) {
+	text := c.read()
+	s.addMessageLine(text)
+
+	c.write("250 Recipient")
+	text = c.read()
+	for strings.Contains(text, "RCPT") {
+		s.addMessageLine(text)
+		c.write("250 Recipient")
+		text = c.read()
+	}
+}
+
+//readData reads the message data.
+func (s *Server) readData(c *Connection) {
+	c.write("354 Ok Send data ending with <CRLF>.<CRLF>")
+
+	for {
+		text := c.read()
+		bytes := []byte(text)
+		s.addMessageLine(text)
+		// 46 13 10
+		if bytes[0] == 46 && bytes[1] == 13 && bytes[2] == 10 {
+			break
+		}
+	}
+	c.write("250 server has transmitted the message")
+}
+
+//addMessageLine ads a line to the last message
+func (s *Server) addMessageLine(text string) {
+	s.messages[len(s.Messages())-1] = s.LastMessage() + text
+}
+
+//LastMessage returns the last message on the server
+func (s *Server) LastMessage() string {
+	if len(s.Messages()) == 0 {
+		return ""
+	}
+
+	return s.Messages()[len(s.Messages())-1]
+}
+
+//Messages returns the list of messages on the server
+func (s *Server) Messages() []string {
+	return s.messages
+}
+
+//Clear the server messages
+func (s *Server) Clear() {
+	s.mutex.Lock()
+	defer s.mutex.Unlock()
+
+	s.messages = []string{}
+}
+
+//New returns a pointer to a new Server instance listening on the given port.
+func New(port string) (*Server, error) {
+	s := &Server{messages: []string{}}
+
+	listener, err := net.Listen("tcp", "0.0.0.0:"+port)
+	if err != nil {
+		return s, err
+	}
+	s.Listener = listener
+	return s, nil
+}
diff --git a/internal/httpx/content_type.go b/internal/httpx/content_type.go
new file mode 100644
index 00000000..d173350f
--- /dev/null
+++ b/internal/httpx/content_type.go
@@ -0,0 +1,30 @@
+package httpx
+
+import (
+	"net/http"
+	"strings"
+
+	"github.com/gobuffalo/buffalo/internal/defaults"
+)
+
+func ContentType(req *http.Request) string {
+	ct := defaults.String(req.Header.Get("Content-Type"), req.Header.Get("Accept"))
+	ct = strings.TrimSpace(ct)
+	var cts []string
+	if strings.Contains(ct, ",") {
+		cts = strings.Split(ct, ",")
+	} else {
+		cts = strings.Split(ct, ";")
+	}
+	for _, c := range cts {
+		c = strings.TrimSpace(c)
+		if strings.HasPrefix(c, "*/*") {
+			continue
+		}
+		return strings.ToLower(c)
+	}
+	if ct == "*/*" {
+		return ""
+	}
+	return ct
+}
diff --git a/method_override.go b/method_override.go
index b8af763b..2765156b 100644
--- a/method_override.go
+++ b/method_override.go
@@ -3,7 +3,7 @@ package buffalo
 import (
 	"net/http"
 
-	"github.com/gobuffalo/x/defaults"
+	"github.com/gobuffalo/buffalo/internal/defaults"
 )
 
 // MethodOverride is the default implementation for the
diff --git a/options.go b/options.go
index 58f93a2a..11a63577 100644
--- a/options.go
+++ b/options.go
@@ -7,12 +7,12 @@ import (
 	"strings"
 
 	"github.com/fatih/color"
+	"github.com/gobuffalo/buffalo/internal/defaults"
 	"github.com/gobuffalo/buffalo/worker"
 	"github.com/gobuffalo/envy"
 	"github.com/gobuffalo/logger"
 	"github.com/gobuffalo/pop"
 	"github.com/gobuffalo/pop/logging"
-	"github.com/gobuffalo/x/defaults"
 	"github.com/gorilla/sessions"
 	"github.com/markbates/oncer"
 )
diff --git a/request_logger.go b/request_logger.go
index cc277d57..e9eea865 100644
--- a/request_logger.go
+++ b/request_logger.go
@@ -1,17 +1,26 @@
 package buffalo
 
 import (
+	"crypto/rand"
 	"time"
 
 	humanize "github.com/dustin/go-humanize"
-	"github.com/gobuffalo/x/httpx"
-	"github.com/gobuffalo/x/randx"
+	"github.com/gobuffalo/buffalo/internal/httpx"
 )
 
 // RequestLogger can be be overridden to a user specified
 // function that can be used to log the request.
 var RequestLogger = RequestLoggerFunc
 
+func randString(i int) (string, error) {
+	if i == 0 {
+		i = 64
+	}
+	b := make([]byte, i)
+	_, err := rand.Read(b)
+	return string(b), err
+}
+
 // RequestLoggerFunc is the default implementation of the RequestLogger.
 // By default it will log a uniq "request_id", the HTTP Method of the request,
 // the path that was requested, the duration (time) it took to process the
@@ -19,13 +28,22 @@ var RequestLogger = RequestLoggerFunc
 // code of the response.
 func RequestLoggerFunc(h Handler) Handler {
 	return func(c Context) error {
+		rs, err := randString(10)
+		if err != nil {
+			return err
+		}
 		var irid interface{}
 		if irid = c.Session().Get("requestor_id"); irid == nil {
-			irid = randx.String(10)
+			rs, err := randString(10)
+			if err != nil {
+				return err
+			}
+			irid = rs
 			c.Session().Set("requestor_id", irid)
 			c.Session().Save()
 		}
-		rid := irid.(string) + "-" + randx.String(10)
+
+		rid := irid.(string) + "-" + rs
 		c.Set("request_id", rid)
 		c.LogField("request_id", rid)
 


Test patch:
diff --git a/genny/build/bin_test.go b/genny/build/bin_test.go
index 230d5ee7..3e4311af 100644
--- a/genny/build/bin_test.go
+++ b/genny/build/bin_test.go
@@ -7,7 +7,7 @@ import (
 	"testing"
 
 	"github.com/gobuffalo/envy"
-	"github.com/gobuffalo/gogen/gomods"
+	"github.com/gobuffalo/genny/gogen/gomods"
 	"github.com/gobuffalo/meta"
 	"github.com/stretchr/testify/require"
 )
diff --git a/genny/plugins/plugin/plugin_test.go b/genny/plugins/plugin/plugin_test.go
index 2af1fcaf..3cf854af 100644
--- a/genny/plugins/plugin/plugin_test.go
+++ b/genny/plugins/plugin/plugin_test.go
@@ -4,7 +4,7 @@ import (
 	"testing"
 
 	"github.com/gobuffalo/genny/gentest"
-	"github.com/gobuffalo/gogen/gomods"
+	"github.com/gobuffalo/genny/gogen/gomods"
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/genny/plugins/plugin/with/generate_test.go b/genny/plugins/plugin/with/generate_test.go
index f67162a8..8c0edd13 100644
--- a/genny/plugins/plugin/with/generate_test.go
+++ b/genny/plugins/plugin/with/generate_test.go
@@ -7,7 +7,7 @@ import (
 	"github.com/gobuffalo/buffalo/genny/plugins/plugin"
 	"github.com/gobuffalo/genny"
 	"github.com/gobuffalo/genny/gentest"
-	"github.com/gobuffalo/gogen/gomods"
+	"github.com/gobuffalo/genny/gogen/gomods"
 	"github.com/gobuffalo/packr/v2"
 	"github.com/stretchr/testify/require"
 )
diff --git a/internal/defaults/defaults_test.go b/internal/defaults/defaults_test.go
new file mode 100644
index 00000000..f757e8f8
--- /dev/null
+++ b/internal/defaults/defaults_test.go
@@ -0,0 +1,52 @@
+package defaults
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func Test_String(t *testing.T) {
+	a := assert.New(t)
+
+	a.Equal(String("", "foo"), "foo")
+	a.Equal(String("bar", "foo"), "bar")
+	var s string
+	a.Equal(String(s, "foo"), "foo")
+}
+
+func Test_Int(t *testing.T) {
+	a := assert.New(t)
+
+	a.Equal(Int(0, 1), 1)
+	a.Equal(Int(2, 1), 2)
+	var s int
+	a.Equal(Int(s, 1), 1)
+}
+
+func Test_Int64(t *testing.T) {
+	a := assert.New(t)
+
+	a.Equal(Int64(0, 1), int64(1))
+	a.Equal(Int64(2, 1), int64(2))
+	var s int64
+	a.Equal(Int64(s, 1), int64(1))
+}
+
+func Test_Float32(t *testing.T) {
+	a := assert.New(t)
+
+	a.Equal(Float32(0, 1), float32(1))
+	a.Equal(Float32(2, 1), float32(2))
+	var s float32
+	a.Equal(Float32(s, 1), float32(1))
+}
+
+func Test_Float64(t *testing.T) {
+	a := assert.New(t)
+
+	a.Equal(Float64(0, 1), float64(1))
+	a.Equal(Float64(2, 1), float64(2))
+	var s float64
+	a.Equal(Float64(s, 1), float64(1))
+}
diff --git a/internal/httpx/content_type_test.go b/internal/httpx/content_type_test.go
new file mode 100644
index 00000000..658ed56b
--- /dev/null
+++ b/internal/httpx/content_type_test.go
@@ -0,0 +1,33 @@
+package httpx
+
+import (
+	"net/http/httptest"
+	"testing"
+
+	"github.com/stretchr/testify/require"
+)
+
+func Test_ContentType(t *testing.T) {
+	r := require.New(t)
+
+	table := []struct {
+		Header   string
+		Value    string
+		Expected string
+	}{
+		{"content-type", "a", "a"},
+		{"Content-Type", "c,d", "c"},
+		{"Content-Type", "e;f", "e"},
+		{"Content-Type", "", ""},
+		{"Accept", "", ""},
+		{"Accept", "*/*", ""},
+		{"Accept", "*/*;q=0.5, text/javascript, application/javascript, application/ecmascript, application/x-ecmascript", "text/javascript"},
+		{"accept", "text/javascript,application/javascript,application/ecmascript,application/x-ecmascript", "text/javascript"},
+	}
+
+	for _, tt := range table {
+		req := httptest.NewRequest("GET", "/", nil)
+		req.Header.Set(tt.Header, tt.Value)
+		r.Equal(tt.Expected, ContentType(req))
+	}
+}
diff --git a/mail/smtp_sender_test.go b/mail/smtp_sender_test.go
index 4f67fa90..a2dde846 100644
--- a/mail/smtp_sender_test.go
+++ b/mail/smtp_sender_test.go
@@ -4,9 +4,9 @@ import (
 	"bytes"
 	"testing"
 
+	"github.com/gobuffalo/buffalo/internal/fakesmtp"
 	"github.com/gobuffalo/buffalo/mail"
 	"github.com/gobuffalo/buffalo/render"
-	"github.com/gobuffalo/x/fakesmtp"
 	"github.com/stretchr/testify/require"
 )