nagiosplugin 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,7 @@ module NagiosPlugin
26
26
  def nagios_plugin_output
27
27
  output = [nagios_plugin_service] << ' '
28
28
  output << nagios_plugin_status.to_s.upcase
29
- output << ': ' + message if respond_to?(:message)
29
+ output << ': ' + message if ( respond_to?(:message) && !message.empty? )
30
30
  output.join
31
31
  end
32
32
 
@@ -1,3 +1,3 @@
1
1
  module NagiosPlugin
2
- VERSION = '2.1.0'
2
+ VERSION = '2.1.1'
3
3
  end
data/nagiosplugin.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.description = 'The one Nagios Plugin framework, forged in the fires of Mount Doom.'
14
14
  spec.license = 'MIT'
15
15
 
16
- spec.files = `git ls-files`.split("\n")
16
+ spec.files = `git ls-files`.split("\n") - %w(.gitignore .rbenv-version .travis.yml)
17
17
  spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
18
  spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  spec.require_paths = ['lib']
@@ -130,9 +130,15 @@ module NagiosPlugin
130
130
  end
131
131
 
132
132
  it 'includes a custom plugin message if present' do
133
- plugin.should_receive(:message).and_return('ALL U CAN EAT!')
133
+ plugin.stub(:message => 'ALL U CAN EAT!')
134
134
  expect(plugin.send(:nagios_plugin_output)).to match(/: ALL U CAN EAT!$/)
135
135
  end
136
+
137
+ it 'should not append message if message is empty' do
138
+ plugin.stub(:message => '')
139
+ expect(plugin.send(:nagios_plugin_output)).not_to match(/:/)
140
+ end
141
+
136
142
  end
137
143
  end
138
144
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nagiosplugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-02 00:00:00.000000000 Z
12
+ date: 2013-12-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -114,9 +114,6 @@ executables: []
114
114
  extensions: []
115
115
  extra_rdoc_files: []
116
116
  files:
117
- - .gitignore
118
- - .rbenv-version
119
- - .travis.yml
120
117
  - Gemfile
121
118
  - Guardfile
122
119
  - LICENSE.txt
@@ -145,7 +142,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
145
142
  version: '0'
146
143
  segments:
147
144
  - 0
148
- hash: 1074742340015625013
145
+ hash: -4572774117514092169
149
146
  required_rubygems_version: !ruby/object:Gem::Requirement
150
147
  none: false
151
148
  requirements:
@@ -154,13 +151,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
151
  version: '0'
155
152
  segments:
156
153
  - 0
157
- hash: 1074742340015625013
154
+ hash: -4572774117514092169
158
155
  requirements: []
159
156
  rubyforge_project:
160
157
  rubygems_version: 1.8.23
161
158
  signing_key:
162
159
  specification_version: 3
163
- summary: nagiosplugin-2.1.0
160
+ summary: nagiosplugin-2.1.1
164
161
  test_files:
165
162
  - features/nagiosplugin_usage.feature
166
163
  - features/support/env.rb
data/.gitignore DELETED
@@ -1,18 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- vendor
data/.rbenv-version DELETED
@@ -1 +0,0 @@
1
- 1.9.3-p385
data/.travis.yml DELETED
@@ -1,4 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 1.8.7
4
- - 1.9.3