public
Description: HomeMarks is a web based GUI to build HTML start pages.
Homepage: http://www.homemarks.com/
Clone URL: git://github.com/metaskills/homemarks.git
Click here to lend your support to: homemarks and make a donation at www.pledgie.com !
Adding log and tmp dirs. Removing old dev SQL dump. New rails 2 boot.rb.
metaskills (author)
Sat Mar 22 07:24:16 -0700 2008
commit  770b7de34a1cc1401968d0f7560d288909409777
tree    54da8fa66d9d32cf62fd067fc5320916d6b9966e
parent  3e19b59548bc7c8dc62a47befb851edfb27aa5db
...
1
 
 
2
3
4
 
5
6
7
8
9
 
 
 
 
 
 
 
 
10
11
12
 
 
 
13
14
15
16
17
18
 
 
 
 
 
 
 
19
20
21
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
24
25
26
 
 
 
 
 
 
27
28
29
30
 
 
 
31
32
33
34
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
37
38
39
40
 
 
 
 
 
 
 
 
 
41
42
 
43
44
45
46
 
 
...
 
1
2
3
 
 
4
5
 
 
 
 
6
7
8
9
10
11
12
13
14
 
 
15
16
17
18
 
 
 
 
 
19
20
21
22
23
24
25
26
 
 
 
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
 
 
 
50
51
52
53
54
55
56
 
 
 
57
58
59
60
 
 
 
 
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
 
 
 
95
96
97
98
99
100
101
102
103
104
105
106
107
 
 
108
109
110
0
@@ -1,45 +1,109 @@
0
-# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
0
+# Don't change this file!
0
+# Configure your app in config/environment.rb and config/environments/*.rb
0
 
0
-unless defined?(RAILS_ROOT)
0
- root_path = File.join(File.dirname(__FILE__), '..')
0
+RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
0
 
0
- unless RUBY_PLATFORM =~ /mswin32/
0
- require 'pathname'
0
- root_path = Pathname.new(root_path).cleanpath(true).to_s
0
- end
0
+module Rails
0
+ class << self
0
+ def boot!
0
+ unless booted?
0
+ preinitialize
0
+ pick_boot.run
0
+ end
0
+ end
0
 
0
- RAILS_ROOT = root_path
0
-end
0
+ def booted?
0
+ defined? Rails::Initializer
0
+ end
0
 
0
-unless defined?(Rails::Initializer)
0
- if File.directory?("#{RAILS_ROOT}/vendor/rails")
0
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
0
- else
0
- require 'rubygems'
0
+ def pick_boot
0
+ (vendor_rails? ? VendorBoot : GemBoot).new
0
+ end
0
+
0
+ def vendor_rails?
0
+ File.exist?("#{RAILS_ROOT}/vendor/rails")
0
+ end
0
 
0
- environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join
0
- environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/
0
- rails_gem_version = $1
0
+ # FIXME : Ruby 1.9
0
+ def preinitialize
0
+ load(preinitializer_path) if File.exists?(preinitializer_path)
0
+ end
0
+
0
+ def preinitializer_path
0
+ "#{RAILS_ROOT}/config/preinitializer.rb"
0
+ end
0
+ end
0
+
0
+ class Boot
0
+ def run
0
+ load_initializer
0
+ Rails::Initializer.run(:set_load_path)
0
+ end
0
+ end
0
+
0
+ class VendorBoot < Boot
0
+ def load_initializer
0
+ require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
0
+ end
0
+ end
0
 
0
- if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
0
- # Asking for 1.1.6 will give you 1.1.6.5206, if available -- makes it easier to use beta gems
0
- rails_gem = Gem.cache.search('rails', "~>#{version}.0").sort_by { |g| g.version.version }.last
0
+ class GemBoot < Boot
0
+ def load_initializer
0
+ self.class.load_rubygems
0
+ load_rails_gem
0
+ require 'initializer'
0
+ end
0
 
0
- if rails_gem
0
- require_gem "rails", "=#{rails_gem.version.version}"
0
- require rails_gem.full_gem_path + '/lib/initializer'
0
+ def load_rails_gem
0
+ if version = self.class.gem_version
0
+ gem 'rails', version
0
       else
0
- STDERR.puts %(Cannot find gem for Rails ~>#{version}.0:
0
- Install the missing gem with 'gem install -v=#{version} rails', or
0
- change environment.rb to define RAILS_GEM_VERSION with your desired version.
0
- )
0
+ gem 'rails'
0
+ end
0
+ rescue Gem::LoadError => load_error
0
+ $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
0
+ exit 1
0
+ end
0
+
0
+ class << self
0
+ def rubygems_version
0
+ Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
0
+ end
0
+
0
+ def gem_version
0
+ if defined? RAILS_GEM_VERSION
0
+ RAILS_GEM_VERSION
0
+ elsif ENV.include?('RAILS_GEM_VERSION')
0
+ ENV['RAILS_GEM_VERSION']
0
+ else
0
+ parse_gem_version(read_environment_rb)
0
+ end
0
+ end
0
+
0
+ def load_rubygems
0
+ require 'rubygems'
0
+
0
+ unless rubygems_version >= '0.9.4'
0
+ $stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
0
+ exit 1
0
+ end
0
+
0
+ rescue LoadError
0
+ $stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
0
         exit 1
0
       end
0
- else
0
- require_gem "rails"
0
- require 'initializer'
0
+
0
+ def parse_gem_version(text)
0
+ $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
0
+ end
0
+
0
+ private
0
+ def read_environment_rb
0
+ File.read("#{RAILS_ROOT}/config/environment.rb")
0
+ end
0
     end
0
   end
0
+end
0
 
0
- Rails::Initializer.run(:set_load_path)
0
-end
0
\ No newline at end of file
0
+# All that for this:
0
+Rails.boot!
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
0
@@ -1,21 +1,3 @@
0
-
0
-# create_table(name, options = {}) {|t| ...}
0
-# --------------------------------------------------------------------------------------------------------------
0
-# :id Set to true or false to add/not add a primary key column automatically. Defaults to true.
0
-# :primary_key The name of the primary key, if one is to be added automatically. Defaults to id.
0
-# :options Any extra options you want appended to the table definition.
0
-# :temporary Make a temporary table.
0
-# :force Set to true or false to drop the table before creating it. Defaults to false.
0
-#
0
-# column(name, type, options = {})
0
-# --------------------------------------------------------------------------------------------------------------
0
-# :primary_key, :string, :text, :integer, :float, :datetime, :timestamp, :time, :date, :binary, :boolean.
0
-#
0
-# :limit Requests a maximum column length (:string, :text, :binary or :integer columns only)
0
-# :default The column’s default value. You cannot explicitely set the default value to NULL.
0
-# Simply leave off this option if you want a NULL default value.
0
-# :null Allows or disallows NULL values in the column. This option could have been named :null_allowed.
0
-
0
 class SetupInitialDatabases < ActiveRecord::Migration
0
   def self.up
0
     

Comments

    No one has commented yet.