1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Load generators from both lib/rails/generators and lib/generators. Using the former since it's less obstrusive.

This commit is contained in:
José Valim 2010-03-23 13:40:19 +01:00
parent b144b56d82
commit b61f6f5980
171 changed files with 46 additions and 46 deletions

View file

@ -1,4 +1,4 @@
require 'generators/active_record'
require 'rails/generators/active_record'
module ActiveRecord
module Generators

View file

@ -1,4 +1,4 @@
require 'generators/active_record'
require 'rails/generators/active_record'
module ActiveRecord
module Generators

View file

@ -1,4 +1,4 @@
require 'generators/active_record'
require 'rails/generators/active_record'
module ActiveRecord
module Generators

View file

@ -1,4 +1,4 @@
require 'generators/active_record'
require 'rails/generators/active_record'
module ActiveRecord
module Generators

View file

@ -242,7 +242,7 @@ module Rails
paths = namespaces_to_paths(namespaces)
paths.each do |raw_path|
["rails_generators", "generators"].each do |base|
["rails/generators", "generators"].each do |base|
path = "#{base}/#{raw_path}_generator"
begin
@ -265,7 +265,7 @@ module Rails
load_generators_from_railties!
$LOAD_PATH.each do |base|
Dir[File.join(base, "{generators,rails_generators}", "**", "*_generator.rb")].each do |path|
Dir[File.join(base, "{rails/generators,generators}", "**", "*_generator.rb")].each do |path|
begin
require path
rescue Exception => e

View file

@ -25,7 +25,7 @@ module Rails
def self.source_root
@_rails_source_root ||= begin
if base_name && generator_name
File.expand_path(File.join("../../generators", base_name, generator_name, 'templates'), File.dirname(__FILE__))
File.expand_path(File.join(base_name, generator_name, 'templates'), File.dirname(__FILE__))
end
end
end

View file

@ -1,4 +1,4 @@
require 'generators/erb'
require 'rails/generators/erb'
module Erb
module Generators

View file

@ -1,4 +1,4 @@
require 'generators/erb/controller/controller_generator'
require 'rails/generators/erb/controller/controller_generator'
module Erb
module Generators

View file

@ -1,4 +1,4 @@
require 'generators/erb'
require 'rails/generators/erb'
require 'rails/generators/resource_helpers'
module Erb

View file

@ -5,7 +5,7 @@ require 'rails/version' unless defined?(Rails::VERSION)
module Rails::Generators
# We need to store the RAILS_DEV_PATH in a constant, otherwise the path
# can change in Ruby 1.8.7 when we FileUtils.cd.
RAILS_DEV_PATH = File.expand_path("../../../../..", File.dirname(__FILE__))
RAILS_DEV_PATH = File.expand_path("../../../../../..", File.dirname(__FILE__))
RESERVED_NAMES = %w[generate console server dbconsole
application destroy benchmarker profiler

View file

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Some files were not shown because too many files have changed in this diff Show more