Class: Dubious::CLI::Generator
- Inherits:
-
Thor
- Object
- Thor
- Dubious::CLI::Generator
- Includes:
- Thor::Actions
- Defined in:
- lib/dubious/cli/generator.rb
Instance Method Summary collapse
-
#controller ⇒ Object
(name).
-
#model ⇒ Object
(name).
Instance Method Details
#controller ⇒ Object
(name)
15 16 17 18 19 |
# File 'lib/dubious/cli/generator.rb', line 15 def controller#(name) template "controller.mirah.tt", "app/controllers/#{name.underscore}_controller.mirah" empty_directory "app/views/#{name.underscore}" inject_into_file "WEB-INF/app.yaml", " - url: /#{name.underscore}/*\n servlet: controllers.#{name.classify}Controller\n name: #{name.underscore}\n",:after => "handlers:\n" end |
#model ⇒ Object
(name)
10 11 12 |
# File 'lib/dubious/cli/generator.rb', line 10 def model#(name) template "model.mirah.tt", "app/models/#{name.underscore}.mirah" end |