Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 9ef8f082ea
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (20 sloc) 0.819 kb
module Dubious
module CLI
class Generator < Thor
include Thor::Actions
source_root File.dirname(__FILE__)+"/../templates/generator"
argument :name
add_runtime_options!
desc "model NAME", "creates model file"
def model#(name)
template "model.mirah.tt", "app/models/#{name.underscore}.mirah"
end
desc "controller NAME", "creates controller file"
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
end
end
end
Jump to Line
Something went wrong with that request. Please try again.