ohai 8.12.1 → 8.13.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 208b36d310e98c13c42fb16458c84aaf025e43cc
4
- data.tar.gz: d7b8842a2b4d0c24fcc24ffa8d00972b663960f5
3
+ metadata.gz: 653220934f733f38ccf77e2995b60dafff3a8cb4
4
+ data.tar.gz: d853852c8a1bb4912970a3562e60c9a91636a5de
5
5
  SHA512:
6
- metadata.gz: acb301a3349269fef3990aa7c7f5bef95e845b617de0822013dcb4b390083b20c1cc4228608b95bd768f55a2c13c3237ff694d5b97d2e9eb5cfc8124181d9b7e
7
- data.tar.gz: 8d659b17aa4341e995e511244c2c8d1406a82f75f68db43baf506717b4203d4ab4e77ea5f7942f68bf68f4e761edae7e2ed365fa9bba61d0cfb136bb404b023d
6
+ metadata.gz: e03fdd75bfde725021994265b3ba2ed5474c9d37f5409886e4cc29656616bb7647e199db6efbea708e446391ca410692d69fcc95072ba3ca8a936dee6321b8e3
7
+ data.tar.gz: 36ed710e0d3813f796dbf2fd3b970583610e4731c8ed53e203de69cf1abc170aed18942ed999d571fd4547cac87f94e0d7c3071e5604020b49fa5ec6e938cafa
data/Gemfile CHANGED
@@ -3,8 +3,6 @@ source "https://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  group :development do
6
- gem "chef", github: "chef/chef", branch: "master"
7
-
8
6
  gem "sigar", :platform => "ruby"
9
7
 
10
8
  gem "chefstyle", "= 0.3.0"
data/bin/ohai CHANGED
File without changes
@@ -0,0 +1,43 @@
1
+ # Author:: Christopher M Luciano (<cmlucian@us.ibm.com>)
2
+ # © Copyright IBM Corporation 2015.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ Ohai.plugin(:Scala) do
18
+ provides "languages/scala", "languages/scala/sbt"
19
+
20
+ depends "languages"
21
+
22
+ collect_data(:default) do
23
+ # Check for scala
24
+ output = nil
25
+
26
+ scala = Mash.new
27
+ so = shell_out("scala -version")
28
+ if so.exitstatus == 0
29
+ output = so.stdout.split
30
+ scala[:version] = output[4]
31
+ languages[:scala] = scala if scala[:version]
32
+ end
33
+
34
+ # Check for sbt
35
+ output = nil
36
+
37
+ so = shell_out("sbt --version")
38
+ if so.exitstatus == 0
39
+ output = so.stdout.split
40
+ scala[:sbt] = output[3] if scala[:version]
41
+ end
42
+ end
43
+ end
data/lib/ohai/version.rb CHANGED
@@ -18,5 +18,5 @@
18
18
 
19
19
  module Ohai
20
20
  OHAI_ROOT = File.expand_path(File.dirname(__FILE__))
21
- VERSION = "8.12.1"
21
+ VERSION = "8.13.0"
22
22
  end
data/ohai.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_dependency "mixlib-config", "~> 2.0"
22
22
  s.add_dependency "mixlib-log"
23
23
  s.add_dependency "mixlib-shellout", "~> 2.0"
24
- s.add_dependency "plist"
24
+ s.add_dependency "plist", "~> 3.1"
25
25
  s.add_dependency "ipaddress"
26
26
  s.add_dependency "wmi-lite", "~> 1.0"
27
27
  s.add_dependency "ffi", "~> 1.9"
@@ -0,0 +1,83 @@
1
+ # Author:: Christopher M Luciano (<cmlucian@us.ibm.com>)
2
+ # © Copyright IBM Corporation 2015.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
19
+
20
+ describe Ohai::System, "plugin scala" do
21
+
22
+ let(:plugin) do
23
+ plugin = get_plugin("scala").tap do |plugin|
24
+ plugin[:languages] = Mash.new
25
+ end
26
+ end
27
+
28
+ let(:scala_out) { "Scala code runner version 2.11.6 -- Copyright 2002-2013, LAMP/EPFL" }
29
+ let(:sbt_out) { "sbt launcher version 0.13.8" }
30
+
31
+ def setup_plugin
32
+ allow(plugin).to receive(:shell_out)
33
+ .with("scala -version")
34
+ .and_return(mock_shell_out(0, scala_out, ""))
35
+ allow(plugin).to receive(:shell_out)
36
+ .with("sbt --version")
37
+ .and_return(mock_shell_out(0, sbt_out, ""))
38
+ end
39
+
40
+ context " if scala is installed" do
41
+ before(:each) do
42
+ setup_plugin
43
+ plugin.run
44
+ end
45
+
46
+ it "should set languages[:scala][:version]" do
47
+ expect(plugin.languages[:scala][:version]).to eql("2.11.6")
48
+ end
49
+ end
50
+
51
+ context "if sbt is installed" do
52
+
53
+ before(:each) do
54
+ setup_plugin
55
+ plugin.run
56
+ end
57
+
58
+ it "should set languages[:sbt][:version]" do
59
+ expect(plugin.languages[:scala][:sbt]).to eql("0.13.8")
60
+ end
61
+ end
62
+
63
+ context "if scala is not installed" do
64
+
65
+ before(:each) do
66
+ allow(plugin).to receive(:shell_out)
67
+ .with("scala -version")
68
+ .and_raise( Errno::ENOENT)
69
+
70
+ allow(plugin).to receive(:shell_out)
71
+ .with("sbt --version")
72
+ .and_raise( Errno::ENOENT)
73
+ end
74
+
75
+ it "should not set the languages[:scala] if scala command fails" do
76
+ expect(plugin.languages).not_to have_key(:scala)
77
+ end
78
+
79
+ it "should not set the languages[:scala][:sbt] if sbt command fails" do
80
+ expect(plugin.languages).not_to have_key(:sbt)
81
+ end
82
+ end
83
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohai
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.12.1
4
+ version: 8.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-15 00:00:00.000000000 Z
11
+ date: 2016-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: systemu
@@ -98,16 +98,16 @@ dependencies:
98
98
  name: plist
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '3.1'
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
- version: '0'
110
+ version: '3.1'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: ipaddress
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -404,6 +404,7 @@ files:
404
404
  - lib/ohai/plugins/root_group.rb
405
405
  - lib/ohai/plugins/ruby.rb
406
406
  - lib/ohai/plugins/rust.rb
407
+ - lib/ohai/plugins/scala.rb
407
408
  - lib/ohai/plugins/sigar/cpu.rb
408
409
  - lib/ohai/plugins/sigar/filesystem.rb
409
410
  - lib/ohai/plugins/sigar/memory.rb
@@ -575,6 +576,7 @@ files:
575
576
  - spec/unit/plugins/root_group_spec.rb
576
577
  - spec/unit/plugins/ruby_spec.rb
577
578
  - spec/unit/plugins/rust_spec.rb
579
+ - spec/unit/plugins/scala_spec.rb
578
580
  - spec/unit/plugins/sigar/network_route_spec.rb
579
581
  - spec/unit/plugins/softlayer_spec.rb
580
582
  - spec/unit/plugins/solaris2/cpu_spec.rb
@@ -618,7 +620,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
618
620
  version: '0'
619
621
  requirements: []
620
622
  rubyforge_project:
621
- rubygems_version: 2.5.2
623
+ rubygems_version: 2.6.1
622
624
  signing_key:
623
625
  specification_version: 4
624
626
  summary: Ohai profiles your system and emits JSON