Module: DAF

Defined in:
lib/daf.rb,
lib/daf/action.rb,
lib/daf/command.rb,
lib/daf/monitor.rb,
lib/daf/version.rb,
lib/daf/configurable.rb,
lib/daf/actions/sms_action.rb,
lib/daf/actions/email_action.rb,
lib/daf/actions/shell_action.rb,
lib/daf/actions/pushbullet_action.rb,
lib/daf/datasources/yaml_data_source.rb,
lib/daf/monitors/file_update_monitor.rb

Overview

DAF module version numbering

Defined Under Namespace

Modules: Configurable Classes: Action, Command, CommandDataSource, CommandException, DynamicActionDaemon, EmailAction, FileUpdateMonitor, Monitor, Option, OptionException, PushbulletAction, SMSAction, ShellAction, YAMLDataSource

Constant Summary collapse

VERSION =
'0.3.0'

Instance Method Summary collapse

Instance Method Details



26
27
28
29
30
31
# File 'lib/daf.rb', line 26

def print_usage
  puts 'DAF not started - please see below'
  puts 'Usage: daf [path to config folder]'
  puts 'Directory must contain one or more config'
  puts 'files with a .yaml extension'
end

#start_dadObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/daf.rb', line 11

def start_dad
  if ARGV[0] && File.directory?(ARGV[0])
    commands = []

    Dir[ARGV[0] + '/*.yaml'].each do |file|
      commands << Command.new(YAMLDataSource.new(file))
    end

    dad = DynamicActionDaemon.new(commands)
    dad.start
  else
    print_usage
  end
end