ohai 7.0.4.rc.0 → 7.0.4

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.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YWVkY2FhNjljYmVjY2I4MWVlMzE1YjQ2OWM4MTI3NDg4MDRhOTFlMQ==
5
- data.tar.gz: !binary |-
6
- NmQ4NGNjMTkzZTE2M2E1MGNjOGZjZjQ1YTc3NTM1NTljMTk2MGZlOA==
2
+ SHA1:
3
+ metadata.gz: a6729868c6cff750ce13aa0689430d6eebd60c53
4
+ data.tar.gz: ac65f41df0182aef053b34bba00b83da50660537
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NDlkYzVmNWNiMTA0NzgxODQ4YWM4NmUxNGM4YzU3ZjRjNjM4ODY1ZjYzMWQ4
10
- MTFhOWZkMDkyNDVlZTQyYzRhMjBkMzNkZjAyNzE5MmQ3OWE5MWM2NjE2Zjg1
11
- NmVmMjk5MTJhZTYxMDNhOTFiOTYwYjUyODY2NzhkN2NlOTViMDI=
12
- data.tar.gz: !binary |-
13
- NTQ5ODY3YWI3ZWI3YmRhOWY0YjhhYmQ3MjdmNWQ1NGMzYmQ5MDY5NGY4MzIy
14
- NDExZDc1YWRhNWE1NjFhYjFhNWU0NGIwOTIzYmE2OGFjN2EyMTk1ZjU4ZGY4
15
- ZGU5ZTcyMjZiYTI0MjIyZTNiOTc3Y2NkNjBhODNiYmI2MWJjYjU=
6
+ metadata.gz: 7de0db00561efe99995bd91cb25df7d7b8e870ebd14fa525a24dfe7a22dfa512926dea50123dc082e24d9cc2a26be8cd1d5e5a7b4e950c88c4fc2200ce409223
7
+ data.tar.gz: e2756cb9394f91175100d209537e1deb9ad53642a8a05359ded89348775000e8cb55203e16b0dd7687da895287db49a5a4965994d63d8958c81dd91dd4cf949e
@@ -91,7 +91,12 @@ module Ohai
91
91
 
92
92
  def run
93
93
  @has_run = true
94
- run_plugin
94
+
95
+ if Ohai::Config[:disabled_plugins].include?(name)
96
+ Ohai::Log.debug("Skipping disabled plugin #{name}")
97
+ else
98
+ run_plugin
99
+ end
95
100
  end
96
101
 
97
102
  def has_run?
@@ -37,11 +37,6 @@ module Ohai
37
37
  raise Ohai::Exceptions::InvalidPlugin, "Invalid plugin #{plugin} (must be an Ohai::DSL::Plugin or subclass)"
38
38
  end
39
39
 
40
- if Ohai::Config[:disabled_plugins].include?(plugin.name)
41
- Ohai::Log.debug("Skipping disabled plugin #{plugin.name}")
42
- return false
43
- end
44
-
45
40
  begin
46
41
  case plugin.version
47
42
  when :version7
@@ -18,5 +18,5 @@
18
18
 
19
19
  module Ohai
20
20
  OHAI_ROOT = File.expand_path(File.dirname(__FILE__))
21
- VERSION = '7.0.4.rc.0'
21
+ VERSION = '7.0.4'
22
22
  end
@@ -31,10 +31,46 @@ shared_examples "Ohai::DSL::Plugin" do
31
31
  end
32
32
 
33
33
  context "#run" do
34
- it "should set has_run? to true" do
34
+ before do
35
35
  plugin.stub(:run_plugin).and_return(true)
36
- plugin.run
37
- plugin.has_run?.should be_true
36
+ plugin.stub(:name).and_return(:TestPlugin)
37
+ end
38
+
39
+ describe "when plugin is enabled" do
40
+ before do
41
+ Ohai::Config.stub(:[]).with(:disabled_plugins).and_return([ ])
42
+ end
43
+
44
+ it "should run the plugin" do
45
+ plugin.should_receive(:run_plugin)
46
+ plugin.run
47
+ end
48
+
49
+ it "should set has_run? to true" do
50
+ plugin.run
51
+ plugin.has_run?.should be_true
52
+ end
53
+ end
54
+
55
+ describe "if the plugin is disabled" do
56
+ before do
57
+ Ohai::Config.stub(:[]).with(:disabled_plugins).and_return([ :TestPlugin ])
58
+ end
59
+
60
+ it "should not run the plugin" do
61
+ plugin.should_not_receive(:run_plugin)
62
+ plugin.run
63
+ end
64
+
65
+ it "should log a message to debug" do
66
+ Ohai::Log.should_receive(:debug).with(/Skipping disabled plugin TestPlugin/)
67
+ plugin.run
68
+ end
69
+
70
+ it "should set has_run? to true" do
71
+ plugin.run
72
+ plugin.has_run?.should be_true
73
+ end
38
74
  end
39
75
  end
40
76
 
@@ -51,27 +51,6 @@ describe Ohai::Runner, "run_plugin" do
51
51
  plugin.should_not_receive(:safe_run)
52
52
  @runner.run_plugin(plugin)
53
53
  end
