Module: Shoppe

Defined in:
lib/shoppe.rb,
lib/shoppe/engine.rb,
lib/shoppe/version.rb,
lib/shoppe/setup_generator.rb,
app/mailers/shoppe/user_mailer.rb,
lib/shoppe/errors/not_enough_stock.rb,
lib/shoppe/errors/payment_declined.rb,
app/controllers/shoppe/application_controller.rb,
lib/shoppe/errors/insufficient_stock_to_fulfil.rb,
lib/shoppe/errors/inappropriate_delivery_service.rb

Defined Under Namespace

Modules: ApplicationHelper, Errors, ShoppeHelper Classes: ApplicationController, AttachmentsController, DashboardController, DeliveryService, DeliveryServicePrice, DeliveryServicePricesController, DeliveryServicesController, Engine, Error, Order, OrderItem, OrderMailer, OrdersController, Product, ProductCategoriesController, ProductCategory, ProductsController, SessionsController, SetupGenerator, User, UserMailer, UsersController

Constant Summary collapse

VERSION =
"0.0.6"

Class Method Summary collapse

Class Method Details

.configObject



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/shoppe.rb', line 19

def config
  @config ||= begin
    path = Rails.root.join('config', 'shoppe.yml')
    if File.exist?(path)
      config = YAML.load_file(path).with_indifferent_access
      setup_config(config)
      config
    else
      $stderr.puts "Shoppe configuration file missing at #{path}"
      {}
    end
  end
end

.rootObject



15
16
17
# File 'lib/shoppe.rb', line 15

def root
  File.expand_path('../../', __FILE__)
end

.setup_config(config) ⇒ Object



33
34
35
# File 'lib/shoppe.rb', line 33

def setup_config(config)
  ActionMailer::Base.smtp_settings = config[:smtp_settings] if config[:smtp_settings]
end