GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of typo/blog
Description: The typo blogging engine for enteprise
Homepage: http://www.lipsiasoft.com
Clone URL: git://github.com/Lipsiasoft/blog.git
Updated to Rails 2.1
Lipsiasoft (author)
Sat Jun 14 15:43:43 -0700 2008
commit  408189c360babc00001ca236fcfc5772ca6410f3
tree    a35fb2da7af72cb2f5b5de0b4c5834fbd6fe84c2
parent  13bbc6add1295259cecdb712f1788ba40310feae
...
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/railties")
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
+ def preinitialize
0
+ load(preinitializer_path) if File.exist?(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
+ Rails::Initializer.run(:install_gem_spec_stubs)
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
- 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!
...
54
55
56
57
 
58
59
60
...
54
55
56
 
57
58
59
60
0
@@ -54,7 +54,7 @@ Rails::Initializer.run do |config|
0
 
0
   # Enable page/fragment caching by setting a file-based store
0
   # (remember to create the caching directory and make it readable to the application)
0
- config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/tmp/cache"
0
+ config.action_controller.cache_store = :file_store, "#{RAILS_ROOT}/tmp/cache"
0
 
0
   # Activate observers that should always be running
0
   # config.active_record.observers = :cacher, :garbage_collector
...
17170
17171
17172
 
 
 
 
 
 
 
...
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
0
@@ -17170,3 +17170,10 @@ generate({:action=>"index"}, {:controller=>"admin/settings", :action=>"index"},
0
 Rendered admin/settings/_submit (0.00082)
0
 generate({:controller=>"admin/settings", :action=>"index"}, {:controller=>"admin/settings", :action=>"index"}, {:controller=>false, :action=>false}) reached the default route
0
 Completed in 0.07314 (13 reqs/sec) | Rendering: 0.01679 (22%) | DB: 0.02714 (37%) | 200 OK [http://localhost/admin/settings]
0
+allow_concurrency=false
0
+DEPRECATION WARNING: The fragment_cache_store= method is now use cache_store= See http://www.rubyonrails.org/deprecation for details. (called from fragment_cache_store= at /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/fragments.rb:33)
0
+ SQL (0.000393) SET SQL_AUTO_IS_NULL=0
0
+ SQL (0.000491) select * from sessions
0
+allow_concurrency=false
0
+ SQL (0.000295) SET SQL_AUTO_IS_NULL=0
0
+ SQL (0.000398) select * from sessions
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
0
+// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
0
 // (c) 2005-2007 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
0
 // (c) 2005-2007 Jon Tirsen (http://www.tirsen.com)
0
 // Contributors:
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
0
+// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
0
 // (c) 2005-2007 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
0
 //
0
 // script.aculo.us is freely distributable under the terms of an MIT-style license.
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
0
+// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
0
 // Contributors:
0
 // Justin Palmer (http://encytemedia.com/)
0
 // Mark Pilgrim (http://diveintomark.org/)

Comments

    No one has commented yet.