Class: Overwatch::Command

Inherits:
Clamp::Command
  • Object
show all
Includes:
Helpers
Defined in:
lib/overwatch/command.rb

Instance Method Summary collapse

Methods included from Helpers

#default_headers, #delete, #display_line, #f, #format_output, #get, #post

Instance Method Details

#config=(file) ⇒ Object



26
27
28
# File 'lib/overwatch/command.rb', line 26

def config=(file)
  YAML.load_file(File.expand_path(file))
end

#default_configObject



30
31
32
# File 'lib/overwatch/command.rb', line 30

def default_config
  YAML.load_file(File.expand_path("~/.overwatchrc"))
end

#default_formatObject



46
47
48
# File 'lib/overwatch/command.rb', line 46

def default_format
  config['format'] || 'pretty'
end

#default_keyObject



42
43
44
# File 'lib/overwatch/command.rb', line 42

def default_key
  config['key'] || nil
end

#default_portObject



38
39
40
# File 'lib/overwatch/command.rb', line 38

def default_port
  config['port'] || '9001'
end

#default_serverObject



34
35
36
# File 'lib/overwatch/command.rb', line 34

def default_server
  config['server'] || 'localhost'
end