提交 ab321268 编写于 作者: J Jeremy Kemper

No more free lunch

上级 42a06d2d
......@@ -30,6 +30,7 @@
require 'active_support'
end
end
require 'active_support/core/all'
require File.join(File.dirname(__FILE__), "action_pack")
......
......@@ -30,6 +30,7 @@
require 'active_support'
end
end
require 'active_support/core/all'
$:.unshift "#{File.dirname(__FILE__)}/action_dispatch/vendor/rack-1.0"
begin
......
......@@ -30,6 +30,7 @@
require 'active_support'
end
end
require 'active_support/core/all'
require File.join(File.dirname(__FILE__), "action_pack")
......
# This file is required by each major ActiveModel component for the core requirements. This allows you to
# load individual pieces of ActiveModel as needed.
$LOAD_PATH << File.join(File.dirname(__FILE__), '..', '..', '..', 'activesupport', 'lib')
begin
require 'active_support'
rescue LoadError
activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib"
if File.directory?(activesupport_path)
$:.unshift activesupport_path
require 'active_support'
end
end
# premature optimization?
# So far, we only need the string inflections and not the rest of ActiveSupport.
require 'active_support/inflector'
\ No newline at end of file
require 'active_support/inflector'
......@@ -30,6 +30,7 @@
require 'active_support'
end
end
require 'active_support/core/all'
module ActiveRecord
# TODO: Review explicit loads to see if they will automatically be handled by the initilizer.
......
......@@ -30,6 +30,7 @@
require 'active_support'
end
end
require 'active_support/core/all'
require 'active_resource/formats'
require 'active_resource/base'
......
*Edge*
* require 'active_support' no longer orders the whole menu of core extensions. Ask for just what you need: e.g. require 'active_support/core/time' to use timezones, durations, and stdlib date/time extensions. [Jeremy Kemper]
* Removed rarely-used DRb cache store. [Jeremy Kemper]
* TimeWithZone.name returns 'Time', to further thwart type checking [Geoff Buesing]
......
......@@ -50,10 +50,7 @@ def self.load_all!
autoload :XmlMini, 'active_support/xml_mini'
end
require 'active_support/core/all'
require 'active_support/vendor'
require 'active_support/core_ext'
require 'active_support/dependencies'
require 'active_support/json'
......
require 'active_support/core_ext'
require 'active_support/core'
Dir["#{File.dirname(__FILE__)}/*.rb"].sort.each do |path|
require "active_support/core/#{File.basename(path, '.rb')}"
......
require 'active_support/core_ext/kernel/reporting'
module Kernel
# Require a library with fallback to RubyGems. Warnings during library
# loading are silenced to increase signal/noise for application warnings.
......@@ -21,4 +23,4 @@ def require_library_or_gem(library_name)
end
end
end
end
\ No newline at end of file
end
......@@ -29,12 +29,12 @@ task :default => :test
task :test do
Dir['test/**/*_test.rb'].all? do |file|
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
system(ruby, '-Itest', file)
system(ruby, '-Itest', "-I#{File.dirname(__FILE__)}/../activesupport/lib", file)
end or raise "Failures"
end
Rake::TestTask.new("regular_test") do |t|
t.libs << 'test'
t.libs << 'test' << "#{File.dirname(__FILE__)}/../activesupport/lib"
t.pattern = 'test/**/*_test.rb'
t.warning = true
t.verbose = true
......
require 'active_support/core_ext/kernel/reporting'
module Rails
# The Plugin class should be an object which provides the following methods:
#
......@@ -35,10 +37,10 @@ def valid?
def load_paths
report_nonexistant_or_empty_plugin! unless valid?
returning [] do |load_paths|
load_paths << lib_path if has_lib_directory?
load_paths << app_paths if has_app_directory?
end.flatten
load_paths = []
load_paths << lib_path if has_lib_directory?
load_paths << app_paths if has_app_directory?
load_paths.flatten
end
# Evaluates a plugin's init.rb file.
......
require 'active_support/ordered_hash'
require 'active_support/core_ext/class/attribute_accessors'
module Rails
module Rack
......
......@@ -21,16 +21,18 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
$:.unshift(File.dirname(__FILE__))
$:.unshift(File.dirname(__FILE__) + "/../../activesupport/lib")
begin
require 'active_support'
require 'active_support'
rescue LoadError
require 'rubygems'
gem 'activesupport'
activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib"
if File.directory?(activesupport_path)
$:.unshift activesupport_path
require 'active_support'
end
end
require 'active_support/core/all'
$:.unshift(File.dirname(__FILE__))
require 'rails_generator/base'
require 'rails_generator/lookup'
require 'rails_generator/commands'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册