1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-08-28 23:26:18 +02:00

Define the Rails version constraint in a library constant

This commit is contained in:
Matt Buck 2014-12-19 11:37:23 -06:00
parent cfc3a31289
commit c493ccfc06
No known key found for this signature in database
GPG Key ID: 42134E0C9C4E94BB
4 changed files with 18 additions and 8 deletions

View File

@ -0,0 +1,11 @@
# Records the Bundler-style dependency constraint for the version of Rails to be
# used with the Metasploit Framework and Metasploit Pro.
module Metasploit
module Framework
module RailsVersionConstraint
# The Metasploit ecosystem is not ready for Rails 4 as it uses features of
# Rails 3.X that are removed in Rails 4.
RAILS_VERSION = '< 4.0.0'
end
end
end

View File

@ -12,6 +12,7 @@ end
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'metasploit/framework/version'
require 'metasploit/framework/rails_version_constraint'
Gem::Specification.new do |spec|
spec.name = 'metasploit-framework-db'
@ -26,10 +27,7 @@ Gem::Specification.new do |spec|
# no files, just dependencies
spec.files = []
# The Metasploit ecosystem is not ready for Rails 4 as it uses features of Rails 3.X that are removed in Rails 4.
rails_version_constraint = '< 4.0.0'
spec.add_runtime_dependency 'activerecord', rails_version_constraint
spec.add_runtime_dependency 'activerecord', Metasploit::Framework::RailsVersionConstraint::RAILS_VERSION
# Metasploit::Credential database models
spec.add_runtime_dependency 'metasploit-credential', '~> 0.13.8'
# Database models shared between framework and Pro.

View File

@ -12,6 +12,7 @@ end
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'metasploit/framework/version'
require 'metasploit/framework/rails_version_constraint'
Gem::Specification.new do |spec|
spec.name = 'metasploit-framework-full'
@ -28,6 +29,7 @@ Gem::Specification.new do |spec|
metasploit_framework_version_constraint = "= #{spec.version}"
spec.add_runtime_dependency 'rails', Metasploit::Framework::RailsVersionConstraint::RAILS_VERSION
spec.add_runtime_dependency 'metasploit-framework', metasploit_framework_version_constraint
spec.add_runtime_dependency 'metasploit-framework-db', metasploit_framework_version_constraint
spec.add_runtime_dependency 'metasploit-framework-pcap', metasploit_framework_version_constraint

View File

@ -12,6 +12,7 @@ end
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'metasploit/framework/version'
require 'metasploit/framework/rails_version_constraint'
Gem::Specification.new do |spec|
spec.name = 'metasploit-framework'
@ -46,13 +47,11 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^spec/})
spec.require_paths = ["lib"]
# The Metasploit ecosystem is not ready for Rails 4 as it uses features of Rails 3.X that are removed in Rails 4.
rails_version_constraint = '< 4.0.0'
# Need 3+ for ActiveSupport::Concern
spec.add_runtime_dependency 'activesupport', '>= 3.0.0', rails_version_constraint
spec.add_runtime_dependency 'activesupport', '>= 3.0.0', Metasploit::Framework::RailsVersionConstraint::RAILS_VERSION
# Needed for config.action_view for view plugin compatibility for Pro
spec.add_runtime_dependency 'actionpack', rails_version_constraint
spec.add_runtime_dependency 'actionpack', Metasploit::Framework::RailsVersionConstraint::RAILS_VERSION
# Needed for some admin modules (cfme_manageiq_evm_pass_reset.rb)
spec.add_runtime_dependency 'bcrypt'
# Needed for Javascript obfuscation