Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 4
- Log:
Initial import of Radiant 0.50 sources from a downloaded Tarball.
Radiant is a Ruby On Rails based lightweight content management
system.
- Author:
- adh
- Date:
- Sat Jul 22 16:47:40 +0100 2006
- Size:
- 2341 Bytes
1 | # Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb |
2 | |
3 | module BootUtil |
4 | def self.find_gem(name, version) |
5 | Gem.cache.search(name, "=#{version}").first |
6 | end |
7 | end |
8 | |
9 | unless defined?(RAILS_ROOT) |
10 | root_path = File.join(File.dirname(__FILE__), '..') |
11 | |
12 | unless RUBY_PLATFORM =~ /mswin32/ |
13 | require 'pathname' |
14 | root_path = Pathname.new(root_path).cleanpath(true).to_s |
15 | end |
16 | |
17 | RAILS_ROOT = root_path |
18 | end |
19 | |
20 | unless defined?(RADIANT_ROOT) |
21 | instance_config = File.join(RAILS_ROOT, "config", "instance.yml") |
22 | unless File.file?(instance_config) |
23 | RADIANT_ROOT = RAILS_ROOT |
24 | else |
25 | require 'yaml' |
26 | cfg = YAML.load_file(instance_config) |
27 | if version = cfg['Gem Version'] |
28 | require 'rubygems' |
29 | if radiant_gem = BootUtil.find_gem('radiant', version) |
30 | require_gem 'radiant', "= #{version}" |
31 | else |
32 | STDERR.puts %( |
33 | Cannot find gem for Radiant =#{version}: |
34 | Install the missing gem with 'gem install -v=#{version} radiant', or |
35 | change config/instance.yml to define 'Gem Version' with your desired |
36 | version. |
37 | ) |
38 | exit 1 |
39 | end |
40 | else |
41 | RADIANT_ROOT = cfg['Radiant Root'] |
42 | end |
43 | end |
44 | ( |
45 | Dir["#{RADIANT_ROOT}/vendor/rails/*/lib"] + |
46 | Dir["#{RADIANT_ROOT}/vendor/*/lib"] |
47 | ).each do |dir| |
48 | $:.unshift dir |
49 | end |
50 | end |
51 | |
52 | unless defined?(Rails::Initializer) |
53 | if File.directory?("#{RAILS_ROOT}/vendor/rails") |
54 | require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer" |
55 | else |
56 | environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join |
57 | environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/ |
58 | rails_gem_version = $1 |
59 | |
60 | require 'rubygems' |
61 | if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version |
62 | if rails_gem = BootUtil.find_gem('rails', version) |
63 | require_gem "rails", "=#{version}" |
64 | require rails_gem.full_gem_path + '/lib/initializer' |
65 | else |
66 | STDERR.puts %( |
67 | Cannot find gem for Rails =#{version}: |
68 | Install the missing gem with 'gem install -v=#{version} rails', or |
69 | change environment.rb to define RAILS_GEM_VERSION with your desired version. |
70 | ) |
71 | exit 1 |
72 | end |
73 | else |
74 | require_gem "rails" |
75 | require 'initializer' |
76 | end |
77 | end |
78 | |
79 | Rails::Initializer.run(:set_load_path) |
80 | end |