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

Refactor generators a little bit.

Signed-off-by: Yehuda Katz <wycats@mobile-166-129-219-135.mycingular.net>
This commit is contained in:
José Valim 2009-11-06 23:40:18 -02:00 committed by Yehuda Katz
parent 216e8c6bfa
commit 51fe6d05e7
13 changed files with 10 additions and 16 deletions

View file

@ -1,3 +1,6 @@
require 'rails/generators'
Rails::Generators.configure!
if ARGV.size == 0
Rails::Generators.help
exit

View file

@ -1,3 +1,6 @@
require 'rails/generators'
Rails::Generators.configure!
if ARGV.size == 0
Rails::Generators.help
exit

View file

@ -123,8 +123,10 @@ module Rails::Generators
end
def create_script_files
directory "script"
chmod "script", 0755, :verbose => false
directory "script" do |file|
prepend_file file, "#{shebang}\n", :verbose => false
chmod file, 0755, :verbose => false
end
end
def create_test_files

View file

@ -1,4 +1,3 @@
<%= shebang %>
require File.expand_path('../../config/environment', __FILE__)
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
require 'rails/commands/about'

View file

@ -1,3 +1,2 @@
<%= shebang %>
require File.expand_path('../../config/application', __FILE__)
require 'rails/commands/console'

View file

@ -1,3 +1,2 @@
<%= shebang %>
require File.expand_path('../../config/application', __FILE__)
require 'rails/commands/dbconsole'

View file

@ -1,5 +1,2 @@
<%= shebang %>
require File.expand_path('../../config/environment', __FILE__)
require 'rails/generators'
Rails::Generators.configure!
require 'rails/commands/destroy'

View file

@ -1,5 +1,2 @@
<%= shebang %>
require File.expand_path('../../config/environment', __FILE__)
require 'rails/generators'
Rails::Generators.configure!
require 'rails/commands/generate'

View file

@ -1,3 +1,2 @@
<%= shebang %>
require File.expand_path('../../../config/environment', __FILE__)
require 'rails/commands/performance/benchmarker'

View file

@ -1,3 +1,2 @@
<%= shebang %>
require File.expand_path('../../../config/environment', __FILE__)
require 'rails/commands/performance/profiler'

View file

@ -1,3 +1,2 @@
<%= shebang %>
require File.expand_path('../../config/application', __FILE__)
require 'rails/commands/plugin'

View file

@ -1,3 +1,2 @@
<%= shebang %>
require File.expand_path('../../config/environment', __FILE__)
require 'rails/commands/runner'

View file

@ -1,3 +1,2 @@
<%= shebang %>
require File.expand_path('../../config/application', __FILE__)
require 'rails/commands/server'