backbone-rails 0.3.3 → 0.3.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -9,6 +9,8 @@ Like [jquery-rails](https://github.com/indirect/jquery-rails/), this gem bundles
9
9
 
10
10
  ## How to use it
11
11
 
12
+ ### Rails 3.1
13
+
12
14
  Add it to your Gemfile:
13
15
 
14
16
  gem 'backbone-rails'
@@ -25,6 +27,14 @@ With pure javascript, the lines would look like `app/assets/javascripts/applicat
25
27
  //= require underscore
26
28
  //= require backbone
27
29
 
30
+ ### Rails 3.0
31
+
32
+ `backbone-rails` ships with a generator that copies all javascript files to `public/javascripts`. You can run it with `rails g backbone:install`.
33
+
28
34
  ## Versioning
29
35
 
30
36
  The gem will follow backbone versioning.
37
+
38
+ ## Contributors
39
+
40
+ * [John Bintz](https://github.com/johnbintz) (Support for Rails 3.0 via generators)
@@ -1,9 +1,11 @@
1
+ require 'rails'
1
2
 
2
3
  module Backbone
3
4
  module Rails
4
-
5
- class Engine < ::Rails::Engine
5
+ if ::Rails.version < "3.1"
6
+ require 'backbone-rails/railtie'
7
+ else
8
+ require 'backbone-rails/engine'
6
9
  end
7
-
8
10
  end
9
11
  end
@@ -0,0 +1,9 @@
1
+ require 'rails'
2
+
3
+ module Backbone
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
8
+ end
9
+
@@ -0,0 +1,19 @@
1
+ require 'rails/generators'
2
+
3
+ module Backbone
4
+ class Install < ::Rails::Generators::Base
5
+ JAVASCRIPTS = File.expand_path('../../../vendor/assets/javascripts', __FILE__)
6
+
7
+ def self.source_root
8
+ @source_root ||= JAVASCRIPTS
9
+ end
10
+
11
+ def copy_backbone
12
+ Dir[File.join(JAVASCRIPTS, '*.js')].each do |file|
13
+ file = File.split(file).last
14
+ copy_file file, "public/javascripts/#{file}"
15
+ end
16
+ end
17
+ end
18
+ end
19
+
@@ -0,0 +1,12 @@
1
+ require 'rails'
2
+
3
+ module Backbone
4
+ module Rails
5
+ class Railtie < ::Rails::Railtie
6
+ generators do
7
+ require 'backbone-rails/generators'
8
+ end
9
+ end
10
+ end
11
+ end
12
+
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: backbone-rails
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.3
5
+ version: 0.3.3.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Alexander Flatter
@@ -10,21 +10,21 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-19 00:00:00 +02:00
13
+ date: 2011-05-24 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
- name: railties
17
+ name: rails
18
18
  prerelease: false
19
19
  requirement: &id001 !ruby/object:Gem::Requirement
20
20
  none: false
21
21
  requirements:
22
- - - ~>
22
+ - - ">="
23
23
  - !ruby/object:Gem::Version
24
- version: 3.1.0.beta1
24
+ version: 3.0.0
25
25
  type: :runtime
26
26
  version_requirements: *id001
27
- description: Ships backbone and underscore to your Rails 3.1 application through the new asset pipeline.
27
+ description: Ships backbone and underscore to your Rails 3.1 application through the new asset pipeline. Rails 3.0 is supported via generators.
28
28
  email:
29
29
  - aflatter@farbenmeer.net
30
30
  executables: []
@@ -35,6 +35,9 @@ extra_rdoc_files: []
35
35
 
36
36
  files:
37
37
  - lib/backbone-rails.rb
38
+ - lib/backbone-rails/generators.rb
39
+ - lib/backbone-rails/engine.rb
40
+ - lib/backbone-rails/railtie.rb
38
41
  - vendor/assets/javascripts/underscore.js
39
42
  - vendor/assets/javascripts/backbone.js
40
43
  - vendor/assets/javascripts/json2.js
@@ -67,6 +70,6 @@ rubyforge_project:
67
70
  rubygems_version: 1.5.0
68
71
  signing_key:
69
72
  specification_version: 3
70
- summary: backbone and underscore for Rails 3.1
73
+ summary: backbone and underscore for Rails
71
74
  test_files: []
72
75