Skip to content

Commit

Permalink
Move railties/lib/* into railties/lib/*
Browse files Browse the repository at this point in the history
  • Loading branch information
Yehuda Katz + Carl Lerche committed Sep 24, 2009
1 parent 610b81b commit f0dd77c
Show file tree
Hide file tree
Showing 291 changed files with 141 additions and 108 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -28,4 +28,6 @@ railties/guides/output
*.swp *.swp
*.swo *.swo
actionpack/bin actionpack/bin
*/vendor/gems vendor/gems/
*/vendor/gems/
bin/
1 change: 1 addition & 0 deletions actionpack/lib/action_controller/testing/process.rb
@@ -1,4 +1,5 @@
require 'active_support/core_ext/object/conversions' require 'active_support/core_ext/object/conversions'
require "rack/test"


module ActionController #:nodoc: module ActionController #:nodoc:
# Essentially generates a modified Tempfile object similar to the object # Essentially generates a modified Tempfile object similar to the object
Expand Down
2 changes: 1 addition & 1 deletion railties/Rakefile
Expand Up @@ -81,7 +81,7 @@ end


task :create_rails do task :create_rails do
require File.join(File.dirname(__FILE__), 'lib', 'generators') require File.join(File.dirname(__FILE__), 'lib', 'generators')
require 'generators/rails/app/app_generator' require 'rails/generators/rails/app/app_generator'
Rails::Generators::AppGenerator.start [ File.basename(PKG_DESTINATION), "--quiet" ], Rails::Generators::AppGenerator.start [ File.basename(PKG_DESTINATION), "--quiet" ],
:destination_root => File.expand_path(File.dirname(PKG_DESTINATION)) :destination_root => File.expand_path(File.dirname(PKG_DESTINATION))
end end
Expand Down
18 changes: 14 additions & 4 deletions railties/bin/rails
@@ -1,15 +1,25 @@
require File.dirname(__FILE__) + '/../lib/ruby_version_check' begin
require 'rails/ruby_version_check'
rescue LoadError
# If people are not using gems, the load path must still
# be correct.
# TODO: Remove the begin / rescue block somehow
$:.unshift File.dirname(__FILE__) + '/../lib'
$:.unshift File.dirname(__FILE__) + '/../../activesupport/lib'
retry
end

Signal.trap("INT") { puts; exit } Signal.trap("INT") { puts; exit }


require File.dirname(__FILE__) + '/../lib/rails/version' require 'rails/version'
if %w(--version -v).include? ARGV.first if %w(--version -v).include? ARGV.first
puts "Rails #{Rails::VERSION::STRING}" puts "Rails #{Rails::VERSION::STRING}"
exit(0) exit(0)
end end


ARGV << "--help" if ARGV.empty? ARGV << "--help" if ARGV.empty?


require File.dirname(__FILE__) + '/../lib/generators' require 'rails/generators'
require 'generators/rails/app/app_generator' require 'rails/generators/rails/app/app_generator'


Rails::Generators::AppGenerator.start Rails::Generators::AppGenerator.start
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -13,9 +13,9 @@


libs = " -r irb/completion" libs = " -r irb/completion"
libs << %( -r "#{RAILS_ROOT}/config/environment") libs << %( -r "#{RAILS_ROOT}/config/environment")
libs << " -r console_app" libs << " -r rails/console_app"
libs << " -r console_sandbox" if options[:sandbox] libs << " -r rails/console_sandbox" if options[:sandbox]
libs << " -r console_with_helpers" libs << " -r rails/console_with_helpers"


if options[:debugger] if options[:debugger]
begin begin
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
require 'fcgi' require 'fcgi'
require 'logger' require 'logger'
require 'dispatcher' require 'rails/dispatcher'
require 'rbconfig' require 'rbconfig'


class RailsFCGIHandler class RailsFCGIHandler
Expand Down
Expand Up @@ -8,10 +8,10 @@
require 'active_support/core_ext/module/attribute_accessors' require 'active_support/core_ext/module/attribute_accessors'
require 'active_support/core_ext/string/inflections' require 'active_support/core_ext/string/inflections'


$LOAD_PATH.unshift(File.dirname(__FILE__)) # TODO: Do not always push on vendored thor
$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/vendor/thor-0.11.6/lib") $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/vendor/thor-0.11.6/lib")
require 'generators/base' require 'rails/generators/base'
require 'generators/named_base' require 'rails/generators/named_base'


module Rails module Rails
module Generators module Generators
Expand Down
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
require 'generators/named_base' require 'rails/generators/named_base'
require 'generators/migration' require 'rails/generators/migration'
require 'generators/active_model' require 'rails/generators/active_model'


module ActiveRecord module ActiveRecord
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/active_record' require 'rails/generators/active_record'


module ActiveRecord module ActiveRecord
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/active_record' require 'rails/generators/active_record'


