diff options
author | José Valim <jose.valim@gmail.com> | 2009-06-23 14:42:59 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-06-23 16:53:47 +0200 |
commit | 1845675822fef4ead89b8919da56c4fadb145e56 (patch) | |
tree | b536919097f2d52fcdc6502d39018bc38f0af58e /railties/bin | |
parent | f03890e151d7a8b9cc413ea9955efc95ff4fbfe6 (diff) | |
download | rails-1845675822fef4ead89b8919da56c4fadb145e56.tar.gz rails-1845675822fef4ead89b8919da56c4fadb145e56.tar.bz2 rails-1845675822fef4ead89b8919da56c4fadb145e56.zip |
Added metal generator.
Diffstat (limited to 'railties/bin')
-rwxr-xr-x | railties/bin/gen | 27 | ||||
-rwxr-xr-x | railties/bin/rails | 2 |
2 files changed, 28 insertions, 1 deletions
diff --git a/railties/bin/gen b/railties/bin/gen new file mode 100755 index 0000000000..0567ab6058 --- /dev/null +++ b/railties/bin/gen @@ -0,0 +1,27 @@ +require File.dirname(__FILE__) + '/../lib/ruby_version_check' +Signal.trap("INT") { puts; exit } + +require File.dirname(__FILE__) + '/../lib/rails/version' +if %w(--version -v).include? ARGV.first + puts "Rails #{Rails::VERSION::STRING}" + exit(0) +end + +if ARGV.size == 0 + puts "Please select a generator. Options: foo, bar" + return +else ARGV.size == 1 + ARGV << "--help" +end + +Dir[File.dirname(__FILE__) + '/../lib/generator/generators/*/*_generator.rb'].each do |file| + require file +end + +name = ARGV.shift + +if klass = Thor::Util.find_by_namespace("rails:generators:#{name}") + klass.start +else + puts "Could not find generator #{name}." +end diff --git a/railties/bin/rails b/railties/bin/rails index e13118500a..4d08ca392d 100755 --- a/railties/bin/rails +++ b/railties/bin/rails @@ -10,4 +10,4 @@ end ARGV << "--help" if ARGV.empty? require File.dirname(__FILE__) + '/../lib/generator/generators/app/app_generator' -Rails::Generators::App.start +Rails::Generators::AppGenerator.start |