Class: Jets::Generators::JobGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Jets::Generators::JobGenerator
- Defined in:
- lib/jets/generators/job/job_generator.rb
Overview
:nodoc:
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.banner ⇒ Object
13 14 15 |
# File 'lib/jets/generators/job/job_generator.rb', line 13 def self. "jets generate job #{self.arguments.map(&:usage).join(' ')} [options]" end |
.default_generator_root ⇒ Object
9 10 11 |
# File 'lib/jets/generators/job/job_generator.rb', line 9 def self.default_generator_root __dir__ end |
Instance Method Details
#create_job_file ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/jets/generators/job/job_generator.rb', line 17 def create_job_file template "event_types/#{[:type]}.rb", File.join("app/jobs", class_path, "#{file_name}_job.rb") in_root do if behavior == :invoke && !File.exist?(application_job_file_name) template "application_job.rb", application_job_file_name end end end |