54
-
55
- describe "if the plugin is disabled" do
56
- before(:each) do
57
- @disabled = Ohai::Config[:disabled_plugins]
58
- Ohai::Config[:disabled_plugins] = [:Test]
59
- end
60
-
61
- after(:each) do
62
- Ohai::Config[:disabled_plugins] = @disabled
63
- end
64
-
65
- it "should not run the plugin" do
66
- @runner.should_not_receive(:run_v7_plugin)
67
- @runner.run_plugin(plugin)
68
- end
69
-
70
- it "should log a message to debug" do
71
- Ohai::Log.should_receive(:debug).with(/Skipping disabled plugin Test/)
72
- @runner.run_plugin(plugin)
73
- end
74
- end
75
54
  end
76
55
  end
77
56
 
@@ -110,14 +89,6 @@ describe Ohai::Runner, "run_plugin" do
110
89
  end
111
90
 
112
91
  end
113
-
114
- describe "if the plugin is disabled" do
115
- it "should not run the plugin" do
116
- Ohai::Config.should_receive(:[]).with(:disabled_plugins).and_return(["Test"])
117
- @runner.should_not_receive(:run_v7_plugin)
118
- @runner.run_plugin(plugin)
119
- end
120
- end
121
92
  end
122
93
 
123
94
  describe "invalid version" do
@@ -127,17 +98,6 @@ describe Ohai::Runner, "run_plugin" do
127
98
  lambda { @runner.run_plugin(plugin) }.should raise_error(Ohai::Exceptions::InvalidPlugin)
128
99
  end
129
100
  end
130
-
131
- describe "when plugin is disabled" do
132
- before do
133
- Ohai::Config.should_receive(:[]).with(:disabled_plugins).and_return(["Test"])
134
- end
135
-
136
- it "should not run the plugin" do
137
- @runner.should_not_receive(:run_v7_plugin)
138
- @runner.run_plugin(plugin)
139
- end
140
- end
141
101
  end
142
102
 
143
103
  describe "when running a plugin with no dependencies, Ohai::Runner" do
metadata CHANGED
@@ -1,209 +1,209 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohai
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.4.rc.0
4
+ version: 7.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-25 00:00:00.000000000 Z
11
+ date: 2014-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.16'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.16'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: systemu
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.5.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.5.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: yajl-ruby
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mixlib-cli
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: mixlib-config
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '2.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: mixlib-log
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: mixlib-shellout
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '1.2'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.2'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: ipaddress
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ! '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ! '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rake
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ~>
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
131
  version: 10.1.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ~>
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: 10.1.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rspec-core
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ! '>='
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ! '>='
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rspec-expectations
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ! '>='
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ! '>='
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rspec-mocks
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ! '>='
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ! '>='
178
+ - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: rspec_junit_formatter
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ! '>='
185
+ - - ">="
186
186
  - !ruby/object:Gem::Version
187
187
  version: '0'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ! '>='
192
+ - - ">="
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: chef
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - ! '>='
199
+ - - ">="
200
200
  - !ruby/object:Gem::Version
201
201
  version: '0'
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - ! '>='
206
+ - - ">="
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  description: Ohai profiles your system and emits JSON
@@ -216,14 +216,16 @@ files:
216
216
  - LICENSE
217
217
  - README.rdoc
218
218
  - Rakefile
219
+ - bin/ohai
219
220
  - docs/man/man1/ohai.1
221
+ - lib/ohai.rb
220
222
  - lib/ohai/application.rb
221
223
  - lib/ohai/common/dmi.rb
222
224
  - lib/ohai/config.rb
225
+ - lib/ohai/dsl.rb
226
+ - lib/ohai/dsl/plugin.rb
223
227
  - lib/ohai/dsl/plugin/versionvi.rb
224
228
  - lib/ohai/dsl/plugin/versionvii.rb
225
- - lib/ohai/dsl/plugin.rb
226
- - lib/ohai/dsl.rb
227
229
  - lib/ohai/exception.rb
228
230
  - lib/ohai/hints.rb
229
231
  - lib/ohai/loader.rb
@@ -339,7 +341,6 @@ files:
339
341
  - lib/ohai/runner.rb
340
342
  - lib/ohai/system.rb
341
343
  - lib/ohai/version.rb
342
- - lib/ohai.rb
343
344
  - spec/data/plugins/___lib64___libc.so.6.output
344
345
  - spec/data/plugins/___lib___libc.so.6.output
345
346
  - spec/data/plugins/cc.output
@@ -452,7 +453,6 @@ files:
452
453
  - spec/unit/provides_map_spec.rb
453
454
  - spec/unit/runner_spec.rb
454
455
  - spec/unit/system_spec.rb
455
- - bin/ohai
456
456
  homepage: http://wiki.opscode.com/display/chef/Ohai
457
457
  licenses: []
458
458
  metadata: {}
@@ -462,17 +462,17 @@ require_paths:
462
462
  - lib
463
463
  required_ruby_version: !ruby/object:Gem::Requirement
464
464
  requirements:
465
- - - ! '>='
465
+ - - ">="
466
466
  - !ruby/object:Gem::Version
467
467
  version: '0'
468
468
  required_rubygems_version: !ruby/object:Gem::Requirement
469
469
  requirements:
470
- - - ! '>'
470
+ - - ">="
471
471
  - !ruby/object:Gem::Version
472
- version: 1.3.1
472
+ version: '0'
473
473
  requirements: []
474
474
  rubyforge_project:
475
- rubygems_version: 2.1.11
475
+ rubygems_version: 2.2.2
476
476
  signing_key:
477
477
  specification_version: 4
478
478
  summary: Ohai profiles your system and emits JSON