mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
bin/rails uses the new generator.
This commit is contained in:
@@ -7,14 +7,5 @@ if %w(--version -v).include? ARGV.first
|
||||
exit(0)
|
||||
end
|
||||
|
||||
freeze = ARGV.any? { |option| %w(--freeze -f).include?(option) }
|
||||
|
||||
app_path = ARGV.first
|
||||
|
||||
require File.dirname(__FILE__) + '/../lib/rails_generator'
|
||||
|
||||
require 'rails_generator/scripts/generate'
|
||||
Rails::Generator::Base.use_application_sources!
|
||||
Rails::Generator::Scripts::Generate.new.run(ARGV, :generator => 'app')
|
||||
|
||||
Dir.chdir(app_path) { `rake rails:freeze:gems`; puts "froze" } if freeze
|
||||
require File.dirname(__FILE__) + '/../lib/generator/generators/app'
|
||||
Rails::Generators::App.start
|
||||
|
||||
@@ -27,7 +27,7 @@ module Rails
|
||||
klass_name.gsub!(/^Rails::Generators::/, '')
|
||||
klass_name.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
|
||||
klass_name.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
|
||||
File.join(File.dirname(__FILE__), 'templates', klass_name.downcase)
|
||||
File.expand_path(File.join(File.dirname(__FILE__), 'templates', klass_name.downcase))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ require File.dirname(__FILE__) + '/../base'
|
||||
require 'rbconfig'
|
||||
require 'digest/md5'
|
||||
require 'active_support/secure_random'
|
||||
require 'rails/version'
|
||||
|
||||
module Rails::Generators
|
||||
class App < Base
|
||||
@@ -48,7 +47,9 @@ module Rails::Generators
|
||||
self.root = File.expand_path(app_path, root)
|
||||
empty_directory '.'
|
||||
|
||||
app_name # Sets the app name
|
||||
app_name # Sets the app name
|
||||
source_root # Sets the source root
|
||||
|
||||
FileUtils.cd(root)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user