engine-assets 0.5.1 → 0.6.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -44,6 +44,14 @@ TODO
44
44
  * Add spec/feature coverage for gem-installed engine, rather than plugins.
45
45
  * Add spec/feature coverage for rails/init.rb making a difference.
46
46
 
47
+ actionpack (3.0.0) lib/action_view/helpers/asset_tag_helper.rb:905:in `exist?'
48
+ actionpack (3.0.0) lib/action_view/helpers/asset_tag_helper.rb:905:in `asset_file_path!'
49
+ actionpack (3.0.0) lib/action_view/helpers/asset_tag_helper.rb:878:in `ensure_javascript_sources!'
50
+ actionpack (3.0.0) lib/action_view/helpers/asset_tag_helper.rb:877:in `each'
51
+ actionpack (3.0.0) lib/action_view/helpers/asset_tag_helper.rb:877:in `ensure_javascript_sources!'
52
+ actionpack (3.0.0) lib/action_view/helpers/asset_tag_helper.rb:361:in `javascript_include_tag'
53
+ app/views/layouts/application.html.erb:12:in `_app_views_layouts_application_html_erb___615183510_2191829220_0'
54
+
47
55
 
48
56
  Contributors
49
57
  ------------------------------------------------------------------------------
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.6.0.pre1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{engine-assets}
8
- s.version = "0.5.1"
8
+ s.version = "0.6.0.pre1"
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
+ s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Corey Innis"]
12
- s.date = %q{2010-09-18}
12
+ s.date = %q{2010-11-03}
13
13
  s.description = %q{A Rails Engine, which enables Rails Engines to provide assets (javascript, css and images)}
14
14
  s.email = %q{support@coolerator.net}
15
15
  s.extra_rdoc_files = [
@@ -39,6 +39,7 @@ Gem::Specification.new do |s|
39
39
  "init.rb",
40
40
  "lib/engine-assets.rb",
41
41
  "lib/engine_assets/engine.rb",
42
+ "lib/engine_assets/extensions/action_view/helpers/asset_tag_helper.rb",
42
43
  "lib/engine_assets/extensions/rails/assets.rb",
43
44
  "lib/engine_assets/public_locator.rb",
44
45
  "rails/init.rb",
@@ -8,4 +8,4 @@ end
8
8
 
9
9
  require 'engine_assets/engine' if defined?(Rails) && Rails::VERSION::MAJOR == 3
10
10
  require 'engine_assets/public_locator'
11
- require 'engine_assets/extensions/rails/assets'
11
+ require 'engine_assets/extensions/action_view/helpers/asset_tag_helper'
@@ -1,3 +1,11 @@
1
1
  require 'rails' unless defined?(Rails)
2
2
 
3
- class EngineAssets::Engine < Rails::Engine ; end
3
+ class EngineAssets::Engine < Rails::Engine
4
+ def initialize(*args)
5
+ super(*args)
6
+
7
+ EngineAssets::PublicLocator.paths.each do |path|
8
+ Rails.configuration.middleware.use ::ActionDispatch::Static, path
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,28 @@
1
+ # require 'action_view/helpers/asset_tag_helper'
2
+
3
+ # TODO:
4
+ # * find a mechanism to do this without monkey-patching Rails
5
+ # * add an autoload option to load all from plugins, or similar
6
+ # * allow engines to indicate (automatically when #register is called?)
7
+ # which assets to include.
8
+
9
+ module ActionView::Helpers::AssetTagHelper
10
+ # def expand_javascript_sources_with_engine_assets(sources, recursive = false)
11
+ # if sources.include?(:all)
12
+ # result = (determine_source(:defaults, @@javascript_expansions).dup | expand_javascript_sources_without_engine_assets(sources, recursive))
13
+ # result.map! { |entry| entry =~ /\.js$/ ? entry : "#{entry}.js" }
14
+ # return result.uniq
15
+ # else
16
+ # raise NotImplementedError
17
+ # end
18
+ # end
19
+ # alias_method_chain :expand_javascript_sources, :engine_assets
20
+ #
21
+ def asset_file_path_with_engine_assets(path)
22
+ primary = asset_file_path_without_engine_assets(path)
23
+ return primary if File.exist?(primary)
24
+
25
+ EngineAssets::PublicLocator.locate(path)
26
+ end
27
+ alias_method_chain :asset_file_path, :engine_assets
28
+ end
@@ -4,23 +4,23 @@
4
4
  # * allow engines to indicate (automatically when #register is called?)
5
5
  # which assets to include.
6
6
 
7
- module ActionView::Helpers::AssetTagHelper
8
- def expand_javascript_sources_with_engine_assets(sources, recursive = false)
9
- if sources.include?(:all)
10
- result = (determine_source(:defaults, @@javascript_expansions).dup | expand_javascript_sources_without_engine_assets(sources, recursive))
11
- result.map! { |entry| entry =~ /\.js$/ ? entry : "#{entry}.js" }
12
- return result.uniq
13
- else
14
- raise NotImplementedError
15
- end
16
- end
17
- alias_method_chain :expand_javascript_sources, :engine_assets
18
-
19
- def asset_file_path_with_engine_assets(path)
20
- primary = asset_file_path_without_engine_assets(path)
21
- return primary if File.exist?(primary)
22
-
23
- EngineAssets::PublicLocator.locate(path)
24
- end
25
- alias_method_chain :asset_file_path, :engine_assets
26
- end
7
+ # module ActionView::Helpers::AssetTagHelper
8
+ # # def expand_javascript_sources_with_engine_assets(sources, recursive = false)
9
+ # # if sources.include?(:all)
10
+ # # result = (determine_source(:defaults, @@javascript_expansions).dup | expand_javascript_sources_without_engine_assets(sources, recursive))
11
+ # # result.map! { |entry| entry =~ /\.js$/ ? entry : "#{entry}.js" }
12
+ # # return result.uniq
13
+ # # else
14
+ # # raise NotImplementedError
15
+ # # end
16
+ # # end
17
+ # # alias_method_chain :expand_javascript_sources, :engine_assets
18
+ # #
19
+ # def asset_file_path_with_engine_assets(path)
20
+ # primary = asset_file_path_without_engine_assets(path)
21
+ # return primary if File.exist?(primary)
22
+ #
23
+ # EngineAssets::PublicLocator.locate(path)
24
+ # end
25
+ # alias_method_chain :asset_file_path, :engine_assets
26
+ # end
@@ -10,17 +10,7 @@ class EngineAssets::PublicLocator
10
10
  public_path = File.join(full_path, 'public')
11
11
 
12
12
  if File.exist?(public_path)
13
- # TODO:
14
- # * spec me
15
- # * split me into separate implementations
16
-
17
- if defined?(Rails) && Rails::VERSION::MAJOR == 3
18
- # Rails 3
19
- Rails.configuration.middleware.use ::ActionDispatch::Static, public_path
20
- else
21
- # Rails 2
22
- paths << public_path
23
- end
13
+ paths << public_path
24
14
  end
25
15
  end
26
16
 
@@ -34,11 +24,10 @@ class EngineAssets::PublicLocator
34
24
  nil
35
25
  end
36
26
 
37
-
38
27
  private
39
28
 
40
- def clear
41
- @paths = nil
42
- end
29
+ def clear
30
+ @paths = nil
31
+ end
43
32
  end
44
33
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engine-assets
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
5
- prerelease: false
4
+ hash: -1876988208
5
+ prerelease: true
6
6
  segments:
7
7
  - 0
8
- - 5
9
- - 1
10
- version: 0.5.1
8
+ - 6
9
+ - 0
10
+ - pre1
11
+ version: 0.6.0.pre1
11
12
  platform: ruby
12
13
  authors:
13
14
  - Corey Innis
@@ -15,14 +16,11 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2010-09-18 00:00:00 -07:00
19
+ date: 2010-11-03 00:00:00 -07:00
19
20
  default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
22
- type: :development
23
- prerelease: false
24
- name: cucumber
25
- version_requirements: &id001 !ruby/object:Gem::Requirement
23
+ requirement: &id001 !ruby/object:Gem::Requirement
26
24
  none: false
27
25
  requirements:
28
26
  - - ~>
@@ -33,12 +31,12 @@ dependencies:
33
31
  - 8
34
32
  - 5
35
33
  version: 0.8.5
36
- requirement: *id001
37
- - !ruby/object:Gem::Dependency
38
34
  type: :development
35
+ name: cucumber
39
36
  prerelease: false
40
- name: rake
41
- version_requirements: &id002 !ruby/object:Gem::Requirement
37
+ version_requirements: *id001
38
+ - !ruby/object:Gem::Dependency
39
+ requirement: &id002 !ruby/object:Gem::Requirement
42
40
  none: false
43
41
  requirements:
44
42
  - - ~>
@@ -49,12 +47,12 @@ dependencies:
49
47
  - 8
50
48
  - 7
51
49
  version: 0.8.7
52
- requirement: *id002
53
- - !ruby/object:Gem::Dependency
54
50
  type: :development
51
+ name: rake
55
52
  prerelease: false
56
- name: rr
57
- version_requirements: &id003 !ruby/object:Gem::Requirement
53
+ version_requirements: *id002
54
+ - !ruby/object:Gem::Dependency
55
+ requirement: &id003 !ruby/object:Gem::Requirement
58
56
  none: false
59
57
  requirements:
60
58
  - - ~>
@@ -65,12 +63,12 @@ dependencies:
65
63
  - 0
66
64
  - 0
67
65
  version: 1.0.0
68
- requirement: *id003
69
- - !ruby/object:Gem::Dependency
70
66
  type: :development
67
+ name: rr
71
68
  prerelease: false
72
- name: rspec
73
- version_requirements: &id004 !ruby/object:Gem::Requirement
69
+ version_requirements: *id003
70
+ - !ruby/object:Gem::Dependency
71
+ requirement: &id004 !ruby/object:Gem::Requirement
74
72
  none: false
75
73
  requirements:
76
74
  - - ~>
@@ -81,12 +79,12 @@ dependencies:
81
79
  - 3
82
80
  - 0
83
81
  version: 1.3.0
84
- requirement: *id004
85
- - !ruby/object:Gem::Dependency
86
82
  type: :development
83
+ name: rspec
87
84
  prerelease: false
88
- name: jeweler
89
- version_requirements: &id005 !ruby/object:Gem::Requirement
85
+ version_requirements: *id004
86
+ - !ruby/object:Gem::Dependency
87
+ requirement: &id005 !ruby/object:Gem::Requirement
90
88
  none: false
91
89
  requirements:
92
90
  - - ~>
@@ -97,12 +95,12 @@ dependencies:
97
95
  - 4
98
96
  - 0
99
97
  version: 1.4.0
100
- requirement: *id005
101
- - !ruby/object:Gem::Dependency
102
98
  type: :development
99
+ name: jeweler
103
100
  prerelease: false
104
- name: term-ansicolor
105
- version_requirements: &id006 !ruby/object:Gem::Requirement
101
+ version_requirements: *id005
102
+ - !ruby/object:Gem::Dependency
103
+ requirement: &id006 !ruby/object:Gem::Requirement
106
104
  none: false
107
105
  requirements:
108
106
  - - ~>
@@ -113,7 +111,10 @@ dependencies:
113
111
  - 0
114
112
  - 5
115
113
  version: 1.0.5
116
- requirement: *id006
114
+ type: :development
115
+ name: term-ansicolor
116
+ prerelease: false
117
+ version_requirements: *id006
117
118
  description: A Rails Engine, which enables Rails Engines to provide assets (javascript, css and images)
118
119
  email: support@coolerator.net
119
120
  executables: []
@@ -146,6 +147,7 @@ files:
146
147
  - init.rb
147
148
  - lib/engine-assets.rb
148
149
  - lib/engine_assets/engine.rb
150
+ - lib/engine_assets/extensions/action_view/helpers/asset_tag_helper.rb
149
151
  - lib/engine_assets/extensions/rails/assets.rb
150
152
  - lib/engine_assets/public_locator.rb
151
153
  - rails/init.rb
@@ -196,12 +198,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
196
198
  required_rubygems_version: !ruby/object:Gem::Requirement
197
199
  none: false
198
200
  requirements:
199
- - - ">="
201
+ - - ">"
200
202
  - !ruby/object:Gem::Version
201
- hash: 3
203
+ hash: 25
202
204
  segments:
203
- - 0
204
- version: "0"
205
+ - 1
206
+ - 3
207
+ - 1
208
+ version: 1.3.1
205
209
  requirements: []
206
210
 
207
211
  rubyforge_project: