lib/embork/extension.rb in embork-0.0.11 vs lib/embork/extension.rb in embork-0.0.12

- old
+ new

@@ -2,16 +2,21 @@ require 'embork/borkfile' class Embork::Extension attr_reader :project_root - def initialize(project_root, bundled_assets: false, environment: nil) - @environment = environment || Embork.env || ENV['RACK_ENV'] + def initialize(project_root, options = {}) + # Set up defaults + bundled_assets = options[:bundled_assets] || false + environment = options[:environment] || nil + + @environment = environment || ENV['RACK_ENV'] || Embork.env + Embork.env = @environment @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) + @bundle_version = File.read(version_file_path).strip @use_bundled_assets = true end end def helpers