Sha256: c852719ee02e59eea61b1cf77f0b2325bcc7d296ff6e12af9c48ce9ed776b630

Contents?: true

Size: 819 Bytes

Versions: 1

Compression:

Stored size: 819 Bytes

Contents

module SpreePaypalCheckout
  class Engine < Rails::Engine
    require 'spree/core'
    isolate_namespace Spree
    engine_name 'spree_paypal_checkout'

    # use rspec for tests
    config.generators do |g|
      g.test_framework :rspec
    end

    initializer 'spree_paypal_checkout.environment', before: :load_config_initializers do |_app|
      SpreePaypalCheckout::Config = SpreePaypalCheckout::Configuration.new
    end

    def self.activate
      Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
        Rails.configuration.cache_classes ? require(c) : load(c)
      end
    end

    config.to_prepare(&method(:activate).to_proc)

    config.after_initialize do |app|
      app.config.spree.payment_methods += [
        Spree::Gateway::PaypalCheckout
      ]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree_paypal_checkout-0.0.2 lib/spree_paypal_checkout/engine.rb