Add Description to the edit pages for {Video,Game,Rentable}Policy
[cs356-p2-videostore.git] / config / boot.rb
1 # Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
2
3 RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
4
5 unless defined?(Rails::Initializer)
6   if File.directory?("#{RAILS_ROOT}/vendor/rails")
7     require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
8   else
9     require 'rubygems'
10
11     rails_gem_version =
12       if defined? RAILS_GEM_VERSION
13         RAILS_GEM_VERSION
14       else
15         File.read("#{File.dirname(__FILE__)}/environment.rb") =~ /^[^#]*RAILS_GEM_VERSION\s+=\s+'([\d.]+)'/
16         $1
17       end
18
19     if rails_gem_version
20       rails_gem = Gem.cache.search('rails', "=#{rails_gem_version}.0").sort_by { |g| g.version.version }.last
21
22       if rails_gem
23         gem "rails", "=#{rails_gem.version.version}"
24         require rails_gem.full_gem_path + '/lib/initializer'
25       else
26         STDERR.puts %(Cannot find gem for Rails =#{rails_gem_version}.0:
27     Install the missing gem with 'gem install -v=#{rails_gem_version} rails', or
28     change environment.rb to define RAILS_GEM_VERSION with your desired version.
29   )
30         exit 1
31       end
32     else
33       gem "rails"
34       require 'initializer'
35     end
36   end
37
38   Rails::Initializer.run(:set_load_path)
39 end