steto 0.0.2 → 0.0.3
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/steto/nagios_check.rb +3 -3
- data/lib/steto/version.rb +1 -1
- data/spec/steto/nagios_check_spec.rb +6 -0
- metadata +4 -4
data/lib/steto/nagios_check.rb
CHANGED
@@ -19,11 +19,11 @@ module Steto
|
|
19
19
|
def command_line
|
20
20
|
# => "--critical=:critical --warning=:warning"
|
21
21
|
params = options.map do |option, value|
|
22
|
-
|
22
|
+
cli_option = option.to_s.gsub("_","-")
|
23
23
|
unless value == true
|
24
|
-
"--#{
|
24
|
+
"--#{cli_option}=:#{option}"
|
25
25
|
else
|
26
|
-
"--#{
|
26
|
+
"--#{cli_option}"
|
27
27
|
end
|
28
28
|
end.sort.join(' ')
|
29
29
|
@command_line ||= Cocaine::CommandLine.new(command, params, options.merge(:expected_outcodes => [0, 1, 2, 3]))
|
data/lib/steto/version.rb
CHANGED
@@ -42,6 +42,12 @@ describe Steto::NagiosCheck do
|
|
42
42
|
subject.stub :options => { :warning => "1,0.5,0.5", :critical => "1,1,1" }
|
43
43
|
subject.command_line.command.should == "dummy --critical='1,1,1' --warning='1,0.5,0.5'"
|
44
44
|
end
|
45
|
+
|
46
|
+
it "should rename option with underscores" do
|
47
|
+
subject.stub :command => "dummy"
|
48
|
+
subject.stub :options => { :with_underscore => "yes" }
|
49
|
+
subject.command_line.command.should == "dummy --with-underscore='yes'"
|
50
|
+
end
|
45
51
|
|
46
52
|
end
|
47
53
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: steto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alban Peignier
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-05
|
19
|
+
date: 2012-06-05 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
prerelease: false
|