rails_application_assets 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/application_assets.rb +20 -0
  2. data/rails/init.rb +2 -0
  3. metadata +49 -0
@@ -0,0 +1,20 @@
1
+ ActionView::Helpers::AssetTagHelper.module_eval do
2
+
3
+ ApplicationName = Rails.application.class.name.split(/::/).first.downcase
4
+ PrefixRe = %r{^#{Regexp.escape(ApplicationName)}/}
5
+ #
6
+ # "prefix/app.js", "javascript" -> "prefix/javascript/app.js", ""
7
+ #
8
+ def compute_public_path_with_application_assets(source, dir, *args)
9
+ if source.match(PrefixRe)
10
+ s = source.sub(PrefixRe, "#{dir}/")
11
+ d = ApplicationName
12
+ else
13
+ s = source
14
+ d = dir
15
+ end
16
+ compute_public_path_without_application_assets(s, d, *args)
17
+ end
18
+
19
+ alias_method_chain :compute_public_path, :application_assets
20
+ end
data/rails/init.rb ADDED
@@ -0,0 +1,2 @@
1
+ # Include hook code here
2
+ require 'application_assets'
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails_application_assets
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Peter Ehrenberg
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-07-09 00:00:00.000000000 +02:00
13
+ default_executable:
14
+ dependencies: []
15
+ description: Make rails asset tag helpers (image_tag, javascript_include_tag etc.)
16
+ aware for shared environment.
17
+ email: pe@dipe.de
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - lib/application_assets.rb
23
+ - rails/init.rb
24
+ has_rdoc: true
25
+ homepage: https://github.com/dipe/rails_application_assets
26
+ licenses: []
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ none: false
33
+ requirements:
34
+ - - ! '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ required_rubygems_version: !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ! '>='
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ requirements: []
44
+ rubyforge_project:
45
+ rubygems_version: 1.6.2
46
+ signing_key:
47
+ specification_version: 3
48
+ summary: Shared assets for Rails.
49
+ test_files: []