cocoon 1.0.8 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -10,6 +10,8 @@ group :development, :test do
10
10
  gem "rspec", ">= 2.6.0"
11
11
  gem "actionpack", ">=3.0.0"
12
12
  gem "simplecov", :require => false
13
+
14
+ gem "generator_spec"
13
15
  end
14
16
 
15
17
  # To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
@@ -33,6 +33,9 @@ GEM
33
33
  diff-lcs (1.1.2)
34
34
  erubis (2.6.6)
35
35
  abstract (>= 1.0.0)
36
+ generator_spec (0.8.3)
37
+ rails (~> 3.0)
38
+ rspec-rails
36
39
  git (1.2.5)
37
40
  i18n (0.5.0)
38
41
  jeweler (1.6.2)
@@ -95,6 +98,7 @@ PLATFORMS
95
98
 
96
99
  DEPENDENCIES
97
100
  actionpack (>= 3.0.0)
101
+ generator_spec
98
102
  jeweler
99
103
  json_pure
100
104
  rails (>= 3.0.0)
data/History.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Change History / Release Notes
2
2
 
3
+ ## Version 1.0.10
4
+
5
+ * Fuck! Built the gem with 1.9.2 again. Built the gem again with 1.8.7.
6
+
7
+ ## Version 1.0.9
8
+
9
+ * is now rails 3.1 compatible. If you are not using Rails 3.1 yet, this should have no effect.
10
+ For rails 3.1 the cocoon.js no longer needs to be installed using the `rails g cocoon:install`. It is
11
+ automatically used from the gem.
12
+
3
13
  ## Version 1.0.8
4
14
 
5
15
  * Loosened the gem dependencies.
@@ -24,7 +24,7 @@ Inside your `Gemfile` add the following:
24
24
 
25
25
  gem "cocoon"
26
26
 
27
- Run the installation task:
27
+ If you are using Rails 3.0.x, you need to run the installation task (since rails 3.1 this is no longer needed):
28
28
 
29
29
  rails g cocoon:install
30
30
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.8
1
+ 1.0.10
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cocoon}
8
- s.version = "1.0.8"
8
+ s.version = "1.0.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nathan Van der Auwera"]
12
- s.date = %q{2011-07-21}
12
+ s.date = %q{2011-07-24}
13
13
  s.description = %q{Unobtrusive nested forms handling, using jQuery. Use this and discover cocoon-heaven.}
14
14
  s.email = %q{nathan@dixis.com}
15
15
  s.extra_rdoc_files = [
@@ -24,11 +24,11 @@ Gem::Specification.new do |s|
24
24
  "README.markdown",
25
25
  "Rakefile",
26
26
  "VERSION",
27
+ "app/assets/javascripts/cocoon.js",
27
28
  "cocoon.gemspec",
28
29
  "lib/cocoon.rb",
29
30
  "lib/cocoon/view_helpers.rb",
30
31
  "lib/generators/cocoon/install/install_generator.rb",
31
- "lib/generators/cocoon/install/templates/cocoon.js",
32
32
  "spec/cocoon_spec.rb",
33
33
  "spec/dummy/Rakefile",
34
34
  "spec/dummy/app/controllers/application_controller.rb",
@@ -68,6 +68,7 @@ Gem::Specification.new do |s|
68
68
  "spec/dummy/public/javascripts/rails.js",
69
69
  "spec/dummy/public/stylesheets/.gitkeep",
70
70
  "spec/dummy/script/rails",
71
+ "spec/generators/install_generator_spec.rb",
71
72
  "spec/integration/navigation_spec.rb",
72
73
  "spec/spec_helper.rb"
73
74
  ]
@@ -88,6 +89,7 @@ Gem::Specification.new do |s|
88
89
  s.add_development_dependency(%q<rspec>, [">= 2.6.0"])
89
90
  s.add_development_dependency(%q<actionpack>, [">= 3.0.0"])
90
91
  s.add_development_dependency(%q<simplecov>, [">= 0"])
92
+ s.add_development_dependency(%q<generator_spec>, [">= 0"])
91
93
  s.add_development_dependency(%q<rspec>, [">= 2.0.0"])
92
94
  else
93
95
  s.add_dependency(%q<rails>, [">= 3.0.0"])
@@ -98,6 +100,7 @@ Gem::Specification.new do |s|
98
100
  s.add_dependency(%q<rspec>, [">= 2.6.0"])
