Class: SpreeEnvironment
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(dir) ⇒ SpreeEnvironment
constructor
A new instance of SpreeEnvironment.
Constructor Details
#initialize(dir) ⇒ SpreeEnvironment
Returns a new instance of SpreeEnvironment.
18 19 20 |
# File 'lib/commands/extension.rb', line 18 def initialize(dir) @root = dir end |
Instance Attribute Details
Class Method Details
.default ⇒ Object
30 31 32 |
# File 'lib/commands/extension.rb', line 30 def self.default @default ||= find end |
.default=(spree_env) ⇒ Object
34 35 36 |
# File 'lib/commands/extension.rb', line 34 def self.default=(spree_env) @default = spree_env end |
.find(dir = nil) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/commands/extension.rb', line 22 def self.find(dir=nil) dir ||= pwd while dir.length > 1 return new(dir) if File.exist?(File.join(dir, 'config', 'environment.rb')) dir = File.dirname(dir) end end |