Class: Jets::CLI::Generate::Event
Class Method Summary
collapse
Instance Method Summary
collapse
#class_name, #framework, #init_project_name, #package_type, #underscore_name
#comment_out_line, #config_environment, #environment, #optimize_indentation
Class Method Details
.cli_options ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/jets/cli/generate/event.rb', line 5
def self.cli_options
[
[:force, aliases: :f, type: :boolean, desc: "Bypass overwrite are you sure prompt for existing files"],
[:method, aliases: :m, desc: "Method name", default: "handle"],
[:trigger, aliases: :t, desc: "Event trigger", default: "scheduled"]
]
end
|
Instance Method Details
#application_event ⇒ Object
18
19
20
|
# File 'lib/jets/cli/generate/event.rb', line 18
def application_event
template "application_event.rb", "app/events/application_event.rb", skip: true
end
|
#event ⇒ Object
22
23
24
25
26
27
|
# File 'lib/jets/cli/generate/event.rb', line 22
def event
trigger = options[:trigger]
trigger = "scheduled" if trigger == "schedule" template_path = "#{trigger}.rb.tt"
template template_path, "app/events/#{underscore_name}_event.rb"
end
|