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 ActiveRecord
module Generators module Generators

View file

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

View file

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

View file

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

View file

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

View file

@ -25,7 +25,7 @@ module Rails
def self.source_root def self.source_root
@_rails_source_root ||= begin @_rails_source_root ||= begin
if base_name && generator_name 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 end
end end

View file

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

View file

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

View file

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

View file

@ -5,7 +5,7 @@ require 'rails/version' unless defined?(Rails::VERSION)
module Rails::Generators module Rails::Generators
# We need to store the RAILS_DEV_PATH in a constant, otherwise the path # 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. # 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 RESERVED_NAMES = %w[generate console server dbconsole
application destroy benchmarker profiler 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