Permalink
Browse files

r3023@asus: jeremy | 2005-07-12 23:43:39 -0700

 Remove superfluous inherited override in Dependencies.
 r3024@asus:  jeremy | 2005-07-12 23:54:28 -0700
 Make test the default railties rake target.
 r3025@asus:  jeremy | 2005-07-12 23:55:27 -0700
 Encapsulate dispatch call in dispatcher test.
 r3026@asus:  jeremy | 2005-07-12 23:56:14 -0700
 Expand dispatcher mock to match full method signature for process.
 r3027@asus:  jeremy | 2005-07-12 23:57:24 -0700
 Look for app-specific generators in RAILS_ROOT/generators instead of RAILS_ROOT/script/generators.
 r3028@asus:  jeremy | 2005-07-13 00:00:47 -0700
 Update changelog.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1819 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent cb0f8fd commit f29ce1f35670866cb86faedeabb28a33215a143f @jeremy jeremy committed Jul 13, 2005
@@ -2,7 +2,6 @@ module ActionController #:nodoc:
module Dependencies #:nodoc:
def self.append_features(base)
super
- base.class_eval { class << self; alias_method :inherited_without_model, :inherited; end }
base.extend(ClassMethods)
end
@@ -79,10 +78,6 @@ def require_dependencies(layer, dependencies)
end
end
end
-
- def inherited(child)
- inherited_without_model(child)
- end
end
end
end
View
@@ -1,5 +1,7 @@
*0.13.1* (11 July, 2005)
+* Look for app-specific generators in RAILS_ROOT/generators rather than the clunky old RAILS_ROOT/script/generators. Nobody really uses this feature except for the unit tests, so it's a negligible-impact change. If you want to work with third-party generators, drop them in ~/.rails/generators or simply install gems.
+
* Fixed that each request with the WEBrick adapter would open a new database connection #1685 [Sam Stephenson]
* Added support for SQL Server in the database rake tasks #1652 [ken.barker@gmail.com] Note: osql and scptxfr may need to be installed on your development environment. This involves getting the .exes and a .rll (scptxfr) from a production SQL Server (not developer level SQL Server). Add their location to your Environment PATH and you are all set.
View
@@ -19,6 +19,16 @@ RUBY_FORGE_PROJECT = "rails"
RUBY_FORGE_USER = "webster132"
+desc "Default Task"
+task :default => :test
+
+Rake::TestTask.new do |t|
+ t.libs << 'test'
+ t.pattern = 'test/*_test.rb'
+ t.verbose = true
+end
+
+
BASE_DIRS = %w( app config/environments components db doc log lib public script test vendor )
APP_DIRS = %w( apis models controllers helpers views views/layouts )
PUBLIC_DIRS = %w( images javascripts stylesheets )
@@ -31,9 +41,6 @@ BIN_FILES = %w( generate destroy breakpointer console server update runner pr
VENDOR_LIBS = %w( actionpack activerecord actionmailer activesupport actionwebservice railties )
-desc "Default Task"
-task :default => [ :fresh_rails ]
-
desc "Generates a fresh Rails package with documentation"
task :fresh_rails => [ :clean, :make_dir_structure, :initialize_file_stubs, :copy_vendor_libraries, :copy_ties_content, :generate_documentation ]
@@ -4,7 +4,7 @@ class Object
class << self
# Lookup missing generators using const_missing. This allows any
# generator to reference another without having to know its location:
- # RubyGems, ~/.rails/generators, and RAILS_ROOT/script/generators.
+ # RubyGems, ~/.rails/generators, and RAILS_ROOT/generators.
def lookup_missing_generator(class_id)
if md = /(.+)Generator$/.match(class_id.to_s)
name = md.captures.first.demodulize.underscore
@@ -92,13 +92,13 @@ def use_application_sources!
# Use component generators (model, controller, etc).
# 1. Rails application. If RAILS_ROOT is defined we know we're
# generating in the context of a Rails application, so search
- # RAILS_ROOT/script/generators.
+ # RAILS_ROOT/generators.
# 2. User home directory. Search ~/.rails/generators.
# 3. RubyGems. Search for gems named *_generator.
# 4. Builtins. Model, controller, mailer, scaffold.
def use_component_sources!
reset_sources
- sources << PathSource.new(:app, "#{::RAILS_ROOT}/script/generators") if defined? ::RAILS_ROOT
+ sources << PathSource.new(:app, "#{::RAILS_ROOT}/generators") if defined? ::RAILS_ROOT
sources << PathSource.new(:user, "#{Dir.user_home}/.rails/generators")
sources << GemSource.new if Object.const_defined?(:Gem)
sources << PathSource.new(:builtin, "#{File.dirname(__FILE__)}/generators/components")
@@ -35,7 +35,7 @@ def teardown
def test_ac_subclasses_cleared_on_reset
Object.class_eval(ACTION_CONTROLLER_DEF)
assert_equal 1, ActionController::Base.subclasses.length
- Dispatcher.dispatch(CGI.new, ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, @output)
+ dispatch
GC.start # force the subclass to be collected
assert_equal 0, ActionController::Base.subclasses.length
@@ -44,13 +44,16 @@ def test_ac_subclasses_cleared_on_reset
def test_am_subclasses_cleared_on_reset
Object.class_eval(ACTION_MAILER_DEF)
assert_equal 1, ActionMailer::Base.subclasses.length
- Dispatcher.dispatch(CGI.new, ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, @output)
+ dispatch
GC.start # force the subclass to be collected
assert_equal 0, ActionMailer::Base.subclasses.length
end
private
+ def dispatch
+ Dispatcher.dispatch(CGI.new, ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, @output)
+ end
def setup_minimal_environment
value = Dependencies::LoadingModule.root
@@ -4,7 +4,7 @@ class <<self
attr_accessor :raise_exception
attr_accessor :dispatch_hook
- def dispatch(cgi)
+ def dispatch(cgi, session_options = nil, output = $stdout)
dispatch_hook.call(cgi) if dispatch_hook
sleep(time_to_sleep || 0)
raise raise_exception, "Something died" if raise_exception
@@ -44,7 +44,7 @@ def test_autolookup
end
def test_lookup_missing_generator
- assert_raise(LoadError) {
+ assert_raise(MissingSourceFile) {
Rails::Generator::Base.lookup('missing_generator').klass
}
end
@@ -68,7 +68,7 @@ def test_generator_usage
def test_generator_spec
spec = Rails::Generator::Base.lookup('working')
assert_equal 'working', spec.name
- assert_equal "#{RAILS_ROOT}/script/generators/working", spec.path
+ assert_equal "#{RAILS_ROOT}/generators/working", spec.path
assert_equal :app, spec.source
assert_nothing_raised { assert_match /WorkingGenerator$/, spec.klass.name }
end

0 comments on commit f29ce1f

Please sign in to comment.