Module: Upstart::Exporter::ExporterHelpers
- Included in:
- Upstart::Exporter, ExpandedExporter
- Defined in:
- lib/upstart-exporter/exporter_helpers.rb
Instance Method Summary collapse
- #app_cmd(cmd_name) ⇒ Object
- #app_name ⇒ Object
- #export_cmd_helper(cmd_name, cmd, binds = {}) ⇒ Object
- #helper_cmd_conf(cmd_name) ⇒ Object
- #upstart_cmd_conf(cmd_name) ⇒ Object
Instance Method Details
#app_cmd(cmd_name) ⇒ Object
14 15 16 |
# File 'lib/upstart-exporter/exporter_helpers.rb', line 14 def app_cmd(cmd_name) "#{app_name}-#{cmd_name}" end |
#app_name ⇒ Object
10 11 12 |
# File 'lib/upstart-exporter/exporter_helpers.rb', line 10 def app_name @options[:prefix] + @options[:app_name] end |
#export_cmd_helper(cmd_name, cmd, binds = {}) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/upstart-exporter/exporter_helpers.rb', line 3 def export_cmd_helper(cmd_name, cmd, binds={}) helper_script_cont = Templates.helper append_cmd(cmd, binds) File.open(helper_cmd_conf(cmd_name), 'w') do |f| f.write(helper_script_cont) end end |
#helper_cmd_conf(cmd_name) ⇒ Object
22 23 24 |
# File 'lib/upstart-exporter/exporter_helpers.rb', line 22 def helper_cmd_conf(cmd_name) File.join(@options[:helper_dir], "#{app_cmd(cmd_name)}.sh") end |
#upstart_cmd_conf(cmd_name) ⇒ Object
18 19 20 |
# File 'lib/upstart-exporter/exporter_helpers.rb', line 18 def upstart_cmd_conf(cmd_name) File.join(@options[:upstart_dir], "#{app_cmd(cmd_name)}.conf") end |