rails_backbone_generators 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d69602ad8279414373bf8b18ecce58ec1886db56
4
+ data.tar.gz: 9ba42fbcab97ba86327dfa95aa3085f69db8852f
5
+ SHA512:
6
+ metadata.gz: dd02b0089ad007aa6a3854578400e538d957f2c53bae6329d75094d459c5b7ba928f63ead69b92dbe10758e50286eef8f3338c58bebc94fb58c12dd5f5e92190
7
+ data.tar.gz: 47fd50dcde42c92e44257cfa000b9ff91bb1a1b41225fe9cb2103b3310e8a2365352087ef64bee2c016c6930a0e6d736ee44ff921f07286ee2d90f15ba23646a
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+
15
+ # YARD artifacts
16
+ .yardoc
17
+ _yardoc
18
+ doc/
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Integrum
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,61 @@
1
+ Rails Backbone Generators
2
+ =========================
3
+
4
+ Generators for creating CoffeeScript Backbone Views, Models, Collections and Routers
5
+
6
+ Backbone Model
7
+ --------------
8
+
9
+ Create a CoffeeScript Backbone model with spec
10
+
11
+ Example:
12
+
13
+ rails generate backbone:model thing
14
+
15
+ This will create:
16
+
17
+ app/assets/javascript/models/thing.js.coffee
18
+ spec/javascript/models/thing_spec.js.coffee
19
+
20
+ Backbone Collection
21
+ -------------------
22
+
23
+ Create a CoffeeScript Backbone collection with spec
24
+
25
+ Example:
26
+
27
+ rails generate backbone:collection things
28
+
29
+ This will create:
30
+
31
+ app/assets/javascript/collections/things.js.coffee
32
+ spec/javascript/collections/things_spec.js.coffee
33
+
34
+ Backbone View
35
+ -------------
36
+
37
+ Create a CoffeeScript Backbone view with template and spec
38
+
39
+ Example:
40
+
41
+ rails generate backbone:view thing
42
+
43
+ This will create:
44
+
45
+ app/assets/javascript/views/thing_view.js.coffee
46
+ app/assets/javascript/templates/thing.jst.eco
47
+ spec/javascript/views/thing_view_spec.js.coffee
48
+
49
+ Backbone Router
50
+ ---------------
51
+
52
+ Create a CoffeeScript Backbone router with spec
53
+
54
+ Example:
55
+
56
+ rails generate backbone:router thing
57
+
58
+ This will create:
59
+
60
+ app/assets/javascript/routers/thing_router.js.coffee
61
+ spec/javascript/routers/thing_router_spec.js.coffee
@@ -0,0 +1,9 @@
1
+ Description:
2
+ Create a CoffeeScript Backbone collection with spec
3
+
4
+ Example:
5
+ rails generate backbone:collection Things
6
+
7
+ This will create:
8
+ app/assets/javascript/collections/things.js.coffee
9
+ spec/javascript/collections/things_spec.js.coffee
@@ -0,0 +1,13 @@
1
+ module Backbone
2
+ class CollectionGenerator < Rails::Generators::NamedBase
3
+ source_root File.expand_path('../templates', __FILE__)
4
+
5
+ def copy_collection_file
6
+ template 'collection.js.coffee', "app/assets/javascripts/collections/#{file_name}.js.coffee"
7
+ end
8
+
9
+ def copy_spec_file
10
+ template 'collection_spec.js.coffee', "spec/javascripts/collections/#{file_name}_spec.js.coffee"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1 @@
1
+ class window.<%= class_name %> extends Backbone.Collection
@@ -0,0 +1,4 @@
1
+ describe '<%= class_name %>', ->
2
+ beforeEach ->
3
+ @sut = new <%= class_name %>
4
+
@@ -0,0 +1,9 @@
1
+ Description:
2
+ Create a CoffeeScript Backbone model with spec
3
+
4
+ Example:
5
+ rails generate backbone:model Thing
6
+
7
+ This will create:
8
+ app/assets/javascript/models/thing.js.coffee
9
+ spec/javascript/models/thing_spec.js.coffee
@@ -0,0 +1,13 @@
1
+ module Backbone
2
+ class ModelGenerator < Rails::Generators::NamedBase
3
+ source_root File.expand_path('../templates', __FILE__)
4
+
5
+ def copy_model_file
6
+ template 'model.js.coffee', "app/assets/javascripts/models/#{file_name}.js.coffee"
7
+ end
8
+
9
+ def copy_spec_file
10
+ template 'model_spec.js.coffee', "spec/javascripts/models/#{file_name}_spec.js.coffee"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1 @@
1
+ class window.<%= class_name %> extends Backbone.Model
@@ -0,0 +1,4 @@
1
+ describe '<%= class_name %>', ->
2
+ beforeEach ->
3
+ @sut = new <%= class_name %>
4
+
@@ -0,0 +1,9 @@
1
+ Description:
2
+ Create a CoffeeScript Backbone router with spec
3
+
4
+ Example:
5
+ rails generate backbone:router Thing
6
+
7
+ This will create:
8
+ app/assets/javascript/routers/thing_router.js.coffee
9
+ spec/javascript/routers/thing_router_spec.js.coffee
@@ -0,0 +1,13 @@
1
+ module Backbone
2
+ class RouterGenerator < Rails::Generators::NamedBase
3
+ source_root File.expand_path('../templates', __FILE__)
4
+
5
+ def copy_router_file
6
+ template 'router.js.coffee', "app/assets/javascripts/routers/#{file_name}_router.js.coffee"
7
+ end
8
+
9
+ def copy_spec_file
10
+ template 'router_spec.js.coffee', "spec/javascripts/routers/#{file_name}_router_spec.js.coffee"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1 @@
1
+ class window.<%= class_name %>Router extends Backbone.Router
@@ -0,0 +1,4 @@
1
+ describe '<%= class_name %>Router', ->
2
+ beforeEach ->
3
+ @sut = new <%= class_name %>Router
4
+
@@ -0,0 +1,10 @@
1
+ Description:
2
+ Create a CoffeeScript Backbone view with template and spec
3
+
4
+ Example:
5
+ rails generate backbone:view Thing
6
+
7
+ This will create:
8
+ app/assets/javascript/views/thing_view.js.coffee
9
+ app/assets/javascript/templates/thing.jst.eco
10
+ spec/javascript/views/thing_view_spec.js.coffee
@@ -0,0 +1,8 @@
1
+ class window.<%= class_name %>View extends Backbone.View
2
+ template: JST['templates/<%= file_name %>']
3
+
4
+ context: =>
5
+ {}
6
+
7
+ render: =>
8
+ @$el.html @template @context()
@@ -0,0 +1,5 @@
1
+ describe '<%= class_name %>View', ->
2
+ beforeEach ->
3
+ @sut = new <%= class_name %>View
4
+ @sut.render()
5
+
@@ -0,0 +1,17 @@
1
+ module Backbone
2
+ class ViewGenerator < Rails::Generators::NamedBase
3
+ source_root File.expand_path('../templates', __FILE__)
4
+
5
+ def copy_view_file
6
+ template 'view.js.coffee', "app/assets/javascripts/views/#{file_name}_view.js.coffee"
7
+ end
8
+
9
+ def copy_template_file
10
+ template 'template.jst.eco', "app/assets/javascripts/templates/#{file_name}.jst.eco"
11
+ end
12
+
13
+ def copy_spec_file
14
+ template 'view_spec.js.coffee', "spec/javascripts/views/#{file_name}_view_spec.js.coffee"
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,3 @@
1
+ module RailsBackboneGenerators
2
+ VERSION = '0.0.1'
3
+ end
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rails_backbone_generators'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "rails_backbone_generators"
8
+ spec.version = RailsBackboneGenerators::VERSION
9
+ spec.authors = ["Jade Meskill", "Roy van de Water"]
10
+ spec.email = ["gems@integrumtech.com"]
11
+ spec.description = %q{Rails Backbone Generators}
12
+ spec.summary = %q{Generators for creating CoffeeScript Backbone Views, Models, Collections and Routers}
13
+ spec.homepage = "https://github.com/integrum/rails_backbone_generators"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails_backbone_generators
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jade Meskill
8
+ - Roy van de Water
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-10-25 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ~>
19
+ - !ruby/object:Gem::Version
20
+ version: '1.3'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ version: '1.3'
28
+ description: Rails Backbone Generators
29
+ email:
30
+ - gems@integrumtech.com
31
+ executables: []
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - .gitignore
36
+ - LICENSE
37
+ - README.md
38
+ - lib/generators/backbone/collection/USAGE
39
+ - lib/generators/backbone/collection/collection_generator.rb
40
+ - lib/generators/backbone/collection/templates/collection.js.coffee
41
+ - lib/generators/backbone/collection/templates/collection_spec.js.coffee
42
+ - lib/generators/backbone/model/USAGE
43
+ - lib/generators/backbone/model/model_generator.rb
44
+ - lib/generators/backbone/model/templates/model.js.coffee
45
+ - lib/generators/backbone/model/templates/model_spec.js.coffee
46
+ - lib/generators/backbone/router/USAGE
47
+ - lib/generators/backbone/router/router_generator.rb
48
+ - lib/generators/backbone/router/templates/router.js.coffee
49
+ - lib/generators/backbone/router/templates/router_spec.js.coffee
50
+ - lib/generators/backbone/view/USAGE
51
+ - lib/generators/backbone/view/templates/template.jst.eco
52
+ - lib/generators/backbone/view/templates/view.js.coffee
53
+ - lib/generators/backbone/view/templates/view_spec.js.coffee
54
+ - lib/generators/backbone/view/view_generator.rb
55
+ - lib/rails_backbone_generators.rb
56
+ - rails_backbone_generators.gemspec
57
+ homepage: https://github.com/integrum/rails_backbone_generators
58
+ licenses:
59
+ - MIT
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubyforge_project:
77
+ rubygems_version: 2.0.3
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: Generators for creating CoffeeScript Backbone Views, Models, Collections
81
+ and Routers
82
+ test_files: []