engine-assets 0.4.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/.gitignore +5 -0
  2. data/Gemfile +10 -0
  3. data/Gemfile.lock +38 -0
  4. data/LICENSE +18 -17
  5. data/RAILS_VERSIONS +5 -0
  6. data/README.md +55 -0
  7. data/Rakefile +253 -26
  8. data/VERSION +1 -1
  9. data/app/controllers/engine_assets/assets_controller.rb +7 -1
  10. data/config/routes.rb +12 -1
  11. data/engine-assets.gemspec +53 -20
  12. data/features/rails.feature +127 -0
  13. data/features/step_definitions/rails_steps.rb +112 -0
  14. data/features/support/env.rb +15 -0
  15. data/features/support/rails.rb +125 -0
  16. data/features/support/terminal.rb +83 -0
  17. data/init.rb +1 -0
  18. data/lib/engine-assets.rb +8 -2
  19. data/lib/engine_assets/engine.rb +3 -0
  20. data/lib/engine_assets/extensions/rails/assets.rb +6 -0
  21. data/lib/engine_assets/public_locator.rb +20 -5
  22. data/spec/{controllers → app/controllers/engine_assets}/javascripts_controller_spec.rb +2 -2
  23. data/spec/{controllers → app/controllers/engine_assets}/stylesheets_controller_spec.rb +2 -2
  24. data/spec/lib/engine-assets_spec.rb +7 -0
  25. data/spec/lib/engine_assets/public_locator_spec.rb +28 -4
  26. data/spec/shared/assets_controller_spec.rb +39 -0
  27. data/spec/shared/assets_routing_spec.rb +59 -0
  28. data/spec/spec.opts +2 -2
  29. data/spec/spec_helper.rb +61 -22
  30. data/spec/support/Gemfile-2.3.5 +7 -0
  31. data/spec/support/Gemfile-2.3.5.lock +38 -0
  32. data/spec/support/Gemfile-2.3.9 +7 -0
  33. data/spec/support/Gemfile-2.3.9.lock +38 -0
  34. data/spec/support/Gemfile-3.0.0 +16 -0
  35. data/spec/support/Gemfile-3.0.0.lock +90 -0
  36. data/spec/support/rails.rb +32 -0
  37. data/spec/support/terminal.rb +54 -0
  38. metadata +123 -25
  39. data/README.rdoc +0 -18
  40. data/TODO.md +0 -4
  41. data/rails/init.rb +0 -7
  42. data/spec/spec_suite.rb +0 -26
  43. data/spec/support/shared/assets_controller_spec.rb +0 -34
  44. data/spec/support/shared/assets_routing_spec.rb +0 -55
