prism-marauder 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/marauder/commands.rb +19 -1
- data/lib/marauder/marauder.rb +1 -1
- metadata +1 -1
data/lib/marauder/commands.rb
CHANGED
@@ -5,11 +5,29 @@ require 'marauder/marauder'
|
|
5
5
|
require 'httparty'
|
6
6
|
require 'net/ssh'
|
7
7
|
require 'commander/import'
|
8
|
+
require 'yaml'
|
8
9
|
|
9
10
|
program :version, Marauder::VERSION
|
10
11
|
program :description, 'command-line tool to locate infrastructure'
|
11
12
|
|
12
|
-
|
13
|
+
# Load config file
|
14
|
+
CONFIG_FILE = "#{ENV['HOME']}/.config/marauder/defaults.yaml"
|
15
|
+
|
16
|
+
if File.exists? (CONFIG_FILE)
|
17
|
+
config = YAML.load_file(CONFIG_FILE)
|
18
|
+
else
|
19
|
+
STDERR.puts "Well that doesn't look right..."
|
20
|
+
STDERR.puts " ... prism-marauder now requires a configuration file which tells it how to connect to Prism"
|
21
|
+
STDERR.puts
|
22
|
+
STDERR.puts "You need a file at #{CONFIG_FILE} that at a very minimum contains:"
|
23
|
+
STDERR.puts " ---"
|
24
|
+
STDERR.puts " prism-url: http://<prism-host>"
|
25
|
+
STDERR.puts
|
26
|
+
STDERR.puts "Good luck on your quest"
|
27
|
+
raise ArgumentError, "Missing configuration file"
|
28
|
+
end
|
29
|
+
|
30
|
+
PRISM_URL = config['prism-url']
|
13
31
|
|
14
32
|
class Api
|
15
33
|
include HTTParty
|
data/lib/marauder/marauder.rb
CHANGED