module ActiveRecord module ActiveRecord
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/active_record' require 'rails/generators/active_record'


module ActiveRecord module ActiveRecord
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/active_record' require 'rails/generators/active_record'


module ActiveRecord module ActiveRecord
module Generators module Generators
Expand Down
@@ -1,5 +1,5 @@
require 'thor' require 'thor'
require 'generators/actions' require 'rails/generators/actions'


module Rails module Rails
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/named_base' require 'rails/generators/named_base'


module Erb module Erb
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/erb' require 'rails/generators/erb'


module Erb module Erb
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/erb' require 'rails/generators/erb'


module Erb module Erb
module Generators module Generators
Expand Down
@@ -1,5 +1,5 @@
require 'generators/erb' require 'rails/generators/erb'
require 'generators/resource_helpers' require 'rails/generators/resource_helpers'


module Erb module Erb
module Generators module Generators
Expand Down
File renamed without changes.
@@ -1,5 +1,5 @@
require 'generators/base' require 'rails/generators/base'
require 'generators/generated_attribute' require 'rails/generators/generated_attribute'


module Rails module Rails
module Generators module Generators
Expand Down
File renamed without changes.
Expand Up @@ -7,4 +7,4 @@ require 'rake'
require 'rake/testtask' require 'rake/testtask'
require 'rake/rdoctask' require 'rake/rdoctask'


require 'tasks/rails' require 'rails/tasks'
Expand Up @@ -42,7 +42,11 @@ def run


class VendorBoot < Boot class VendorBoot < Boot
def load_initializer def load_initializer
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer" # activesupport/lib
%w(railties/lib).each do |path|
$:.unshift("#{RAILS_ROOT}/vendor/rails/#{path}")
end
require "rails/initializer"
Rails::Initializer.run(:install_gem_spec_stubs) Rails::Initializer.run(:install_gem_spec_stubs)
Rails::GemDependency.add_frozen_gem_path Rails::GemDependency.add_frozen_gem_path
end end
Expand All @@ -52,7 +56,7 @@ class GemBoot < Boot
def load_initializer def load_initializer
self.class.load_rubygems self.class.load_rubygems
load_rails_gem load_rails_gem
require 'initializer' require 'rails/initializer'
end end


def load_rails_gem def load_rails_gem
Expand Down
@@ -1,4 +1,4 @@
<%= shebang %> <%= shebang %>
require File.expand_path('../../config/boot', __FILE__) require File.expand_path('../../config/boot', __FILE__)
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info" $LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
require 'commands/about' require 'rails/commands/about'
@@ -1,3 +1,3 @@
<%= shebang %> <%= shebang %>
require File.expand_path('../../config/boot', __FILE__) require File.expand_path('../../config/boot', __FILE__)
require 'commands/console' require 'rails/commands/console'
@@ -1,3 +1,3 @@
<%= shebang %> <%= shebang %>
require File.expand_path('../../config/boot', __FILE__) require File.expand_path('../../config/boot', __FILE__)
require 'commands/dbconsole' require 'rails/commands/dbconsole'
@@ -1,3 +1,3 @@
<%= shebang %> <%= shebang %>
require File.expand_path('../../config/boot', __FILE__) require File.expand_path('../../config/boot', __FILE__)
require 'commands/destroy' require 'rails/commands/destroy'
@@ -1,3 +1,3 @@
<%= shebang %> <%= shebang %>
require File.expand_path('../../config/boot', __FILE__) require File.expand_path('../../config/boot', __FILE__)
require 'commands/generate' require 'rails/commands/generate'
@@ -1,3 +1,3 @@
<%= shebang %> <%= shebang %>
require File.expand_path('../../../config/boot', __FILE__) require File.expand_path('../../../config/boot', __FILE__)
require 'commands/performance/benchmarker' require 'rails/commands/performance/benchmarker'
@@ -1,3 +1,3 @@
<%= shebang %> <%= shebang %>
require File.expand_path('../../../config/boot', __FILE__) require File.expand_path('../../../config/boot', __FILE__)
require 'commands/performance/profiler' require 'rails/commands/performance/profiler'
@@ -1,3 +1,3 @@
<%= shebang %> <%= shebang %>
require File.expand_path('../../config/boot', __FILE__) require File.expand_path('../../config/boot', __FILE__)
require 'commands/plugin' require 'rails/commands/plugin'
@@ -1,3 +1,3 @@
<%= shebang %> <%= shebang %>
require File.expand_path('../../config/boot', __FILE__) require File.expand_path('../../config/boot', __FILE__)
require 'commands/runner' require 'rails/commands/runner'
@@ -1,3 +1,3 @@
<%= shebang %> <%= shebang %>
require File.expand_path('../../config/boot', __FILE__) require File.expand_path('../../config/boot', __FILE__)
require 'commands/server' require 'rails/commands/server'
@@ -1,6 +1,6 @@
ENV["RAILS_ENV"] = "test" ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help' require 'rails/test_help'


