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:
parent
b144b56d82
commit
b61f6f5980
171 changed files with 46 additions and 46 deletions
|
@ -1,4 +1,4 @@
|
|||
require 'generators/active_record'
|
||||
require 'rails/generators/active_record'
|
||||
|
||||
module ActiveRecord
|
||||
module Generators
|
|
@ -1,4 +1,4 @@
|
|||
require 'generators/active_record'
|
||||
require 'rails/generators/active_record'
|
||||
|
||||
module ActiveRecord
|
||||
module Generators
|
|
@ -1,4 +1,4 @@
|
|||
require 'generators/active_record'
|
||||
require 'rails/generators/active_record'
|
||||
|
||||
module ActiveRecord
|
||||
module Generators
|
|
@ -1,4 +1,4 @@
|
|||
require 'generators/active_record'
|
||||
require 'rails/generators/active_record'
|
||||
|
||||
module ActiveRecord
|
||||
module Generators
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require 'generators/erb'
|
||||
require 'rails/generators/erb'
|
||||
|
||||
module Erb
|
||||
module Generators
|
|
@ -1,4 +1,4 @@
|
|||
require 'generators/erb/controller/controller_generator'
|
||||
require 'rails/generators/erb/controller/controller_generator'
|
||||
|
||||
module Erb
|
||||
module Generators
|
|
@ -1,4 +1,4 @@
|
|||
require 'generators/erb'
|
||||
require 'rails/generators/erb'
|
||||
require 'rails/generators/resource_helpers'
|
||||
|
||||
module Erb
|
|
@ -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
|
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
Loading…
Reference in a new issue