Module: Rails2AssetPipeline
- Defined in:
- lib/rails2_asset_pipeline.rb,
lib/rails2_asset_pipeline/version.rb,
lib/rails2_asset_pipeline/view_helpers.rb,
lib/rails2_asset_pipeline/jammit_converter.rb
Defined Under Namespace
Modules: JammitConverter, ViewHelpers
Constant Summary
collapse
- STATIC_ENVIRONMENTS =
["production", "staging"]
- VERSION =
'0.3.2'
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.dynamic_assets_available ⇒ Object
Returns the value of attribute dynamic_assets_available.
8
9
10
|
# File 'lib/rails2_asset_pipeline.rb', line 8
def dynamic_assets_available
@dynamic_assets_available
end
|
.manifest ⇒ Object
Returns the value of attribute manifest.
8
9
10
|
# File 'lib/rails2_asset_pipeline.rb', line 8
def manifest
@manifest
end
|
.prefix ⇒ Object
Returns the value of attribute prefix.
8
9
10
|
# File 'lib/rails2_asset_pipeline.rb', line 8
def prefix
@prefix
end
|
Class Method Details
.config_ru(rack) ⇒ Object
.env ⇒ Object
11
12
13
|
# File 'lib/rails2_asset_pipeline.rb', line 11
def self.env
@env || setup
end
|
.setup {|@env| ... } ⇒ Object
15
16
17
18
19
20
21
22
23
|
# File 'lib/rails2_asset_pipeline.rb', line 15
def self.setup
@env ||= Sprockets::Environment.new
Dir[Rails.root.join("app", "assets", "*")].each do |folder|
@env.append_path folder
end
yield @env if block_given?
@env
end
|
.warn_user_about_misconfiguration! ⇒ Object
59
60
61
62
63
64
65
66
67
68
69
|
# File 'lib/rails2_asset_pipeline.rb', line 59
def self.warn_user_about_misconfiguration!
return unless Rails2AssetPipeline.static?
return if @manifest_exists ||= File.exist?(manifest)
config = "config.ru.example"
if File.exist?(config) and File.read(config).include?("Rails2AssetPipeline.config_ru")
raise "No dynamic assets available and no #{manifest} found, run `rake assets:precompile` for static assets or `cp #{config} config.ru` for dynamic assets"
else
raise "No dynamic assets available and no #{manifest} found, run `rake assets:precompile` for static assets or read https://github.com/grosser/rails2_asset_pipeline#dynamic-assets-for-development for instructions on dynamic assets"
end
end
|
.with_dynamic_assets_available(value) ⇒ Object
43
44
45
46
47
48
49
|
# File 'lib/rails2_asset_pipeline.rb', line 43
def self.with_dynamic_assets_available(value)
old = dynamic_assets_available
self.dynamic_assets_available = value
yield
ensure
self.dynamic_assets_available = old
end
|