class ActiveSupport::TestCase class ActiveSupport::TestCase
# Transactional fixtures accelerate your tests by wrapping each test method # Transactional fixtures accelerate your tests by wrapping each test method
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
require 'generators/rails/generator/generator_generator' require 'rails/generators/rails/generator/generator_generator'


module Rails module Rails
module Generators module Generators
Expand Down
@@ -1,5 +1,5 @@
require 'generators/rails/model/model_generator' require 'rails/generators/rails/model/model_generator'
require 'generators/resource_helpers' require 'rails/generators/resource_helpers'


module Rails module Rails
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/rails/resource/resource_generator' require 'rails/generators/rails/resource/resource_generator'


module Rails module Rails
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/resource_helpers' require 'rails/generators/resource_helpers'


module Rails module Rails
module Generators module Generators
Expand Down
Expand Up @@ -54,7 +54,7 @@ def orm_class
begin begin
klass = active_model.constantize klass = active_model.constantize
rescue NameError rescue NameError
require "generators/#{options[:orm]}" require "rails/generators/#{options[:orm]}"
end end


# Try once again after loading the file with success. # Try once again after loading the file with success.
Expand Down
@@ -1,4 +1,4 @@
require 'generators/named_base' require 'rails/generators/named_base'


module TestUnit module TestUnit
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/test_unit' require 'rails/generators/test_unit'


module TestUnit module TestUnit
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/test_unit' require 'rails/generators/test_unit'


module TestUnit module TestUnit
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/test_unit' require 'rails/generators/test_unit'


module TestUnit module TestUnit
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/test_unit' require 'rails/generators/test_unit'


module TestUnit module TestUnit
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/test_unit' require 'rails/generators/test_unit'


module TestUnit module TestUnit
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/test_unit' require 'rails/generators/test_unit'


module TestUnit module TestUnit
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/test_unit' require 'rails/generators/test_unit'


module TestUnit module TestUnit
module Generators module Generators
Expand Down
@@ -1,4 +1,4 @@
require 'generators/test_unit' require 'rails/generators/test_unit'


module TestUnit module TestUnit
module Generators module Generators
Expand Down
@@ -1,5 +1,5 @@
require 'generators/test_unit' require 'rails/generators/test_unit'
require 'generators/resource_helpers' require 'rails/generators/resource_helpers'


module TestUnit module TestUnit
module Generators module Generators
Expand Down
@@ -1,7 +1,6 @@
require "pathname" require "pathname"


$LOAD_PATH.unshift File.dirname(__FILE__) require 'rails/railties_path'
require 'railties_path'
require 'rails/version' require 'rails/version'
require 'rails/gem_dependency' require 'rails/gem_dependency'
require 'rails/rack' require 'rails/rack'
Expand Down Expand Up @@ -114,7 +113,7 @@ def self.run(initializer = nil, config = nil)
# Check for valid Ruby version (1.8.2 or 1.8.4 or higher). This is done in an # Check for valid Ruby version (1.8.2 or 1.8.4 or higher). This is done in an
# external file, so we can use it from the `rails` program as well without duplication. # external file, so we can use it from the `rails` program as well without duplication.
Initializer.default.add :check_ruby_version do Initializer.default.add :check_ruby_version do
require 'ruby_version_check' require 'rails/ruby_version_check'
end end


# If Rails is vendored and RubyGems is available, install stub GemSpecs # If Rails is vendored and RubyGems is available, install stub GemSpecs
Expand Down Expand Up @@ -523,7 +522,7 @@ def self.run(initializer = nil, config = nil)
# # Prepare dispatcher callbacks and run 'prepare' callbacks # # Prepare dispatcher callbacks and run 'prepare' callbacks
Initializer.default.add :prepare_dispatcher do Initializer.default.add :prepare_dispatcher do
next unless configuration.frameworks.include?(:action_controller) next unless configuration.frameworks.include?(:action_controller)
require 'dispatcher' unless defined?(::Dispatcher) require 'rails/dispatcher' unless defined?(::Dispatcher)
Dispatcher.define_dispatcher_callbacks(configuration.cache_classes) Dispatcher.define_dispatcher_callbacks(configuration.cache_classes)
end end


Expand Down
File renamed without changes.
File renamed without changes.
@@ -1 +1 @@
RAILTIES_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..')) RAILTIES_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
File renamed without changes.
File renamed without changes.
File renamed without changes.

3 comments on commit f0dd77c

@carllerche
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the commit message is wrong.

@imajes
Copy link
Contributor

@imajes imajes commented on f0dd77c Sep 25, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's what he wants you to think. :P

@josh
Copy link
Contributor

@josh josh commented on f0dd77c Oct 4, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.