spine-rails 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +13 -11
- data/lib/generators/spine/controller/controller_generator.rb +5 -1
- data/lib/generators/spine/new/templates/index.coffee.erb +4 -1
- data/lib/generators/spine/view/view_generator.rb +6 -2
- data/lib/spine/rails/version.rb +1 -1
- metadata +6 -7
- data/app/assets/javascripts/spine/rails.js +0 -3
data/README.md
CHANGED
@@ -12,8 +12,6 @@ This gem does two things:
|
|
12
12
|
|
13
13
|
* Adds some Spine generators, so you can easily create Spine Models, Views and Controllers.
|
14
14
|
|
15
|
-
For versions of Rails less than 3.1, it only provides the generator to install JavaScript file into public directory.
|
16
|
-
|
17
15
|
### Installation
|
18
16
|
|
19
17
|
In your Gemfile, add this line:
|
@@ -39,6 +37,8 @@ By default your application will be namespaced by the `app` directory. You can s
|
|
39
37
|
|
40
38
|
rails g spine:new --app foo_bar
|
41
39
|
|
40
|
+
**NOTE:** If you use the `--app` option here, then you will also have to specify it with other generators.
|
41
|
+
|
42
42
|
Use the top-level level `index.coffee` file to setup namespacing and initial controller instantiation.
|
43
43
|
|
44
44
|
## Generators
|
@@ -49,25 +49,25 @@ spine-rails provides three simple generators to help you get started:
|
|
49
49
|
|
50
50
|
rails g spine:model User email username full_name
|
51
51
|
|
52
|
-
This generator creates a very minimal model inside `app/assets/javascript/models`. You
|
52
|
+
This generator creates a very minimal model inside `app/assets/javascript/app/models`. You have to provide a list of attributes for the model.
|
53
53
|
|
54
54
|
### Controller
|
55
55
|
|
56
56
|
rails g spine:controller Users
|
57
57
|
|
58
|
-
This generator creates a minimal `Users` controller in `app/assets/javascripts/controllers` to get you started.
|
58
|
+
This generator creates a minimal `Users` controller in `app/assets/javascripts/app/controllers` to get you started.
|
59
59
|
|
60
60
|
### View
|
61
61
|
|
62
62
|
rails g spine:view users/index
|
63
63
|
|
64
|
-
This
|
64
|
+
This generator creates a blank Spine view `app/assets/javascripts/app/views/users/index.jst.ejs`.
|
65
65
|
|
66
|
-
The generator will create views in `hamljs`, `eco` or `ejs` format, depending on
|
66
|
+
The generator will create views in `hamljs`, `eco` or `ejs` format, depending on the gems availale:
|
67
67
|
|
68
|
-
|
69
|
-
|
70
|
-
|
68
|
+
1. [eco](https://github.com/sstephenson/eco) - will use ECO templates
|
69
|
+
2. [rub-haml-js](https://github.com/dnagir/ruby-haml-js) - will use HAMLJS templates
|
70
|
+
3. otherwise, EJS templates will be used
|
71
71
|
|
72
72
|
## Example Usage
|
73
73
|
|
@@ -77,7 +77,7 @@ Created a new Rails 3.1 application called `blog`.
|
|
77
77
|
|
78
78
|
Edit your Gemfile and add
|
79
79
|
|
80
|
-
gem
|
80
|
+
gem "spine-rails"
|
81
81
|
|
82
82
|
Install the gem and generate resource.
|
83
83
|
|
@@ -116,6 +116,8 @@ Reload the page, then:
|
|
116
116
|
|
117
117
|
For more information on how to integrate Spine with Rails, please see the [Rails guide](http://spinejs.com/docs/rails).
|
118
118
|
|
119
|
+
Also if you want to have some useful helpers to bridge the gap between Spine and Rails, then [spine-extensions](https://github.com/dnagir/spine-extensions) is for you.
|
120
|
+
|
119
121
|
## Attributions
|
120
122
|
|
121
|
-
This plugin was made by [Alex MacCaw](http://alexmaccaw.co.uk) with major contributions from [Dmytrii Nagirniak](https://github.com/dnagir). It's under the same license as [Spine](http://spinejs.com) (MIT).
|
123
|
+
This plugin was made by [Alex MacCaw](http://alexmaccaw.co.uk) with major contributions from [Dmytrii Nagirniak](https://github.com/dnagir). It's under the same license as [Spine](http://spinejs.com) (MIT).
|
@@ -8,7 +8,11 @@ module Spine
|
|
8
8
|
desc "Generate a Spine controller"
|
9
9
|
|
10
10
|
def create_controller
|
11
|
-
template "controller.coffee.erb",
|
11
|
+
template "controller.coffee.erb", File.join(
|
12
|
+
"app/assets/javascripts",
|
13
|
+
app_name, "controllers",
|
14
|
+
class_path, file_name.pluralize + ".coffee"
|
15
|
+
)
|
12
16
|
end
|
13
17
|
end
|
14
18
|
end
|
@@ -13,6 +13,9 @@
|
|
13
13
|
#= require_tree ./views
|
14
14
|
|
15
15
|
class <%= app_class %> extends Spine.Controller
|
16
|
+
@view: (name) ->
|
17
|
+
JST["<%= app_name %>/views/#{name}"]
|
18
|
+
|
16
19
|
constructor: ->
|
17
20
|
super
|
18
21
|
|
@@ -20,6 +23,6 @@ class <%= app_class %> extends Spine.Controller
|
|
20
23
|
# @append(@items = new <%= app_class %>.Items)
|
21
24
|
# ...
|
22
25
|
|
23
|
-
Spine.Route.setup()
|
26
|
+
Spine.Route.setup()
|
24
27
|
|
25
28
|
window.<%= app_class %> = <%= app_class %>
|
@@ -16,8 +16,12 @@ module Spine
|
|
16
16
|
else
|
17
17
|
'ejs'
|
18
18
|
end
|
19
|
-
|
20
|
-
template "view.#{view_format}.erb",
|
19
|
+
|
20
|
+
template "view.#{view_format}.erb", File.join(
|
21
|
+
"app/assets/javascripts",
|
22
|
+
app_name, "views",
|
23
|
+
class_path, file_name + ".jst.#{view_format}"
|
24
|
+
)
|
21
25
|
end
|
22
26
|
end
|
23
27
|
end
|
data/lib/spine/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spine-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-10-
|
12
|
+
date: 2011-10-22 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70281048121640 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70281048121640
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bundler
|
27
|
-
requirement: &
|
27
|
+
requirement: &70281048121260 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70281048121260
|
36
36
|
description: This gem provides Spine for your Rails 3 application.
|
37
37
|
email:
|
38
38
|
- info@eribium.org
|
@@ -51,7 +51,6 @@ files:
|
|
51
51
|
- app/assets/javascripts/spine/list.js
|
52
52
|
- app/assets/javascripts/spine/local.js
|
53
53
|
- app/assets/javascripts/spine/manager.js
|
54
|
-
- app/assets/javascripts/spine/rails.js
|
55
54
|
- app/assets/javascripts/spine/relation.js
|
56
55
|
- app/assets/javascripts/spine/route.js
|
57
56
|
- app/assets/javascripts/spine/tabs.js
|