Class: Embork::Extension
- Inherits:
-
Object
- Object
- Embork::Extension
- Defined in:
- lib/embork/extension.rb
Instance Attribute Summary collapse
-
#project_root ⇒ Object
readonly
Returns the value of attribute project_root.
Instance Method Summary collapse
- #helpers ⇒ Object
-
#initialize(project_root, bundled_assets: false, environment: nil) ⇒ Extension
constructor
A new instance of Extension.
Constructor Details
#initialize(project_root, bundled_assets: false, environment: nil) ⇒ Extension
Returns a new instance of Extension.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/embork/extension.rb', line 7 def initialize(project_root, bundled_assets: false, environment: nil) @environment = environment || Embork.env || ENV['RACK_ENV'] @project_root = project_root if bundled_assets version_file_path = File.join(project_root, 'build', @environment.to_s, 'current-version') @bundle_version = File.read(version_file_path) @use_bundled_assets = true end end |
Instance Attribute Details
#project_root ⇒ Object (readonly)
Returns the value of attribute project_root.
5 6 7 |
# File 'lib/embork/extension.rb', line 5 def project_root @project_root end |
Instance Method Details
#helpers ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/embork/extension.rb', line 18 def helpers helpers = Embork::Sprockets::Helpers if @use_bundled_assets helpers.bundle_version = @bundle_version helpers.use_bundled_assets = @use_bundled_assets end helpers end |