99
101
  s.add_dependency(%q<actionpack>, [">= 3.0.0"])
100
102
  s.add_dependency(%q<simplecov>, [">= 0"])
103
+ s.add_dependency(%q<generator_spec>, [">= 0"])
101
104
  s.add_dependency(%q<rspec>, [">= 2.0.0"])
102
105
  end
103
106
  else
@@ -109,6 +112,7 @@ Gem::Specification.new do |s|
109
112
  s.add_dependency(%q<rspec>, [">= 2.6.0"])
110
113
  s.add_dependency(%q<actionpack>, [">= 3.0.0"])
111
114
  s.add_dependency(%q<simplecov>, [">= 0"])
115
+ s.add_dependency(%q<generator_spec>, [">= 0"])
112
116
  s.add_dependency(%q<rspec>, [">= 2.0.0"])
113
117
  end
114
118
  end
@@ -1,7 +1,7 @@
1
1
  require 'cocoon/view_helpers'
2
2
 
3
3
  module Cocoon
4
- class Railtie < ::Rails::Railtie
4
+ class Engine < ::Rails::Engine
5
5
 
6
6
  config.before_initialize do
7
7
  config.action_view.javascript_expansions[:cocoon] = %w(cocoon)
@@ -2,10 +2,14 @@ module Cocoon
2
2
  module Generators
3
3
  class InstallGenerator < ::Rails::Generators::Base
4
4
  source_root File.expand_path('../templates', __FILE__)
5
- desc "This generator installs the javascript needed for cocoon"
6
5
 
6
+ desc "This generator installs the javascript needed for cocoon"
7
7
  def copy_the_javascript
8
- copy_file "cocoon.js", "public/javascripts/cocoon.js"
8
+ if ::Rails.version[0..2].to_f >= 3.1
9
+ puts "Installing is no longer required since Rails 3.1"
10
+ else
11
+ copy_file "../../../../../app/assets/javascripts/cocoon.js", "public/javascripts/cocoon.js"
12
+ end
9
13
  end
10
14
 
11
15
  end
@@ -0,0 +1,47 @@
1
+ require 'spec_helper'
2
+ require 'generator_spec/test_case'
3
+ require 'generators/cocoon/install/install_generator'
4
+
5
+ describe Cocoon::Generators::InstallGenerator do
6
+ include GeneratorSpec::TestCase
7
+
8
+ destination File.expand_path("../../tmp", __FILE__)
9
+
10
+ context "in rails 3.0" do
11
+ context "with no arguments" do
12
+ before(:all) do
13
+ ::Rails.stub(:version) { '3.0.8' }
14
+ prepare_destination
15
+ run_generator
16
+ end
17
+
18
+ it "stubs the version correctly" do
19
+ Rails.version[0..2].should == "3.0"
20
+ end
21
+
22
+ it "stubs the version correctly" do
23
+ test_version = (Rails.version[0..2].to_f >= 3.1)
24
+ test_version.should be_false
25
+ end
26
+
27
+ it "copies cocoon.js to the correct folder" do
28
+ assert_file "public/javascripts/cocoon.js"
29
+ end
30
+ end
31
+ end
32
+
33
+ context "in rails 3.1" do
34
+ context "with no arguments" do
35
+ before(:all) do
36
+ ::Rails.stub(:version) { '3.1.0' }
37
+ prepare_destination
38
+ run_generator
39
+ end
40
+
41
+ it "does not copy cocoon.js" do
42
+ assert_no_file "public/javascripts/cocoon.js"
43
+ end
44
+ end
45
+ end
46
+
47
+ end
metadata CHANGED
@@ -1,124 +1,182 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: cocoon
3
- version: !ruby/object:Gem::Version
4
- version: 1.0.8
3
+ version: !ruby/object:Gem::Version
4
+ hash: 3
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 10
10
+ version: 1.0.10
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Nathan Van der Auwera
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-07-21 00:00:00.000000000 +02:00
17
+
18
+ date: 2011-07-24 00:00:00 +02:00
13
19
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: rails
17
- requirement: &13181180 !ruby/object:Gem::Requirement
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ type: :development
23
+ requirement: &id001 !ruby/object:Gem::Requirement
18
24
  none: false
19
- requirements:
20
- - - ! '>='
21
- - !ruby/object:Gem::Version
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 7
29
+ segments:
30
+ - 3
31
+ - 0
32
+ - 0
22
33
  version: 3.0.0
