senedsa 0.1.0 → 0.2.0
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/senedsa/cli.rb +0 -1
- data/lib/senedsa/send_nsca.rb +3 -2
- data/lib/senedsa/version.rb +1 -1
- metadata +1 -1
data/lib/senedsa/cli.rb
CHANGED
data/lib/senedsa/send_nsca.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'open3'
|
2
|
+
require 'psych'
|
2
3
|
|
3
4
|
module Senedsa
|
4
5
|
|
@@ -32,9 +33,9 @@ module Senedsa
|
|
32
33
|
unless cfg_file.nil?
|
33
34
|
raise ConfigurationError, "unable to read configuration file #{cfg_file}" unless File.readable? cfg_file
|
34
35
|
begin
|
35
|
-
cfg_options =
|
36
|
+
cfg_options = Psych.load File.open(cfg_file)
|
36
37
|
raise ConfigurationError, "senedsa_config not allowed in configuration file (#{cfg_file})" unless cfg_options[:senedsa_config].nil?
|
37
|
-
rescue
|
38
|
+
rescue Psych::SyntaxError => e
|
38
39
|
raise ConfigurationError, "syntax error in configuration file #{cfg_file}: #{e.message}"
|
39
40
|
rescue Errno::ENOENT, Errno::EACCES => e
|
40
41
|
raise ConfigurationError, e.message
|
data/lib/senedsa/version.rb
CHANGED