lib/combustion.rb in combustion-0.5.0 vs lib/combustion.rb in combustion-0.5.1
- old
+ new
@@ -1,10 +1,11 @@
require 'rails'
require 'active_support/dependencies'
module Combustion
mattr_accessor :path, :schema_format
+ mattr_reader :setup_environment
self.path = '/spec/internal'
self.schema_format = :ruby
if Rails.version.to_s > '3.1'
@@ -12,10 +13,12 @@
sprockets )
else
Modules = %w( active_record action_controller action_view action_mailer )
end
- def self.initialize!(*modules)
+ def self.initialize!(*modules, &block)
+ @@setup_environment = block if block_given?
+
modules = Modules if modules == [:all]
modules.each { |mod| require "#{mod}/railtie" }
Bundler.require :default, Rails.env