Permalink
Browse files

rev -> revel. Fixes #54

  • Loading branch information...
robfig committed Jan 29, 2013
1 parent 93a30e6 commit f164930331cab02ab1db335f9e7aa51ab52ab2bd
Showing with 303 additions and 304 deletions.
  1. +1 −1 binder.go
  2. +1 −1 binder_test.go
  3. +8 −8 cmd/build.go
  4. +1 −1 cmd/new.go
  5. +3 −3 cmd/package.go
  6. +6 −6 cmd/run.go
  7. +7 −7 cmd/test.go
  8. +1 −1 cmd/util.go
  9. +1 −1 config.go
  10. +2 −2 controller.go
  11. +1 −1 errors.go
  12. +1 −1 field.go
  13. +1 −1 flash.go
  14. +9 −9 harness/app.go
  15. +37 −37 harness/build.go
  16. +20 −20 harness/harness.go
  17. +22 −22 harness/reflect.go
  18. +8 −8 harness/reflect_test.go
  19. +1 −1 http.go
  20. +1 −1 i18n.go
  21. +1 −1 i18n_test.go
  22. +1 −1 init.go
  23. +10 −10 intercept.go
  24. +1 −1 intercept_test.go
  25. +1 −1 libs.go
  26. +9 −9 modules/db/app/db.go
  27. +11 −11 modules/testrunner/app/controllers/testrunner.go
  28. +7 −7 modules/testrunner/app/plugin.go
  29. +1 −1 modules/testrunner/public/css/bootstrap.css
  30. +3 −3 mvc.go
  31. +1 −1 mvc_test.go
  32. +1 −1 params.go
  33. +1 −1 plugin.go
  34. +1 −1 results.go
  35. +1 −2 revel.go
  36. +1 −1 router.go
  37. +1 −1 router_test.go
  38. +6 −6 samples/booking/app/controllers/app.go
  39. +9 −9 samples/booking/app/controllers/hotels.go
  40. +6 −6 samples/booking/app/controllers/init.go
  41. +4 −4 samples/booking/app/models/booking.go
  42. +14 −14 samples/booking/app/models/hotel.go
  43. +11 −11 samples/booking/app/models/user.go
  44. +1 −1 samples/booking/tests/apptest.go
  45. +3 −3 samples/chat/app/controllers/app.go
  46. +5 −5 samples/chat/app/controllers/longpolling.go
  47. +5 −5 samples/chat/app/controllers/refresh.go
  48. +3 −3 samples/chat/app/controllers/websocket.go
  49. +8 −8 samples/facebook-oauth2/app/controllers/app.go
  50. +2 −2 samples/i18n/app/controllers/app.go
  51. +1 −1 samples/i18n/public/css/bootstrap.css
  52. +1 −1 samples/i18n/tests/apptest.go
  53. +11 −11 samples/twitter-oauth/app/controllers/app.go
  54. +2 −2 samples/validation/app/controllers/app.go
  55. +3 −3 samples/validation/app/controllers/sample1.go
  56. +3 −3 samples/validation/app/controllers/sample2.go
  57. +3 −3 samples/validation/app/controllers/sample3.go
  58. +3 −3 samples/validation/app/controllers/sample4.go
  59. +1 −1 samples/validation/app/models/user.go
  60. +1 −1 server.go
  61. +1 −1 session.go
  62. +2 −2 skeleton/app/controllers/app.go
  63. +1 −1 skeleton/public/css/bootstrap.css
  64. +1 −1 skeleton/tests/apptest.go
  65. +2 −2 template.go
  66. +1 −1 tests.go
  67. +1 −1 util.go
  68. +1 −1 util_test.go
  69. +1 −1 validation.go
  70. +1 −1 validators.go
  71. +1 −1 watcher.go
