Refactor generators a little bit.
Signed-off-by: Yehuda Katz <wycats@mobile-166-129-219-135.mycingular.net>
This commit is contained in:
parent
216e8c6bfa
commit
51fe6d05e7
@ -1,3 +1,6 @@
|
||||
require 'rails/generators'
|
||||
Rails::Generators.configure!
|
||||
|
||||
if ARGV.size == 0
|
||||
Rails::Generators.help
|
||||
exit
|
||||
|
@ -1,3 +1,6 @@
|
||||
require 'rails/generators'
|
||||
Rails::Generators.configure!
|
||||
|
||||
if ARGV.size == 0
|
||||
Rails::Generators.help
|
||||
exit
|
||||
|
@ -123,8 +123,10 @@ def create_prototype_files
|
||||
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
|
||||
|
@ -1,4 +1,3 @@
|
||||
<%= shebang %>
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
|
||||
require 'rails/commands/about'
|
@ -1,3 +1,2 @@
|
||||
<%= shebang %>
|
||||
require File.expand_path('../../config/application', __FILE__)
|
||||
require 'rails/commands/console'
|
@ -1,3 +1,2 @@
|
||||
<%= shebang %>
|
||||
require File.expand_path('../../config/application', __FILE__)
|
||||
require 'rails/commands/dbconsole'
|
@ -1,5 +1,2 @@
|
||||
<%= shebang %>
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
require 'rails/generators'
|
||||
Rails::Generators.configure!
|
||||
require 'rails/commands/destroy'
|
@ -1,5 +1,2 @@
|
||||
<%= shebang %>
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
require 'rails/generators'
|
||||
Rails::Generators.configure!
|
||||
require 'rails/commands/generate'
|
@ -1,3 +1,2 @@
|
||||
<%= shebang %>
|
||||
require File.expand_path('../../../config/environment', __FILE__)
|
||||
require 'rails/commands/performance/benchmarker'
|
@ -1,3 +1,2 @@
|
||||
<%= shebang %>
|
||||
require File.expand_path('../../../config/environment', __FILE__)
|
||||
require 'rails/commands/performance/profiler'
|
@ -1,3 +1,2 @@
|
||||
<%= shebang %>
|
||||
require File.expand_path('../../config/application', __FILE__)
|
||||
require 'rails/commands/plugin'
|
@ -1,3 +1,2 @@
|
||||
<%= shebang %>
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
require 'rails/commands/runner'
|
@ -1,3 +1,2 @@
|
||||
<%= shebang %>
|
||||
require File.expand_path('../../config/application', __FILE__)
|
||||
require 'rails/commands/server'
|
Loading…
Reference in New Issue
Block a user