Skip to content

Commit

Permalink
Rename from Play to Revel -- cant use someone elses name after all. A…
Browse files Browse the repository at this point in the history
…lso, make the installation procedure go get instead of git clone, despite the much longer paths
  • Loading branch information
robfig committed Apr 28, 2012
1 parent 4fb3916 commit caa8b9a
Show file tree
Hide file tree
Showing 31 changed files with 179 additions and 179 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ install:
- mkdir -p $HOME/pkg || true
- export GOPATH=$HOME
- export PATH=$PATH:$HOME/go/bin
- ln -s $HOME/builds/robfig/go-play $HOME/src/go-play
- ln -s $HOME/builds/robfig/revel $HOME/src/github.com/robfig/revel
- go get -v github.com/howeyc/fsnotify
- go get -v github.com/kless/goconfig/config
- git clone git://github.com/robfig/go-play.git $HOME/src/play
- git clone git://github.com/robfig/revel.git $HOME/src/github.com/robfig/revel

script:
- cd $HOME/src/play && go build -v .
- cd $HOME/src/play && go test -v .
- cd $HOME/src/github.com/robfig/revel && go build -v .
- cd $HOME/src/github.com/robfig/revel && go test -v .
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Go Play!
# Revel!

This is a port of the amazing [Play! framework](http://www.playframework.org) to the [Go language](http://www.golang.org).

It is a high productivity web framework

[![Build Status](https://secure.travis-ci.org/robfig/go-play.png?branch=master)](http://travis-ci.org/robfig/go-play)
[![Build Status](https://secure.travis-ci.org/robfig/revel.png?branch=master)](http://travis-ci.org/robfig/revel)

# Simple Example

Expand All @@ -24,17 +24,17 @@ Declare a Controller:
```go
// app/controllers/app.go
package controllers
import "play"
import "github.com/robfig/revel"

type Application struct {
*play.Controller
*rev.Controller
}

func (c Application) Index() play.Result {
func (c Application) Index() rev.Result {
return c.Render()
}

func (c Application) ShowApp(id int) play.Result {
func (c Application) ShowApp(id int) rev.Result {
return c.Render(id)
}
```
Expand All @@ -58,7 +58,7 @@ This is an example Controller method that processes a Login request. It demonst
- Setting a cookie

```go
func (c Login) DoLogin(username, password string) play.Result {
func (c Login) DoLogin(username, password string) rev.Result {
// Validate parameters.
c.Validation.Required(username).Message("Please enter a username.")
c.Validation.Required(password).Message("Please enter a password.")
Expand Down Expand Up @@ -124,9 +124,11 @@ There are also helpers to make validation errors easy to surface in the template
From your GOPATH base:

```
go get github.com/robfig/go-play
go build -o /bin/play play/cmd
./bin/play play/samples/booking
go get github.com/howeyc/fsnotify \
github.com/kless/goconfig/config \
github.com/robfig/revel
go build -o /bin/rev github.com/robfig/revel/cmd
./bin/rev github.com/robfig/revel/samples/booking
```

# How it works
Expand Down Expand Up @@ -195,28 +197,29 @@ There is a large list of things left to do.
- Extract default error messages to resource file
- Examples: Regular web page, JSON return, streaming return, comet, websocket
- Clean up stack traces
- Allow access to requestwriter and make it easy to get Play out of the way when necessary
- Allow access to requestwriter and make it easy to get Revel out of the way when necessary
- Make it not hard to do this: https://gist.github.com/2328236
- BigDecimal replacement (for currency / that works with MySQL)
- Fixtures
- How to do moreStyles / moreScripts equivalent.
- Reflection magic does not work if app code imports revel with a modified identifier.

# File layout

Go Play! depends on the GOPATH layout prescribed by the go command line tool. A description is at the end.
Revel depends on the GOPATH layout prescribed by the go command line tool. A description is at the end.

Note that Play must be installed in the same GOPATH as the user app -- it uses that assumption to find its own source, e.g. for finding templates.
Note that Revel must be installed in the same GOPATH as the user app -- it uses that assumption to find its own source, e.g. for finding templates.


## Example layout

Here is the default layout of a Go Play application called `sample`, within a
Here is the default layout of a Revel application called `sample`, within a
typical Go installation.

```
gocode GOPATH root
src GOPATH src directory
play Go Play source code
revel Revel source code
sample
app App sources
controllers App controllers
Expand Down
2 changes: 1 addition & 1 deletion binder.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package play
package rev

import (
"reflect"
Expand Down
2 changes: 1 addition & 1 deletion binder_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package play
package rev

import (
"fmt"
Expand Down
16 changes: 8 additions & 8 deletions cmd/play.go → cmd/rev.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"log"
"os"

"play"
"play/harness"
"github.com/robfig/revel"
"github.com/robfig/revel/harness"
)

func main() {
Expand All @@ -21,24 +21,24 @@ func main() {
usage()
}

mode := play.DEV
mode := rev.DEV
if len(args) == 2 && args[1] == "prod" {
mode = play.PROD
mode = rev.PROD
}

// Find and parse app.conf
play.Init(args[0], mode)
log.Printf("Running app (%s): %s (%s)\n", mode, play.AppName, play.BasePath)
rev.Init(args[0], mode)
log.Printf("Running app (%s): %s (%s)\n", mode, rev.AppName, rev.BasePath)

harness.Run(mode)
}

const header = `~
~ go play! http://www.github.com/robfig/go-play
~ revel! http://www.github.com/robfig/revel
~
`

const usageText = `~ Usage: play import_path [mode]
const usageText = `~ Usage: rev import_path [mode]
`

func usage() {
Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package play
package rev

import (
"github.com/kless/goconfig/config"
Expand Down
4 changes: 2 additions & 2 deletions errors.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package play
package rev

import (
"bytes"
Expand Down Expand Up @@ -60,7 +60,7 @@ func (e *Error) Html() string {
func RenderError(buffer io.Writer, data interface{}) {
if errorTemplate == nil {
errorTemplate = template.Must(template.ParseFiles(
path.Join(PlayTemplatePath, "500.html")))
path.Join(RevelTemplatePath, "500.html")))
}
errorTemplate.Execute(buffer, &data)
}
Loading

0 comments on commit caa8b9a

Please sign in to comment.