View
@@ -1,4 +1,4 @@
-package rev
+package revel
import (
"io"
View
@@ -1,4 +1,4 @@
-package rev
+package revel
import (
"fmt"
View
@@ -35,8 +35,8 @@ func buildApp(args []string) {
}
appImportPath, destPath := args[0], args[1]
- if !rev.Initialized {
- rev.Init("", appImportPath, "")
+ if !revel.Initialized {
+ revel.Init("", appImportPath, "")
}
os.RemoveAll(destPath)
@@ -53,11 +53,11 @@ func buildApp(args []string) {
// Revel and the app are in a directory structure mirroring import path
srcPath := path.Join(destPath, "src")
- tmpRevelPath := path.Join(srcPath, filepath.FromSlash(rev.REVEL_IMPORT_PATH))
+ tmpRevelPath := path.Join(srcPath, filepath.FromSlash(revel.REVEL_IMPORT_PATH))
mustCopyFile(path.Join(destPath, filepath.Base(app.BinaryPath)), app.BinaryPath)
- mustCopyDir(path.Join(tmpRevelPath, "conf"), path.Join(rev.RevelPath, "conf"), nil)
- mustCopyDir(path.Join(tmpRevelPath, "templates"), path.Join(rev.RevelPath, "templates"), nil)
- mustCopyDir(path.Join(srcPath, filepath.FromSlash(appImportPath)), rev.BasePath, nil)
+ mustCopyDir(path.Join(tmpRevelPath, "conf"), path.Join(revel.RevelPath, "conf"), nil)
+ mustCopyDir(path.Join(tmpRevelPath, "templates"), path.Join(revel.RevelPath, "templates"), nil)
+ mustCopyDir(path.Join(srcPath, filepath.FromSlash(appImportPath)), revel.BasePath, nil)
tmplData := map[string]interface{}{
"BinName": filepath.Base(app.BinaryPath),
@@ -66,11 +66,11 @@ func buildApp(args []string) {
mustRenderTemplate(
path.Join(destPath, "run.sh"),
- path.Join(rev.RevelPath, "cmd", "package_run.sh.template"),
+ path.Join(revel.RevelPath, "cmd", "package_run.sh.template"),
tmplData)
mustRenderTemplate(
path.Join(destPath, "run.bat"),
- path.Join(rev.RevelPath, "cmd", "package_run.bat.template"),
+ path.Join(revel.RevelPath, "cmd", "package_run.bat.template"),
tmplData)
}
View
@@ -57,7 +57,7 @@ func newApp(args []string) {
return
}
- revelPkg, err := build.Import(rev.REVEL_IMPORT_PATH, "", build.FindOnly)
+ revelPkg, err := build.Import(revel.REVEL_IMPORT_PATH, "", build.FindOnly)
if err != nil {
fmt.Fprintf(os.Stderr, "Abort: Could not find Revel source code: %s\n", err)
return
View
@@ -32,14 +32,14 @@ func packageApp(args []string) {
}
appImportPath := args[0]
- rev.Init("", appImportPath, "")
+ revel.Init("", appImportPath, "")
// Remove the archive if it already exists.
- destFile := path.Base(rev.BasePath) + ".zip"
+ destFile := path.Base(revel.BasePath) + ".zip"
os.Remove(destFile)
// Collect stuff in a temp directory.
- tmpDir, err := ioutil.TempDir("", path.Base(rev.BasePath))
+ tmpDir, err := ioutil.TempDir("", path.Base(revel.BasePath))
panicOnError(err, "Failed to get temp dir")
buildApp([]string{args[0], tmpDir})
View
@@ -42,23 +42,23 @@ func runApp(args []string) {
}
// Find and parse app.conf
- rev.Init(mode, args[0], "")
+ revel.Init(mode, args[0], "")
// Determine the override port, if any.
- port := rev.HttpPort
+ port := revel.HttpPort
if len(args) == 3 {
var err error
if port, err = strconv.Atoi(args[2]); err != nil {
errorf("Failed to parse port as integer: %s", args[2])
}
}
- rev.INFO.Printf("Running %s (%s) in %s mode\n", rev.AppName, rev.ImportPath, mode)
- rev.TRACE.Println("Base path:", rev.BasePath)
+ revel.INFO.Printf("Running %s (%s) in %s mode\n", revel.AppName, revel.ImportPath, mode)
+ revel.TRACE.Println("Base path:", revel.BasePath)
// If the app is run in "watched" mode, use the harness to run it.
- if rev.Config.BoolDefault("watch", true) && rev.Config.BoolDefault("watch.code", true) {
- rev.HttpPort = port
+ if revel.Config.BoolDefault("watch", true) && revel.Config.BoolDefault("watch.code", true) {
+ revel.HttpPort = port
harness.NewHarness().Run() // Never returns.
}
View
@@ -46,11 +46,11 @@ func testApp(args []string) {
}
// Find and parse app.conf
- rev.Init(mode, args[0], "")
+ revel.Init(mode, args[0], "")
// Ensure that the testrunner is loaded in this mode.
testRunnerFound := false
- for _, module := range rev.Modules {
+ for _, module := range revel.Modules {
if module.ImportPath == "github.com/robfig/revel/modules/testrunner" {
testRunnerFound = true
break
@@ -67,7 +67,7 @@ You can add it to a run mode configuration with the following line:
}
// Create a directory to hold the test result files.
- resultPath := path.Join(rev.BasePath, "test-results")
+ resultPath := path.Join(revel.BasePath, "test-results")
if err = os.RemoveAll(resultPath); err != nil {
errorf("Failed to remove test result directory %s: %s", resultPath, err)
}
@@ -92,11 +92,11 @@ You can add it to a run mode configuration with the following line:
// Start the app...
cmd.Start()
defer cmd.Kill()
- rev.INFO.Printf("Testing %s (%s) in %s mode\n", rev.AppName, rev.ImportPath, mode)
+ revel.INFO.Printf("Testing %s (%s) in %s mode\n", revel.AppName, revel.ImportPath, mode)
// Get a list of tests.
var testSuites []controllers.TestSuiteDesc
- baseUrl := fmt.Sprintf("http://127.0.0.1:%d", rev.HttpPort)
+ baseUrl := fmt.Sprintf("http://127.0.0.1:%d", revel.HttpPort)
resp, err := http.Get(baseUrl + "/@tests.list")
if err != nil {
errorf("Failed to request test list: %s", err)
@@ -108,7 +108,7 @@ You can add it to a run mode configuration with the following line:
fmt.Println()
// Load the result template, which we execute for each suite.
- TemplateLoader := rev.NewTemplateLoader(rev.TemplatePaths)
+ TemplateLoader := revel.NewTemplateLoader(revel.TemplatePaths)
if err := TemplateLoader.Refresh(); err != nil {
errorf("Failed to compile templates: %s", err)
}
@@ -117,7 +117,7 @@ You can add it to a run mode configuration with the following line:
errorf("Failed to load suite result template: %s", err)
}
- // Run each suite.
+ // Run each suite.
overallSuccess := true
for _, suite := range testSuites {
// Print the name of the suite we're running.
View
@@ -16,7 +16,7 @@ import (
type LoggedError struct{ error }
func panicOnError(err error, msg string) {
- if revErr, ok := err.(*rev.Error); (ok && revErr != nil) || (!ok && err != nil) {
+ if revErr, ok := err.(*revel.Error); (ok && revErr != nil) || (!ok && err != nil) {
fmt.Fprintf(os.Stderr, "Abort: %s: %s\n", msg, err)
panic(LoggedError{err})
}
View
@@ -1,4 +1,4 @@
-package rev
+package revel
import (
"errors"
View
@@ -1,4 +1,4 @@
-package rev
+package revel
import (
"database/sql"
@@ -141,7 +141,7 @@ func (c *Controller) RenderError(err error) Result {
//
// For example:
//
-// func (c Users) ShowUser(id int) rev.Result {
+// func (c Users) ShowUser(id int) revel.Result {
// user := loadUser(id)
// return c.Render(user)
// }
View
@@ -1,4 +1,4 @@
-package rev
+package revel
import (
"fmt"
View
@@ -1,4 +1,4 @@
-package rev
+package revel
import (
"reflect"
View
@@ -1,4 +1,4 @@
-package rev
+package revel
import (
"fmt"
View
@@ -35,16 +35,16 @@ func (a *App) Kill() {
}
// AppCmd manages the running of a Revel app server.
-// It requires rev.Init to have been called previously.
+// It requires revel.Init to have been called previously.
type AppCmd struct {
*exec.Cmd
}
func NewAppCmd(binPath string, port int) AppCmd {
cmd := exec.Command(binPath,
fmt.Sprintf("-port=%d", port),
- fmt.Sprintf("-importPath=%s", rev.ImportPath),
- fmt.Sprintf("-runMode=%s", rev.RunMode))
+ fmt.Sprintf("-importPath=%s", revel.ImportPath),
+ fmt.Sprintf("-runMode=%s", revel.RunMode))
cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
return AppCmd{cmd}
}
@@ -53,9 +53,9 @@ func NewAppCmd(binPath string, port int) AppCmd {
func (cmd AppCmd) Start() error {
listeningWriter := startupListeningWriter{os.Stdout, make(chan bool)}
cmd.Stdout = listeningWriter
- rev.TRACE.Println("Exec app:", cmd.Path, cmd.Args)
+ revel.TRACE.Println("Exec app:", cmd.Path, cmd.Args)
if err := cmd.Cmd.Start(); err != nil {
- rev.ERROR.Fatalln("Error running:", err)
+ revel.ERROR.Fatalln("Error running:", err)
}
select {
@@ -74,19 +74,19 @@ func (cmd AppCmd) Start() error {
// Run the app server inline. Never returns.
func (cmd AppCmd) Run() {
- rev.TRACE.Println("Exec app:", cmd.Path, cmd.Args)
+ revel.TRACE.Println("Exec app:", cmd.Path, cmd.Args)
if err := cmd.Cmd.Run(); err != nil {
- rev.ERROR.Fatalln("Error running:", err)
+ revel.ERROR.Fatalln("Error running:", err)
}
}
// Terminate the app server if it's running.
func (cmd AppCmd) Kill() {
if cmd.Cmd != nil && (cmd.ProcessState == nil || !cmd.ProcessState.Exited()) {
- rev.TRACE.Println("Killing revel server pid", cmd.Process.Pid)
+ revel.TRACE.Println("Killing revel server pid", cmd.Process.Pid)
err := cmd.Process.Kill()
if err != nil {
- rev.ERROR.Fatalln("Failed to kill revel server:", err)
+ revel.ERROR.Fatalln("Failed to kill revel server:", err)
}
}
}
Oops, something went wrong.

0 comments on commit f164930

Please sign in to comment.