aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/generate
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-05-28 22:04:13 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2016-09-25 21:31:35 +0200
commit6813edc7d926965e5644cd8befaf229a35b9d8ca (patch)
tree05732c004c68475cb6bd5794d87e030096d4d75c /railties/lib/rails/commands/generate
parentb724dbbb8b337d84a3ca8380c9dd75d79a44badf (diff)
downloadrails-6813edc7d926965e5644cd8befaf229a35b9d8ca.tar.gz
rails-6813edc7d926965e5644cd8befaf229a35b9d8ca.tar.bz2
rails-6813edc7d926965e5644cd8befaf229a35b9d8ca.zip
Initial command structure.
Diffstat (limited to 'railties/lib/rails/commands/generate')
-rw-r--r--railties/lib/rails/commands/generate/generate_command.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/railties/lib/rails/commands/generate/generate_command.rb b/railties/lib/rails/commands/generate/generate_command.rb
new file mode 100644
index 0000000000..b381ca85b9
--- /dev/null
+++ b/railties/lib/rails/commands/generate/generate_command.rb
@@ -0,0 +1,21 @@
+require "rails/generators"
+
+module Rails
+ module Command
+ class GenerateCommand < Base
+ def help # :nodoc:
+ Rails::Generators.help self.class.command_name
+ end
+
+ def perform(*)
+ generator = args.shift
+ return help unless generator
+
+ require_application_and_environment!
+ load_generators
+
+ Rails::Generators.invoke generator, args, behavior: :invoke, destination_root: Rails::Command.root
+ end
+ end
+ end
+end