Module: Macbot

Defined in:
lib/macbot.rb,
lib/macbot/cli.rb,
lib/macbot/metadata.rb

Defined Under Namespace

Classes: Cli

Constant Summary collapse

MAIL_START =

Your code goes here…

"    tell application \"Mail\"\n"
MAIL_END =
"    end tell\n"
VERSION =
'0.1.5'
NAME =
'Macbot'
SUMMARY =
'Set it up to disable/enable email accounts in Mail for OSX'
YAML_PATH =
File.join(Dir.home, '/.macbot.yml')
EMAIL_GROUPS =
if File.exists? Macbot::YAML_PATH
  YAML.load_file(Macbot::YAML_PATH).keys
else
  []
end

Class Method Summary collapse

Class Method Details

.accounts(type, options) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/macbot.rb', line 15

def self.accounts(type, options)
  enable = enabled(options)
  data = YAML.load_file(Macbot::YAML_PATH)
  emails = data[type]
  string = ''
  string += build_string(emails, enable)
  string += enable_zen(type, enable, data) if options.zen

  MAIL_START + string + MAIL_END
end