From 8ea90ffdb8a08438e72054518f8f0b54c628b3ea Mon Sep 17 00:00:00 2001 From: Stefan Sprenger Date: Tue, 7 Jun 2011 11:36:11 +0200 Subject: Use mattr_accessor :namespace --- railties/lib/rails/generators.rb | 12 ++---------- railties/test/railties/generators_test.rb | 3 --- 2 files changed, 2 insertions(+), 13 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb index 508d5359ba..355b05ce0b 100644 --- a/railties/lib/rails/generators.rb +++ b/railties/lib/rails/generators.rb @@ -20,6 +20,8 @@ module Rails autoload :ResourceHelpers, 'rails/generators/resource_helpers' autoload :TestCase, 'rails/generators/test_case' + mattr_accessor :namespace + DEFAULT_ALIASES = { :rails => { :actions => '-a', @@ -90,16 +92,6 @@ module Rails @options ||= DEFAULT_OPTIONS.dup end - def self.namespace - @namespace ||= if defined?(Rails) && Rails.application - Rails.application.class.parents.detect { |n| n.respond_to?(:_railtie) } - end - end - - def self.namespace=(namespace) - @namespace ||= namespace - end - # Hold configured generators fallbacks. If a plugin developer wants a # generator group to fallback to another group in case of missing generators, # they can add a fallback. diff --git a/railties/test/railties/generators_test.rb b/railties/test/railties/generators_test.rb index 4f96e4d9ef..963518880d 100644 --- a/railties/test/railties/generators_test.rb +++ b/railties/test/railties/generators_test.rb @@ -58,9 +58,6 @@ module RailtiesTests build_engine(true) end - def setup - end - def test_controllers_are_correctly_namespaced_when_engine_is_mountable build_mountable_engine Dir.chdir(engine_path) do -- cgit v1.2.3