Class: Dubious::CLI::Generator

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/dubious/cli/generator.rb

Instance Method Summary collapse

Instance Method Details

#controllerObject

(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

#modelObject

(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