@@ -0,0 +1,7 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'rails', '2.3.5'
4
+ gem 'rr', '~> 1.0.0'
5
+ gem 'rspec', '~> 1.3.0'
6
+ gem 'rspec-rails', '~> 1.3.2'
7
+ gem 'sqlite3-ruby', '~> 1.3.1'
@@ -0,0 +1,38 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ actionmailer (2.3.5)
5
+ actionpack (= 2.3.5)
6
+ actionpack (2.3.5)
7
+ activesupport (= 2.3.5)
8
+ rack (~> 1.0.0)
9
+ activerecord (2.3.5)
10
+ activesupport (= 2.3.5)
11
+ activeresource (2.3.5)
12
+ activesupport (= 2.3.5)
13
+ activesupport (2.3.5)
14
+ rack (1.0.1)
15
+ rails (2.3.5)
16
+ actionmailer (= 2.3.5)
17
+ actionpack (= 2.3.5)
18
+ activerecord (= 2.3.5)
19
+ activeresource (= 2.3.5)
20
+ activesupport (= 2.3.5)
21
+ rake (>= 0.8.3)
22
+ rake (0.8.7)
23
+ rr (1.0.0)
24
+ rspec (1.3.0)
25
+ rspec-rails (1.3.2)
26
+ rack (>= 1.0.0)
27
+ rspec (>= 1.3.0)
28
+ sqlite3-ruby (1.3.1)
29
+
30
+ PLATFORMS
31
+ ruby
32
+
33
+ DEPENDENCIES
34
+ rails (= 2.3.5)
35
+ rr (~> 1.0.0)
36
+ rspec (~> 1.3.0)
37
+ rspec-rails (~> 1.3.2)
38
+ sqlite3-ruby (~> 1.3.1)
@@ -0,0 +1,7 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'rails', '2.3.9'
4
+ gem 'rr', '~> 1.0.0'
5
+ gem 'rspec', '~> 1.3.0'
6
+ gem 'rspec-rails', '~> 1.3.2'
7
+ gem 'sqlite3-ruby', '~> 1.3.1'
@@ -0,0 +1,38 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ actionmailer (2.3.9)
5
+ actionpack (= 2.3.9)
6
+ actionpack (2.3.9)
7
+ activesupport (= 2.3.9)
8
+ rack (~> 1.1.0)
9
+ activerecord (2.3.9)
10
+ activesupport (= 2.3.9)
11
+ activeresource (2.3.9)
12
+ activesupport (= 2.3.9)
13
+ activesupport (2.3.9)
14
+ rack (1.1.0)
15
+ rails (2.3.9)
16
+ actionmailer (= 2.3.9)
17
+ actionpack (= 2.3.9)
18
+ activerecord (= 2.3.9)
19
+ activeresource (= 2.3.9)
20
+ activesupport (= 2.3.9)
21
+ rake (>= 0.8.3)
22
+ rake (0.8.7)
23
+ rr (1.0.0)
24
+ rspec (1.3.0)
25
+ rspec-rails (1.3.2)
26
+ rack (>= 1.0.0)
27
+ rspec (>= 1.3.0)
28
+ sqlite3-ruby (1.3.1)
29
+
30
+ PLATFORMS
31
+ ruby
32
+
33
+ DEPENDENCIES
34
+ rails (= 2.3.9)
35
+ rr (~> 1.0.0)
36
+ rspec (~> 1.3.0)
37
+ rspec-rails (~> 1.3.2)
38
+ sqlite3-ruby (~> 1.3.1)
@@ -0,0 +1,16 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'rails', '3.0.0'
4
+ gem 'rr', '~> 1.0.0'
5
+ gem 'rspec', '~> 2.0.0.beta.22'
6
+ gem 'rspec-rails', '~> 2.0.0.beta.22'
7
+ gem 'sqlite3-ruby', '~> 1.3.1'
8
+
9
+ # NOTE:
10
+ # grouping this under 'development' means the engine's spec:rails:3.0.0 task
11
+ # is able to load the rspec gems (because it does not use Bundler.setup),
12
+ # while the Rails app does not blow up (it doesn't want to reference rspec).
13
+ # group :development do
14
+ # gem 'rspec', '~> 2.0.0.beta.22'
15
+ # gem 'rspec-rails', '~> 2.0.0.beta.22'
16
+ # end
@@ -0,0 +1,90 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ abstract (1.0.0)
5
+ actionmailer (3.0.0)
6
+ actionpack (= 3.0.0)
7
+ mail (~> 2.2.5)
8
+ actionpack (3.0.0)
9
+ activemodel (= 3.0.0)
10
+ activesupport (= 3.0.0)
11
+ builder (~> 2.1.2)
12
+ erubis (~> 2.6.6)
13
+ i18n (~> 0.4.1)
14
+ rack (~> 1.2.1)
15
+ rack-mount (~> 0.6.12)
16
+ rack-test (~> 0.5.4)
17
+ tzinfo (~> 0.3.23)
18
+ activemodel (3.0.0)
19
+ activesupport (= 3.0.0)
20
+ builder (~> 2.1.2)
21
+ i18n (~> 0.4.1)
22
+ activerecord (3.0.0)
23
+ activemodel (= 3.0.0)
24
+ activesupport (= 3.0.0)
25
+ arel (~> 1.0.0)
26
+ tzinfo (~> 0.3.23)
27
+ activeresource (3.0.0)
28
+ activemodel (= 3.0.0)
29
+ activesupport (= 3.0.0)
30
+ activesupport (3.0.0)
31
+ arel (1.0.1)
32
+ activesupport (~> 3.0.0)
33
+ builder (2.1.2)
34
+ diff-lcs (1.1.2)
35
+ erubis (2.6.6)
36
+ abstract (>= 1.0.0)
37
+ i18n (0.4.1)
38
+ mail (2.2.6.1)
39
+ activesupport (>= 2.3.6)
40
+ mime-types
41
+ treetop (>= 1.4.5)
42
+ mime-types (1.16)
43
+ polyglot (0.3.1)
44
+ rack (1.2.1)
45
+ rack-mount (0.6.13)
46
+ rack (>= 1.0.0)
47
+ rack-test (0.5.4)
48
+ rack (>= 1.0)
49
+ rails (3.0.0)
50
+ actionmailer (= 3.0.0)
51
+ actionpack (= 3.0.0)
52
+ activerecord (= 3.0.0)
53
+ activeresource (= 3.0.0)
54
+ activesupport (= 3.0.0)
55
+ bundler (~> 1.0.0)
56
+ railties (= 3.0.0)
57
+ railties (3.0.0)
58
+ actionpack (= 3.0.0)
59
+ activesupport (= 3.0.0)
60
+ rake (>= 0.8.4)
61
+ thor (~> 0.14.0)
62
+ rake (0.8.7)
63
+ rr (1.0.0)
64
+ rspec (2.0.0.beta.22)
65
+ rspec-core (= 2.0.0.beta.22)
66
+ rspec-expectations (= 2.0.0.beta.22)
67
+ rspec-mocks (= 2.0.0.beta.22)
68
+ rspec-core (2.0.0.beta.22)
69
+ rspec-expectations (2.0.0.beta.22)
70
+ diff-lcs (>= 1.1.2)
71
+ rspec-mocks (2.0.0.beta.22)
72
+ rspec-core (= 2.0.0.beta.22)
73
+ rspec-expectations (= 2.0.0.beta.22)
74
+ rspec-rails (2.0.0.beta.22)
75
+ rspec (= 2.0.0.beta.22)
76
+ sqlite3-ruby (1.3.1)
77
+ thor (0.14.0)
78
+ treetop (1.4.8)
79
+ polyglot (>= 0.3.1)
80
+ tzinfo (0.3.23)
81
+
82
+ PLATFORMS
83
+ ruby
84
+
85
+ DEPENDENCIES
86
+ rails (= 3.0.0)
87
+ rr (~> 1.0.0)
88
+ rspec (~> 2.0.0.beta.22)
89
+ rspec-rails (~> 2.0.0.beta.22)
90
+ sqlite3-ruby (~> 1.3.1)
@@ -0,0 +1,32 @@
1
+ module Support
2
+ class Rails
3
+ attr_reader :terminal, :version
4
+
5
+ def initialize(version)
6
+ @terminal = Terminal.new
7
+ @version = version
8
+ end
9
+
10
+ def build
11
+ # remove pre-existing
12
+ FileUtils.rm_rf WEBAPP_ROOT
13
+
14
+ create_command = rails3? ? 'new' : ''
15
+ load_command = "gem 'rails', '#{version}'; load Gem.bin_path('rails', 'rails', '#{version}')"
16
+
17
+ terminal.cd(TEMP_DIR)
18
+ terminal.run(%{ruby -rubygems -e "#{load_command}" #{create_command} rails_root})
19
+ end
20
+
21
+ def setup
22
+ require File.join(WEBAPP_ROOT, 'config', 'environment')
23
+ end
24
+
25
+
26
+ private
27
+
28
+ def rails3?
29
+ version =~ /^3/
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,54 @@
1
+ require 'fileutils'
2
+
3
+ module Support
4
+ class Terminal
5
+ attr_reader :output, :status, :result
6
+ attr_accessor :environment_variables
7
+
8
+ def initialize
9
+ @cwd = FileUtils.pwd
10
+ @output = ""
11
+ @result = ""
12
+ @status = 0
13
+
14
+ @environment_variables = {
15
+ "GEM_HOME" => LOCAL_GEM_ROOT,
16
+ "GEM_PATH" => "#{LOCAL_GEM_ROOT}:#{BUILT_GEM_ROOT}",
17
+ "PATH" => "#{gem_bin_path}:#{ENV['PATH']}"
18
+ }
19
+ end
20
+
21
+ def cd(directory)
22
+ @cwd = directory
23
+ end
24
+
25
+ def run(command)
26
+ output << "#{command}\n"
27
+
28
+ FileUtils.cd(@cwd) do
29
+ cmdline = "#{environment_settings} #{command} 2>&1"
30
+ result = `#{cmdline}`
31
+
32
+ output << result
33
+ @result = clean(result)
34
+ end
35
+
36
+ @status = $?
37
+ end
38
+
39
+ def clean(content)
40
+ content.split("\n").reject { |line| line.match('deprecated') }.join("\n")
41
+ end
42
+
43
+
44
+ private
45
+
46
+ def environment_settings
47
+ @environment_variables.map { |key, value| "#{key}=#{value}" }.join(' ')
48
+ end
49
+
50
+ def gem_bin_path
51
+ File.join(LOCAL_GEM_ROOT, "bin")
52
+ end
53
+ end
54
+ end
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 4
9
- - 2
10
- version: 0.4.2
8
+ - 5
9
+ - 0
10
+ version: 0.5.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Corey Innis
@@ -15,25 +15,105 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-11 00:00:00 -04:00
18
+ date: 2010-09-17 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
+ type: :development
23
+ prerelease: false
24
+ name: cucumber
25
+ version_requirements: &id001 !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ hash: 53
31
+ segments:
32
+ - 0
33
+ - 8
34
+ - 5
35
+ version: 0.8.5
36
+ requirement: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ type: :development
39
+ prerelease: false
40
+ name: rake
41
+ version_requirements: &id002 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ hash: 49
47
+ segments:
48
+ - 0
49
+ - 8
50
+ - 7
51
+ version: 0.8.7
52
+ requirement: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ type: :development
55
+ prerelease: false
56
+ name: rr
57
+ version_requirements: &id003 !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ hash: 23
63
+ segments:
64
+ - 1
65
+ - 0
66
+ - 0
67
+ version: 1.0.0
68
+ requirement: *id003
69
+ - !ruby/object:Gem::Dependency
70
+ type: :development
71
+ prerelease: false
22
72
  name: rspec
73
+ version_requirements: &id004 !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ~>
77
+ - !ruby/object:Gem::Version
78
+ hash: 27
79
+ segments:
80
+ - 1
81
+ - 3
82
+ - 0
83
+ version: 1.3.0
84
+ requirement: *id004
85
+ - !ruby/object:Gem::Dependency
86
+ type: :development
23
87
  prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
88
+ name: jeweler
89
+ version_requirements: &id005 !ruby/object:Gem::Requirement
25
90
  none: false
26
91
  requirements:
27
- - - ">="
92
+ - - ~>
28
93
  - !ruby/object:Gem::Version
29
- hash: 15
94
+ hash: 7
30
95
  segments:
31
96
  - 1
32
- - 2
33
- - 8
34
- version: 1.2.8
97
+ - 4
98
+ - 0
99
+ version: 1.4.0
100
+ requirement: *id005
101
+ - !ruby/object:Gem::Dependency
35
102
  type: :development
36
- version_requirements: *id001
103
+ prerelease: false
104
+ name: term-ansicolor
105
+ version_requirements: &id006 !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ hash: 29
111
+ segments:
112
+ - 1
113
+ - 0
114
+ - 5
115
+ version: 1.0.5
116
+ requirement: *id006
37
117
  description: A Rails Engine, which enables Rails Engines to provide assets (javascript, css and images)
38
118
  email: support@coolerator.net
39
119
  executables: []
@@ -42,32 +122,48 @@ extensions: []
42
122
 
43
123
  extra_rdoc_files:
44
124
  - LICENSE
45
- - README.rdoc
125
+ - README.md
46
126
  files:
47
127
  - .document
48
128
  - .gitignore
129
+ - Gemfile
130
+ - Gemfile.lock
49
131
  - LICENSE
50
- - README.rdoc
132
+ - RAILS_VERSIONS
133
+ - README.md
51
134
  - Rakefile
52
- - TODO.md
53
135
  - VERSION
54
136
  - app/controllers/engine_assets/assets_controller.rb
55
137
  - app/controllers/engine_assets/javascripts_controller.rb
56
138
  - app/controllers/engine_assets/stylesheets_controller.rb
57
139
  - config/routes.rb
58
140
  - engine-assets.gemspec
141
+ - features/rails.feature
142
+ - features/step_definitions/rails_steps.rb
143
+ - features/support/env.rb
144
+ - features/support/rails.rb
145
+ - features/support/terminal.rb
146
+ - init.rb
59
147
  - lib/engine-assets.rb
148
+ - lib/engine_assets/engine.rb
60
149
  - lib/engine_assets/extensions/rails/assets.rb
61
150
  - lib/engine_assets/public_locator.rb
62
- - rails/init.rb
63
- - spec/controllers/javascripts_controller_spec.rb
64
- - spec/controllers/stylesheets_controller_spec.rb
151
+ - spec/app/controllers/engine_assets/javascripts_controller_spec.rb
152
+ - spec/app/controllers/engine_assets/stylesheets_controller_spec.rb
153
+ - spec/lib/engine-assets_spec.rb
65
154
  - spec/lib/engine_assets/public_locator_spec.rb
66
155
  - spec/routing/javascripts_routing_spec.rb
67
156
  - spec/routing/stylesheets_routing_spec.rb
157
+ - spec/shared/assets_controller_spec.rb
158
+ - spec/shared/assets_routing_spec.rb
68
159
  - spec/spec.opts
69
160
  - spec/spec_helper.rb
70
- - spec/spec_suite.rb
161
+ - spec/support/Gemfile-2.3.5
162
+ - spec/support/Gemfile-2.3.5.lock
163
+ - spec/support/Gemfile-2.3.9
164
+ - spec/support/Gemfile-2.3.9.lock
165
+ - spec/support/Gemfile-3.0.0
166
+ - spec/support/Gemfile-3.0.0.lock
71
167
  - spec/support/fixtures/app/views/engine_assets/javascripts/dual.js.erb
72
168
  - spec/support/fixtures/app/views/engine_assets/javascripts/solo.js.erb
73
169
  - spec/support/fixtures/app/views/engine_assets/stylesheets/dual.css.erb
@@ -76,8 +172,8 @@ files:
76
172
  - spec/support/fixtures/public/stylesheets/dual.css
77
173
  - spec/support/helpers/fixture_helper.rb
78
174
  - spec/support/helpers/textmate_helper.rb
79
- - spec/support/shared/assets_controller_spec.rb
80
- - spec/support/shared/assets_routing_spec.rb
175
+ - spec/support/rails.rb
176
+ - spec/support/terminal.rb
81
177
  has_rdoc: true
82
178
  homepage: http://github.com/coreyti/engine-assets
83
179
  licenses: []
@@ -113,14 +209,16 @@ signing_key:
113
209
  specification_version: 3
114
210
  summary: Rails Engines with assets.
115
211
  test_files:
116
- - spec/controllers/javascripts_controller_spec.rb
117
- - spec/controllers/stylesheets_controller_spec.rb
212
+ - spec/app/controllers/engine_assets/javascripts_controller_spec.rb
213
+ - spec/app/controllers/engine_assets/stylesheets_controller_spec.rb
214
+ - spec/lib/engine-assets_spec.rb
118
215
  - spec/lib/engine_assets/public_locator_spec.rb
119
216
  - spec/routing/javascripts_routing_spec.rb
120
217
  - spec/routing/stylesheets_routing_spec.rb
218
+ - spec/shared/assets_controller_spec.rb
219
+ - spec/shared/assets_routing_spec.rb
121
220
  - spec/spec_helper.rb
122
- - spec/spec_suite.rb
123
221
  - spec/support/helpers/fixture_helper.rb
124
222
  - spec/support/helpers/textmate_helper.rb
125
- - spec/support/shared/assets_controller_spec.rb
126
- - spec/support/shared/assets_routing_spec.rb
223
+ - spec/support/rails.rb
224
+ - spec/support/terminal.rb