Sha256: fadd91654a9fff11782090349a82ea8bdeef06956593867b849bd85bf98e7eaa

Contents?: true

Size: 1.37 KB

Versions: 10

Compression:

Stored size: 1.37 KB

Contents

require 'rails'

# Rails engine for Metasploit::Model.  Will automatically be used if `Rails` is defined when
# 'metasploit/model' is required, as should be the case in any normal Rails application Gemfile where
# gem 'rails' is the first gem in the Gemfile.
class Metasploit::Model::Engine < Rails::Engine
  # @see http://viget.com/extend/rails-engine-testing-with-rspec-capybara-and-factorygirl
  config.generators do |g|
    g.assets false
    g.fixture_replacement :factory_girl, :dir => 'spec/factories'
    g.helper false
    g.test_framework :rspec, :fixture => false
  end

  # Remove ActiveSupport::Dependencies loading paths to save time during constant resolution and to ensure that
  # metasploit-model is properly declaring all autoloads and not falling back on ActiveSupport::Dependencies
  config.paths.values.each do |path|
    path.skip_autoload!
    path.skip_autoload_once!
    path.skip_eager_load!
    path.skip_load_path!
  end

  initializer 'metasploit-model.prepend_factory_path', :after => 'factory_girl.set_factory_paths' do
    if defined? FactoryGirl
      relative_definition_file_path = config.generators.options[:factory_girl][:dir]
      definition_file_path = root.join(relative_definition_file_path)

      # unshift so that dependent gems can modify metasploit-model's factories
      FactoryGirl.definition_file_paths.unshift definition_file_path
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
metasploit-model-2.0.4 lib/metasploit/model/engine.rb
metasploit-model-2.0.3 lib/metasploit/model/engine.rb
metasploit-model-2.0.2 lib/metasploit/model/engine.rb
metasploit-model-2.0.1 lib/metasploit/model/engine.rb
metasploit-model-2.0.0 lib/metasploit/model/engine.rb
metasploit-model-1.1.0 lib/metasploit/model/engine.rb
metasploit-model-1.0.2 lib/metasploit/model/engine.rb
metasploit-model-1.0.1 lib/metasploit/model/engine.rb
metasploit-model-1.0.0 lib/metasploit/model/engine.rb
metasploit-model-1.0.0.pre.rails.pre.4.0 lib/metasploit/model/engine.rb