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.



16
17
18
19
20
21
# File 'lib/spree/initializer.rb', line 16

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.



12
13
14
# File 'lib/spree/initializer.rb', line 12

def extension_paths
  @extension_paths
end

#extensionsObject

Returns the value of attribute extensions.



13
14
15
# File 'lib/spree/initializer.rb', line 13

def extensions
  @extensions
end

#view_pathsObject

Returns the value of attribute view_paths.



14
15
16
# File 'lib/spree/initializer.rb', line 14

def view_paths
  @view_paths
end

Instance Method Details

#default_extension_pathsObject



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

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