23
- type: :development
34
+ name: rails
35
+ version_requirements: *id001
24
36
  prerelease: false
25
- version_requirements: *13181180
26
- - !ruby/object:Gem::Dependency
27
- name: sqlite3-ruby
28
- requirement: &13180640 !ruby/object:Gem::Requirement
29
- none: false
30
- requirements:
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
37
+ - !ruby/object:Gem::Dependency
34
38
  type: :development
35
- prerelease: false
36
- version_requirements: *13180640
37
- - !ruby/object:Gem::Dependency
38
- name: json_pure
39
- requirement: &13180120 !ruby/object:Gem::Requirement
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
40
  none: false
41
- requirements:
42
- - - ! '>='
43
- - !ruby/object:Gem::Version
44
- version: '0'
45
- type: :development
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 3
45
+ segments:
46
+ - 0
47
+ version: "0"
48
+ name: sqlite3-ruby
49
+ version_requirements: *id002
46
50
  prerelease: false
47
- version_requirements: *13180120
48
- - !ruby/object:Gem::Dependency
49
- name: jeweler
50
- requirement: &13179600 !ruby/object:Gem::Requirement
51
+ - !ruby/object:Gem::Dependency
52
+ type: :development
53
+ requirement: &id003 !ruby/object:Gem::Requirement
51
54
  none: false
52
- requirements:
53
- - - ! '>='
54
- - !ruby/object:Gem::Version
55
- version: '0'
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ hash: 3
59
+ segments:
60
+ - 0
61
+ version: "0"
62
+ name: json_pure
63
+ version_requirements: *id003
64
+ prerelease: false
65
+ - !ruby/object:Gem::Dependency
56
66
  type: :development
67
+ requirement: &id004 !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ hash: 3
73
+ segments:
74
+ - 0
75
+ version: "0"
76
+ name: jeweler
77
+ version_requirements: *id004
57
78
  prerelease: false
58
- version_requirements: *13179600
59
- - !ruby/object:Gem::Dependency
60
- name: rspec-rails
61
- requirement: &13179100 !ruby/object:Gem::Requirement
79
+ - !ruby/object:Gem::Dependency
80
+ type: :development
81
+ requirement: &id005 !ruby/object:Gem::Requirement
62
82
  none: false
63
- requirements:
64
- - - ! '>='
65
- - !ruby/object:Gem::Version
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ hash: 23
87
+ segments:
88
+ - 2
89
+ - 6
90
+ - 0
66
91
  version: 2.6.0
67
- type: :development
92
+ name: rspec-rails
93
+ version_requirements: *id005
68
94
  prerelease: false
69
- version_requirements: *13179100
70
- - !ruby/object:Gem::Dependency
71
- name: rspec
72
- requirement: &13177320 !ruby/object:Gem::Requirement
95
+ - !ruby/object:Gem::Dependency
96
+ type: :development
97
+ requirement: &id006 !ruby/object:Gem::Requirement
73
98
  none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ hash: 23
103
+ segments:
104
+ - 2
105
+ - 6
106
+ - 0
77
107
  version: 2.6.0
78
- type: :development
108
+ name: rspec
109
+ version_requirements: *id006
79
110
  prerelease: false
80
- version_requirements: *13177320
81
- - !ruby/object:Gem::Dependency
82
- name: actionpack
83
- requirement: &13176760 !ruby/object:Gem::Requirement
111
+ - !ruby/object:Gem::Dependency
112
+ type: :development
113
+ requirement: &id007 !ruby/object:Gem::Requirement
84
114
  none: false
85
- requirements:
86
- - - ! '>='
87
- - !ruby/object:Gem::Version
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ hash: 7
119
+ segments:
120
+ - 3
121
+ - 0
122
+ - 0
88
123
  version: 3.0.0
89
- type: :development
124
+ name: actionpack
125
+ version_requirements: *id007
90
126
  prerelease: false
91
- version_requirements: *13176760
92
- - !ruby/object:Gem::Dependency
93
- name: simplecov
94
- requirement: &13176220 !ruby/object:Gem::Requirement
127
+ - !ruby/object:Gem::Dependency
128
+ type: :development
129
+ requirement: &id008 !ruby/object:Gem::Requirement
95
130
  none: false
96
- requirements:
97
- - - ! '>='
98
- - !ruby/object:Gem::Version
99
- version: '0'
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ hash: 3
135
+ segments:
136
+ - 0
137
+ version: "0"
138
+ name: simplecov
139
+ version_requirements: *id008
140
+ prerelease: false
141
+ - !ruby/object:Gem::Dependency
100
142
  type: :development
