Permalink
Browse files

Moved Active Support into its own gem

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@624 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 45caae4 commit dc3d6eb9b4aaed051dd6d5a5a07f6c66b72da4c4 @dhh dhh committed Feb 15, 2005
Showing with 118 additions and 82 deletions.
  1. +4 −1 actionpack/Rakefile
  2. +1 −20 actionpack/install.rb
  3. +14 −4 actionpack/lib/action_controller.rb
  4. +3 −3 actionpack/lib/action_controller/base.rb
  5. +3 −0 activerecord/Rakefile
  6. +1 −16 activerecord/install.rb
  7. +14 −4 activerecord/lib/active_record.rb
  8. +3 −3 activerecord/lib/active_record/base.rb
  9. +2 −2 activerecord/lib/active_record/fixtures.rb
  10. +2 −2 activerecord/test/abstract_unit.rb
  11. +1 −1 activerecord/test/class_inheritable_attributes_test.rb
  12. +39 −0 activesupport/Rakefile
  13. 0 activesupport/lib/{ → active_support}/binding_of_caller.rb
  14. 0 activesupport/lib/{ → active_support}/breakpoint.rb
  15. 0 activesupport/lib/{ → active_support}/class_attribute_accessors.rb
  16. 0 activesupport/lib/{ → active_support}/class_inheritable_attributes.rb
  17. 0 activesupport/lib/{ → active_support}/clean_logger.rb
  18. 0 activesupport/lib/{ → active_support}/core_ext.rb
  19. 0 activesupport/lib/{ → active_support}/core_ext/hash.rb
  20. 0 activesupport/lib/{ → active_support}/core_ext/hash/indifferent_access.rb
  21. 0 activesupport/lib/{ → active_support}/core_ext/hash/keys.rb
  22. 0 activesupport/lib/{ → active_support}/core_ext/numeric.rb
  23. 0 activesupport/lib/{ → active_support}/core_ext/numeric/bytes.rb
  24. 0 activesupport/lib/{ → active_support}/core_ext/numeric/time.rb
  25. 0 activesupport/lib/{ → active_support}/core_ext/object_and_class.rb
  26. 0 activesupport/lib/{ → active_support}/core_ext/string.rb
  27. 0 activesupport/lib/{ → active_support}/core_ext/string/inflections.rb
  28. 0 activesupport/lib/{ → active_support}/dependencies.rb
  29. 0 activesupport/lib/{ → active_support}/inflector.rb
  30. 0 activesupport/lib/{ → active_support}/misc.rb
  31. 0 activesupport/lib/{ → active_support}/module_attribute_accessors.rb
  32. +1 −1 activesupport/test/class_inheritable_attributes_test.rb
  33. +1 −1 activesupport/test/core_ext/hash_ext_test.rb
  34. +1 −1 activesupport/test/core_ext/numeric_ext_test.rb
  35. +12 −12 activesupport/test/core_ext/object_and_class_ext_test.rb
  36. +2 −2 activesupport/test/core_ext/string_ext_test.rb
  37. +1 −1 activesupport/test/dependencies_test.rb
  38. +1 −1 activesupport/test/inflector_test.rb
  39. +1 −1 activesupport/test/misc_test.rb
  40. +2 −2 pushgems.rb
  41. +3 −0 railties/Rakefile
  42. +1 −0 railties/environments/shared.rb
  43. +2 −1 railties/lib/rails_generator.rb
  44. +2 −2 railties/lib/rails_generator/base.rb
  45. +1 −1 railties/lib/rails_generator/options.rb
View
@@ -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'
View
@@ -19,8 +19,7 @@
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 @@
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/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 @@
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 @@
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 @@
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
View
@@ -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
+end
View
@@ -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 @@
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

0 comments on commit dc3d6eb

Please sign in to comment.