Class: Xronor::CLI
- Inherits:
-
Thor
- Object
- Thor
- Xronor::CLI
- Defined in:
- lib/xronor/cli.rb
Constant Summary collapse
- DEFAULT_JOB_PREFIX =
"scheduler-"
Instance Method Summary collapse
- #crontab(filename) ⇒ Object
- #cwa(filename) ⇒ Object
- #template(filename) ⇒ Object
- #template_per_job(filename) ⇒ Object
Instance Method Details
#crontab(filename) ⇒ Object
6 7 8 9 |
# File 'lib/xronor/cli.rb', line 6 def crontab(filename) body = Xronor::Generator::Crontab.generate(filename, ) puts body end |
#cwa(filename) ⇒ Object
19 20 21 |
# File 'lib/xronor/cli.rb', line 19 def cwa(filename) Xronor::Generator::CloudWatchEvents.generate(filename, ) end |
#template(filename) ⇒ Object
25 26 27 28 |
# File 'lib/xronor/cli.rb', line 25 def template(filename) body = Xronor::Generator::ERB.generate_all_in_one(filename, ) puts body end |
#template_per_job(filename) ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/xronor/cli.rb', line 34 def template_per_job(filename) contents = Xronor::Generator::ERB.generate_per_job(filename, ) contents.each do |name, body| path = File.join([:outdir], [:ext] ? "#{name}.#{options[:ext]}" : name) open(path, "w+") { |f| f.puts body } end end |