Sha256: d702b4c12d776c4d2632b9df3227716bad505cf6af9354e2385bc5fedd302c33

Contents?: true

Size: 1.11 KB

Versions: 8

Compression:

Stored size: 1.11 KB

Contents

require 'rails'

module Metasploit
  module Model
    # 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 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

      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
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
metasploit-model-0.27.3 lib/metasploit/model/engine.rb
metasploit-model-0.27.3-java lib/metasploit/model/engine.rb
metasploit-model-0.27.2 lib/metasploit/model/engine.rb
metasploit-model-0.27.2-java lib/metasploit/model/engine.rb
metasploit-model-0.27.1 lib/metasploit/model/engine.rb
metasploit-model-0.27.1-java lib/metasploit/model/engine.rb
metasploit-model-0.27.0 lib/metasploit/model/engine.rb
metasploit-model-0.27.0-java lib/metasploit/model/engine.rb