mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Moved Active Support into its own gem
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@624 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
45caae41c3
commit
dc3d6eb9b4
45 changed files with 118 additions and 82 deletions
|
@ -47,7 +47,7 @@ spec = Gem::Specification.new do |s|
|
|||
s.name = PKG_NAME
|
||||
s.version = PKG_VERSION
|
||||
s.summary = "Web-flow and rendering framework putting the VC in MVC."
|
||||
s.description = %q{Eases web-request routing, handling, and response as a half-way front, half-way page controller. Implemented with specific emphasis on enabling easy unit/integration testing that doesn't require a browser.}
|
||||
s.description = %q{Eases web-request routing, handling, and response as a half-way front, half-way page controller. Implemented with specific emphasis on enabling easy unit/integration testing that doesn't require a browser.} #'
|
||||
|
||||
s.author = "David Heinemeier Hansson"
|
||||
s.email = "david@loudthinking.com"
|
||||
|
@ -56,6 +56,9 @@ spec = Gem::Specification.new do |s|
|
|||
|
||||
s.has_rdoc = true
|
||||
s.requirements << 'none'
|
||||
|
||||
s.add_dependency('activesupport', '>= 1.0.0')
|
||||
|
||||
s.require_path = 'lib'
|
||||
s.autorequire = 'action_controller'
|
||||
|
||||
|
|
|
@ -19,8 +19,7 @@ unless $sitedir
|
|||
end
|
||||
|
||||
makedirs = %w{ action_controller/assertions action_controller/cgi_ext
|
||||
action_controller/session action_controller/support action_controller/support/core_ext
|
||||
action_controller/support/core_ext/hash action_controller/support/core_ext/numeric action_controller/support/core_ext/string
|
||||
action_controller/session action_controller/support
|
||||
action_controller/templates action_controller/templates/rescues
|
||||
action_controller/templates/scaffolds
|
||||
action_view/helpers action_view/vendor action_view/vendor/builder
|
||||
|
@ -60,24 +59,6 @@ files = %w-
|
|||
action_controller/session/drb_store.rb
|
||||
action_controller/session/mem_cache_store.rb
|
||||
action_controller/session.rb
|
||||
action_controller/support/class_inheritable_attributes.rb
|
||||
action_controller/support/class_attribute_accessors.rb
|
||||
action_controller/support/clean_logger.rb
|
||||
action_controller/support/core_ext/hash/keys.rb
|
||||
action_controller/support/core_ext/hash.rb
|
||||
action_controller/support/core_ext/object_and_class.rb
|
||||
action_controller/support/core_ext/numeric/bytes.rb
|
||||
action_controller/support/core_ext/numeric/time.rb
|
||||
action_controller/support/core_ext/numeric.rb
|
||||
action_controller/support/core_ext/string/inflections.rb
|
||||
action_controller/support/core_ext/string.rb
|
||||
active_record/support/core_ext.rb
|
||||
action_controller/support/inflector.rb
|
||||
action_controller/support/binding_of_caller.rb
|
||||
action_controller/support/breakpoint.rb
|
||||
action_controller/support/dependencies.rb
|
||||
action_controller/support/misc.rb
|
||||
action_controller/support/module_attribute_accessors.rb
|
||||
action_controller/templates/rescues/_request_and_response.rhtml
|
||||
action_controller/templates/rescues/diagnostics.rhtml
|
||||
action_controller/templates/rescues/layout.rhtml
|
||||
|
|
|
@ -23,10 +23,20 @@
|
|||
|
||||
$:.unshift(File.dirname(__FILE__))
|
||||
|
||||
require 'action_controller/support/core_ext'
|
||||
require 'action_controller/support/clean_logger'
|
||||
require 'action_controller/support/misc'
|
||||
require 'action_controller/support/dependencies'
|
||||
begin
|
||||
require 'active_support/core_ext'
|
||||
require 'active_support/clean_logger'
|
||||
require 'active_support/misc'
|
||||
require 'active_support/dependencies'
|
||||
rescue LoadError
|
||||
require 'rubygems'
|
||||
require_gem 'activesupport'
|
||||
|
||||
require 'active_support/core_ext'
|
||||
require 'active_support/clean_logger'
|
||||
require 'active_support/misc'
|
||||
require 'active_support/dependencies'
|
||||
end
|
||||
|
||||
require 'action_controller/base'
|
||||
require 'action_controller/rescue'
|
||||
|
|
|
@ -2,9 +2,9 @@ require 'action_controller/request'
|
|||
require 'action_controller/response'
|
||||
require 'action_controller/routing'
|
||||
require 'action_controller/url_rewriter'
|
||||
require 'action_controller/support/class_attribute_accessors'
|
||||
require 'action_controller/support/class_inheritable_attributes'
|
||||
require 'action_controller/support/inflector'
|
||||
require 'active_support/class_attribute_accessors'
|
||||
require 'active_support/class_inheritable_attributes'
|
||||
require 'active_support/inflector'
|
||||
require 'drb'
|
||||
|
||||
module ActionController #:nodoc:
|
||||
|
|
|
@ -110,6 +110,9 @@ spec = Gem::Specification.new do |s|
|
|||
dist_dirs.each do |dir|
|
||||
s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
|
||||
end
|
||||
|
||||
s.add_dependency('activesupport', '>= 1.0.0')
|
||||
|
||||
s.files.delete "test/fixtures/fixture_database.sqlite"
|
||||
s.files.delete "test/fixtures/fixture_database_2.sqlite"
|
||||
s.files.delete "test/fixtures/fixture_database.sqlite3"
|
||||
|
|
|
@ -18,7 +18,7 @@ unless $sitedir
|
|||
end
|
||||
end
|
||||
|
||||
makedirs = %w{ active_record/associations active_record/connection_adapters active_record/support active_record/vendor active_record/acts active_record/support/core_ext active_record/support/core_ext/hash active_record/support/core_ext/numeric active_record/support/core_ext/string }
|
||||
makedirs = %w{ active_record/associations active_record/connection_adapters active_record/support active_record/vendor active_record/acts }
|
||||
makedirs.each {|f| File::makedirs(File.join($sitedir, *f.split(/\//)))}
|
||||
|
||||
# deprecated files that should be removed
|
||||
|
@ -48,21 +48,6 @@ files = %w-
|
|||
active_record/reflection.rb
|
||||
active_record/acts/list.rb
|
||||
active_record/acts/tree.rb
|
||||
active_record/support/class_attribute_accessors.rb
|
||||
active_record/support/class_inheritable_attributes.rb
|
||||
active_record/support/clean_logger.rb
|
||||
active_record/support/core_ext/hash/keys.rb
|
||||
active_record/support/core_ext/hash.rb
|
||||
active_record/support/core_ext/object_and_class.rb
|
||||
active_record/support/core_ext/numeric/bytes.rb
|
||||
active_record/support/core_ext/numeric/time.rb
|
||||
active_record/support/core_ext/numeric.rb
|
||||
active_record/support/core_ext/string/inflections.rb
|
||||
active_record/support/core_ext/string.rb
|
||||
active_record/support/core_ext.rb
|
||||
active_record/support/inflector.rb
|
||||
active_record/support/misc.rb
|
||||
active_record/support/module_attribute_accessors.rb
|
||||
active_record/timestamp.rb
|
||||
active_record/transactions.rb
|
||||
active_record/validations.rb
|
||||
|
|
|
@ -24,10 +24,20 @@
|
|||
|
||||
$:.unshift(File.dirname(__FILE__))
|
||||
|
||||
require 'active_record/support/core_ext'
|
||||
require 'active_record/support/clean_logger'
|
||||
require 'active_record/support/misc'
|
||||
require 'active_record/support/dependencies'
|
||||
begin
|
||||
require 'active_support/core_ext'
|
||||
require 'active_support/clean_logger'
|
||||
require 'active_support/misc'
|
||||
require 'active_support/dependencies'
|
||||
rescue LoadError
|
||||
require 'rubygems'
|
||||
require_gem 'activesupport'
|
||||
|
||||
require 'active_support/core_ext'
|
||||
require 'active_support/clean_logger'
|
||||
require 'active_support/misc'
|
||||
require 'active_support/dependencies'
|
||||
end
|
||||
|
||||
require 'active_record/base'
|
||||
require 'active_record/observer'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'active_record/support/class_attribute_accessors'
|
||||
require 'active_record/support/class_inheritable_attributes'
|
||||
require 'active_record/support/inflector'
|
||||
require 'active_support/class_attribute_accessors'
|
||||
require 'active_support/class_inheritable_attributes'
|
||||
require 'active_support/inflector'
|
||||
require 'yaml'
|
||||
|
||||
module ActiveRecord #:nodoc:
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
require 'erb'
|
||||
require 'yaml'
|
||||
require 'csv'
|
||||
require 'active_record/support/class_inheritable_attributes'
|
||||
require 'active_record/support/inflector'
|
||||
require 'active_support/class_inheritable_attributes'
|
||||
require 'active_support/inflector'
|
||||
|
||||
# Fixtures are a way of organizing data that you want to test against; in short, sample data. They come in 3 flavours:
|
||||
#
|
||||
|
|
|
@ -3,8 +3,8 @@ $:.unshift(File.dirname(__FILE__) + '/../lib')
|
|||
require 'test/unit'
|
||||
require 'active_record'
|
||||
require 'active_record/fixtures'
|
||||
require 'active_record/support/binding_of_caller'
|
||||
require 'active_record/support/breakpoint'
|
||||
require 'active_support/binding_of_caller'
|
||||
require 'active_support/breakpoint'
|
||||
require 'connection'
|
||||
|
||||
class Test::Unit::TestCase #:nodoc:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
||||
|
||||
require 'test/unit'
|
||||
require 'active_record/support/class_inheritable_attributes'
|
||||
require 'active_support/class_inheritable_attributes'
|
||||
|
||||
class A
|
||||
include ClassInheritableAttributes
|
||||
|
|
|
@ -1,6 +1,45 @@
|
|||
require 'rake/testtask'
|
||||
require 'rake/gempackagetask'
|
||||
require 'rake/contrib/rubyforgepublisher'
|
||||
|
||||
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
|
||||
PKG_NAME = 'activesupport'
|
||||
PKG_VERSION = '1.0.0' + PKG_BUILD
|
||||
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
||||
|
||||
task :default => :test
|
||||
Rake::TestTask.new { |t|
|
||||
t.pattern = 'test/**/*_test.rb'
|
||||
}
|
||||
|
||||
# Create compressed packages
|
||||
dist_dirs = [ "lib", "test"]
|
||||
|
||||
spec = Gem::Specification.new do |s|
|
||||
s.name = PKG_NAME
|
||||
s.version = PKG_VERSION
|
||||
s.summary = "Support and utility classes."
|
||||
s.description = %q{Utility library which carries commonly used classes and goodies from the rails project}
|
||||
|
||||
s.files = [ "CHANGELOG" ] + Dir.glob( "lib/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
|
||||
s.require_path = 'lib'
|
||||
s.has_rdoc = true
|
||||
|
||||
s.author = "David Heinemeier Hansson"
|
||||
s.email = "david@loudthinking.com"
|
||||
s.homepage = "http://www.rubyonrails.com"
|
||||
s.rubyforge_project = "activesupport"
|
||||
end
|
||||
|
||||
Rake::GemPackageTask.new(spec) do |p|
|
||||
p.gem_spec = spec
|
||||
p.need_tar = true
|
||||
p.need_zip = true
|
||||
end
|
||||
|
||||
# Publish beta gem
|
||||
desc "Publish the beta gem"
|
||||
task :pgem => [:package] do
|
||||
Rake::SshFilePublisher.new("davidhh@comox.textdrive.com", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
|
||||
`ssh davidhh@comox.textdrive.com './gemupdate.sh'`
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'test/unit'
|
||||
require File.dirname(__FILE__) + '/../lib/class_inheritable_attributes'
|
||||
require File.dirname(__FILE__) + '/../lib/active_support/class_inheritable_attributes'
|
||||
|
||||
class ClassInheritableAttributesTest < Test::Unit::TestCase
|
||||
def setup
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'test/unit'
|
||||
require File.dirname(__FILE__) + '/../../lib/core_ext/hash'
|
||||
require File.dirname(__FILE__) + '/../../lib/active_support/core_ext/hash'
|
||||
|
||||
class HashExtTest < Test::Unit::TestCase
|
||||
def setup
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'test/unit'
|
||||
require File.dirname(__FILE__) + '/../../lib/core_ext/numeric'
|
||||
require File.dirname(__FILE__) + '/../../lib/active_support/core_ext/numeric'
|
||||
|
||||
class NumericExtTimeTest < Test::Unit::TestCase
|
||||
def setup
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
require 'test/unit'
|
||||
require File.dirname(__FILE__) + '/../../lib/core_ext/object_and_class'
|
||||
require File.dirname(__FILE__) + '/../../lib/active_support/core_ext/object_and_class'
|
||||
|
||||
class A; end
|
||||
class B < A; end
|
||||
class C < B; end
|
||||
class D < A; end
|
||||
class ClassA; end
|
||||
class ClassB < ClassA; end
|
||||
class ClassC < ClassB; end
|
||||
class ClassD < ClassA; end
|
||||
|
||||
class ClassExtTest < Test::Unit::TestCase
|
||||
def test_methods
|
||||
assert defined?(B)
|
||||
assert defined?(C)
|
||||
assert defined?(D)
|
||||
assert defined?(ClassB)
|
||||
assert defined?(ClassC)
|
||||
assert defined?(ClassD)
|
||||
|
||||
A.remove_subclasses
|
||||
ClassA.remove_subclasses
|
||||
|
||||
assert !defined?(B)
|
||||
assert !defined?(C)
|
||||
assert !defined?(D)
|
||||
assert !defined?(ClassB)
|
||||
assert !defined?(ClassC)
|
||||
assert !defined?(ClassD)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test/unit'
|
||||
require File.dirname(__FILE__) + '/../../lib/core_ext/string'
|
||||
require File.dirname(__FILE__) + '/../../lib/misc'
|
||||
require File.dirname(__FILE__) + '/../../lib/active_support/core_ext/string'
|
||||
require File.dirname(__FILE__) + '/../../lib/active_support/misc'
|
||||
|
||||
silence_warnings do
|
||||
require File.dirname(__FILE__) + '/../inflector_test'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'test/unit'
|
||||
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
|
||||
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib/active_support/'
|
||||
require 'misc'
|
||||
require 'dependencies'
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'test/unit'
|
||||
require File.dirname(__FILE__) + '/../lib/inflector'
|
||||
require File.dirname(__FILE__) + '/../lib/active_support/inflector'
|
||||
|
||||
module Ace
|
||||
module Base
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'test/unit'
|
||||
require File.dirname(__FILE__) + '/../lib/misc'
|
||||
require File.dirname(__FILE__) + '/../lib/active_support/misc'
|
||||
|
||||
class MiscTest < Test::Unit::TestCase
|
||||
def test_silence_warnings
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
build_number = `svn log -q -rhead http://dev.rubyonrails.org/svn/rails`.scan(/r([0-9]*)/).first.first.to_i
|
||||
|
||||
(%w( actionmailer actionpack activerecord railties ) - ARGV).each do |pkg|
|
||||
(%w( actionmailer actionpack activerecord railties activesupport) - ARGV).each do |pkg|
|
||||
puts "Pushing: #{pkg} (#{build_number})"
|
||||
`cd #{pkg} && PKG_BUILD=#{build_number} rake pgem && cd ..`
|
||||
end
|
|
@ -41,6 +41,9 @@ task :fresh_rails_without_docs => [ :clean, :make_dir_structure, :initialize_fil
|
|||
desc "Generates a fresh Rails package without documentation (faster)"
|
||||
task :fresh_rails_without_docs_using_links => [ :clean, :make_dir_structure, :initialize_file_stubs, :link_vendor_libraries, :copy_ties_content ]
|
||||
|
||||
desc "Generates minimal Rails package using symlinks"
|
||||
task :dev => [ :clean, :make_dir_structure, :initialize_file_stubs, :link_vendor_libraries, :copy_ties_content ]
|
||||
|
||||
desc "Packages the fresh Rails package with documentation"
|
||||
task :package => [ :clean, :fresh_rails ] do
|
||||
system %{cd ..; tar -czvf #{PKG_NAME}-#{PKG_VERSION}.tgz #{PKG_NAME}}
|
||||
|
|
|
@ -19,6 +19,7 @@ ADDITIONAL_LOAD_PATHS.concat %w(
|
|||
vendor
|
||||
vendor/railties
|
||||
vendor/railties/lib
|
||||
vendor/activesupport/lib
|
||||
vendor/activerecord/lib
|
||||
vendor/actionpack/lib
|
||||
vendor/actionmailer/lib
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
|
||||
$:.unshift(File.dirname(__FILE__))
|
||||
|
||||
require 'support/core_ext'
|
||||
require 'active_support/core_ext'
|
||||
|
||||
|
||||
require 'rails_generator/base'
|
||||
require 'rails_generator/lookup'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.dirname(__FILE__) + '/../support/class_attribute_accessors'
|
||||
require File.dirname(__FILE__) + '/../support/inflector'
|
||||
require 'active_support/class_attribute_accessors'
|
||||
require 'active_support/inflector'
|
||||
require File.dirname(__FILE__) + '/options'
|
||||
require File.dirname(__FILE__) + '/manifest'
|
||||
require File.dirname(__FILE__) + '/spec'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'optparse'
|
||||
require File.dirname(__FILE__) + '/../support/class_inheritable_attributes'
|
||||
require 'active_support/class_inheritable_attributes'
|
||||
|
||||
module Rails
|
||||
module Generator
|
||||
|
|
Loading…
Reference in a new issue