Permalink
Browse files

Revert "Final steps toward clean rails "foo"; cd foo; gem bundle; scr…

…ipt/server working"

Broke stuff.

This reverts commit 520b8b5.
  • Loading branch information...
1 parent 5df26dd commit c7c39f52dcce4ea6de2051ee7816c0cb9d583f8f @jeremy jeremy committed Nov 19, 2009
@@ -3,6 +3,11 @@ class Application
include Initializable
class << self
+ def inherited(klass)
+ Rails.application ||= klass unless klass.name =~ /Rails/
+ super
+ end
+
# Stub out App initialize
def initialize!
new
@@ -33,7 +38,6 @@ def call(env)
end
def initialize
- Rails.application ||= self
run_initializers(self)
end
@@ -3,13 +3,11 @@
require 'fileutils'
require 'optparse'
-# Waiting for Rack::Server patch
-
options = {
:Port => 3000,
:Host => "0.0.0.0",
:environment => (ENV['RAILS_ENV'] || "development").dup,
- :config => $config_ru,
+ :config => "#{Rails.root}/config.ru",
:detach => false,
:debugger => false
}
@@ -50,7 +50,7 @@ def create_root
def create_root_files
copy_file "Rakefile"
copy_file "README"
- template "config.ru"
+ copy_file "config.ru"
template "Gemfile"
end
@@ -2,4 +2,4 @@
require ::File.expand_path('../config/environment', __FILE__)
# Dispatch the request
-run <%= app_name.classify %>
+run Rails.application
@@ -1,6 +1,6 @@
require File.expand_path('../boot', __FILE__)
-class <%= app_name.classify %> < Rails::Application
+Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
@@ -2,4 +2,4 @@
require File.expand_path('../application', __FILE__)
# Initialize the rails application
-<%= app_name.classify %>.initialize!
+Rails.initialize!
@@ -1,5 +1,2 @@
require File.expand_path('../../config/application', __FILE__)
-# Temporary patch until Rack::Server
-# Will be Rails::Server.start(File.expand_path("../../config.ru", __FILE__))
-$config_ru = File.expand_path("../../config.ru", __FILE__)
require 'rails/commands/server'
@@ -1,11 +1,12 @@
module Rails
module Rack
class LogTailer
+ EnvironmentLog = "#{File.expand_path(Rails.root)}/log/#{Rails.env}.log"
+
def initialize(app, log = nil)
- @default_log = "#{File.expand_path(Rails.root)}/log/#{Rails.env}.log"
@app = app
- path = Pathname.new(log || @default_log).cleanpath
+ path = Pathname.new(log || EnvironmentLog).cleanpath
@cursor = ::File.size(path)
@last_checked = Time.now.to_f

0 comments on commit c7c39f5

Please sign in to comment.