14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/ripl/rails.rb', line 14
def self.load_rails
ENV['RAILS_ENV'] = ARGV[0] if ARGV[0].to_s[/^[^-]/]
require "#{Dir.pwd}/config/boot"
if File.exists?("#{Dir.pwd}/config/application.rb")
Object.const_set :APP_PATH, File.expand_path("#{Dir.pwd}/config/application")
require APP_PATH
require 'rails/console/app'
require 'rails/console/helpers'
if defined?(Rails::ConsoleMethods)
Ripl::Commands.include Rails::ConsoleMethods
end
::Rails.application.require_environment!
else
["#{Dir.pwd}/config/environment", 'console_app', 'console_with_helpers'].each {|e| require e }
end
puts "Loading #{::Rails.env} environment (Rails #{::Rails.version})"
end
|