Class: Henchman::Templates
- Inherits:
-
Object
- Object
- Henchman::Templates
- Defined in:
- lib/templates.rb
Class Method Summary collapse
Class Method Details
.config ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/templates.rb', line 32 def self.config yml = { :dropbox => {:key => '', :secret => '', :access_token => '', :user_id => '', :root => ''}, :root => '', :poll_itunes_open => 10, :poll_track => 3, :reprompt_timeout => 300, :delimiter => '|~|' } end |
.plist ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/templates.rb', line 3 def self.plist config = YAML.load_file(File.('~/.henchman/config')) "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"\ "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" "\ "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"\ "<plist version=\"1.0\">\n"\ "<dict>\n"\ "\t<key>Label</key>\n"\ "\t<string>henchman</string>\n"\ "\t<key>ProgramArguments</key>\n"\ "\t<array>\n"\ "\t\t<string>#{File.expand_path('~/.henchman/run.sh')}</string>\n"\ "\t</array>\n"\ "\t<key>StartInterval</key>\n"\ "\t<integer>#{config[:poll_itunes_open]}</integer>\n"\ "\t<key>StandardOutPath</key>\n"\ "\t<string>#{File.expand_path('~/.henchman/stdout.log')}</string>\n"\ "\t<key>StandardErrorPath</key>\n"\ "\t<string>#{File.expand_path('~/.henchman/stderr.log')}</string>\n"\ "</dict>\n"\ "</plist>" end |
.shell_script ⇒ Object
27 28 29 30 |
# File 'lib/templates.rb', line 27 def self.shell_script "#!/bin/sh\n"\ "#{`which henchman`.chomp} run" end |