Class: Spree::Configuration

Inherits:
Rails::Configuration
  • Object
show all
Defined in:
lib/spree/initializer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



25
26
27
28
29
30
# File 'lib/spree/initializer.rb', line 25

def initialize   
  self.view_paths = []
  self.extension_paths = default_extension_paths
  self.extensions = [ :all ]
  super
end

Instance Attribute Details

#extension_pathsObject

Returns the value of attribute extension_paths.



21
22
23
# File 'lib/spree/initializer.rb', line 21

def extension_paths
  @extension_paths
end

#extensionsObject

Returns the value of attribute extensions.



22
23
24
# File 'lib/spree/initializer.rb', line 22

def extensions
  @extensions
end

#view_pathsObject

Returns the value of attribute view_paths.



23
24
25
# File 'lib/spree/initializer.rb', line 23

def view_paths
  @view_paths
end

Instance Method Details

#default_extension_pathsObject



32
33
34
35
36
37
38
39
# File 'lib/spree/initializer.rb', line 32

def default_extension_paths
  env = ENV["RAILS_ENV"] || RAILS_ENV
  paths = [SPREE_ROOT + '/vendor/extensions', RAILS_ROOT + '/vendor/extensions'].uniq
  # There's no other way it will work, config/environments/test.rb loads too late
  # TODO: Should figure out how to include this extension path only for the tests that need it
  paths.unshift(SPREE_ROOT + "/test/fixtures/extensions") if env == "test"
  paths
end