143
+ requirement: &id009 !ruby/object:Gem::Requirement
144
+ none: false
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ hash: 3
149
+ segments:
150
+ - 0
151
+ version: "0"
152
+ name: generator_spec
153
+ version_requirements: *id009
101
154
  prerelease: false
102
- version_requirements: *13176220
103
- - !ruby/object:Gem::Dependency
104
- name: rspec
105
- requirement: &13175680 !ruby/object:Gem::Requirement
155
+ - !ruby/object:Gem::Dependency
156
+ type: :development
157
+ requirement: &id010 !ruby/object:Gem::Requirement
106
158
  none: false
107
- requirements:
108
- - - ! '>='
109
- - !ruby/object:Gem::Version
159
+ requirements:
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ hash: 15
163
+ segments:
164
+ - 2
165
+ - 0
166
+ - 0
110
167
  version: 2.0.0
111
- type: :development
168
+ name: rspec
169
+ version_requirements: *id010
112
170
  prerelease: false
113
- version_requirements: *13175680
114
- description: Unobtrusive nested forms handling, using jQuery. Use this and discover
115
- cocoon-heaven.
171
+ description: Unobtrusive nested forms handling, using jQuery. Use this and discover cocoon-heaven.
116
172
  email: nathan@dixis.com
117
173
  executables: []
174
+
118
175
  extensions: []
119
- extra_rdoc_files:
176
+
177
+ extra_rdoc_files:
120
178
  - README.markdown
121
- files:
179
+ files:
122
180
  - .travis.yml
123
181
  - Gemfile
124
182
  - Gemfile.lock
@@ -127,11 +185,11 @@ files:
127
185
  - README.markdown
128
186
  - Rakefile
129
187
  - VERSION
188
+ - app/assets/javascripts/cocoon.js
130
189
  - cocoon.gemspec
131
190
  - lib/cocoon.rb
132
191
  - lib/cocoon/view_helpers.rb
133
192
  - lib/generators/cocoon/install/install_generator.rb
134
- - lib/generators/cocoon/install/templates/cocoon.js
135
193
  - spec/cocoon_spec.rb
136
194
  - spec/dummy/Rakefile
137
195
  - spec/dummy/app/controllers/application_controller.rb
@@ -171,35 +229,42 @@ files:
171
229
  - spec/dummy/public/javascripts/rails.js
172
230
  - spec/dummy/public/stylesheets/.gitkeep
173
231
  - spec/dummy/script/rails
232
+ - spec/generators/install_generator_spec.rb
174
233
  - spec/integration/navigation_spec.rb
175
234
  - spec/spec_helper.rb
176
235
  has_rdoc: true
177
236
  homepage: http://github.com/nathanvda/cocoon
178
237
  licenses: []
238
+
179
239
  post_install_message:
180
240
  rdoc_options: []
181
- require_paths:
241
+
242
+ require_paths:
182
243
  - lib
183
- required_ruby_version: !ruby/object:Gem::Requirement
244
+ required_ruby_version: !ruby/object:Gem::Requirement
184
245
  none: false
185
- requirements:
186
- - - ! '>='
187
- - !ruby/object:Gem::Version
188
- version: '0'
189
- segments:
246
+ requirements:
247
+ - - ">="
248
+ - !ruby/object:Gem::Version
249
+ hash: 3
250
+ segments:
190
251
  - 0
191
- hash: 4167174110129179782
192
- required_rubygems_version: !ruby/object:Gem::Requirement
252
+ version: "0"
253
+ required_rubygems_version: !ruby/object:Gem::Requirement
193
254
  none: false
194
- requirements:
195
- - - ! '>='
196
- - !ruby/object:Gem::Version
197
- version: '0'
255
+ requirements:
256
+ - - ">="
257
+ - !ruby/object:Gem::Version
258
+ hash: 3
259
+ segments:
260
+ - 0
261
+ version: "0"
198
262
  requirements: []
263
+
199
264
  rubyforge_project:
200
265
  rubygems_version: 1.6.2
201
266
  signing_key:
202
267
  specification_version: 3
203
- summary: gem that enables easier nested forms with standard forms, formtastic and
204
- simple-form
268
+ summary: gem that enables easier nested forms with standard forms, formtastic and simple-form
205
269
  test_files: []
270
+