1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-12 11:52:01 +01:00

Replace require_gem with gem

git-svn-id: file:///home/svn/framework3/trunk@4558 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2007-03-24 23:03:19 +00:00
parent 4d7ddb0e07
commit 83f9ea9405
2 changed files with 9 additions and 12 deletions

View File

@ -22,20 +22,21 @@ unless defined?(Rails::Initializer)
rails_gem_version = $1
if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
rails_gem = Gem.cache.search('rails', "=#{version}").first
# Asking for 1.1.6 will give you 1.1.6.5206, if available -- makes it easier to use beta gems
rails_gem = Gem.cache.search('rails', "~>#{version}.0").sort_by { |g| g.version.version }.last
if rails_gem
require_gem "rails", "=#{version}"
gem "rails", "=#{rails_gem.version.version}"
require rails_gem.full_gem_path + '/lib/initializer'
else
STDERR.puts %(Cannot find gem for Rails =#{version}:
STDERR.puts %(Cannot find gem for Rails ~>#{version}.0:
Install the missing gem with 'gem install -v=#{version} rails', or
change environment.rb to define RAILS_GEM_VERSION with your desired version.
)
exit 1
end
else
require_gem "rails"
gem "rails"
require 'initializer'
end
end

View File

@ -1,18 +1,14 @@
# Be sure to restart your web server when you modify this file.
# Uncomment below to force Rails into production mode when
# you don't control web/app server and can't set it the proper way
ENV['RAILS_ENV'] = 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '1.2.2'
RAILS_GEM_VERSION = '1.2.2' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
Rails::Initializer.run do |config|
ActionController::Base.allow_concurrency = true
end
@ -29,7 +25,7 @@ $msframework = $msfweb.framework
if ($browser_start)
Thread.new do
select(nil, nil, nil, 1)
select(nil, nil, nil, 0.5)
case RUBY_PLATFORM
when /mswin32/