specinfra 2.17.0 → 2.17.1
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 +4 -4
- data/lib/specinfra/host_inventory.rb +37 -10
- data/lib/specinfra/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95957f49bb4305b2517ce5b6850b7f6e099cc3ce
|
4
|
+
data.tar.gz: 49b26004b03a66d83d4dcf0bdb6c3e471ea63b50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76bfa75a89269273dba700ec9d0bbc824f4e7e2b5846d2109b7e896be97c29f8a184af0d484824e88454a4786b43639703f031f6e78722aea8260fb7af6b8f40
|
7
|
+
data.tar.gz: f269df1a92d3305f0ec60697f491eef385cb9975e3acbad5d2ec500b3ced054170c001defac00fbef14515630fdd929ac1f536759244e6ec90973c46d056c09d
|
@@ -1,16 +1,7 @@
|
|
1
|
-
require 'specinfra/host_inventory/memory'
|
2
|
-
require 'specinfra/host_inventory/ec2'
|
3
|
-
require 'specinfra/host_inventory/hostname'
|
4
|
-
require 'specinfra/host_inventory/domain'
|
5
|
-
require 'specinfra/host_inventory/fqdn'
|
6
|
-
require 'specinfra/host_inventory/platform'
|
7
|
-
require 'specinfra/host_inventory/platform_version'
|
8
|
-
require 'specinfra/host_inventory/filesystem'
|
9
|
-
require 'specinfra/host_inventory/cpu'
|
10
|
-
|
11
1
|
module Specinfra
|
12
2
|
class HostInventory
|
13
3
|
include Singleton
|
4
|
+
include Enumerable
|
14
5
|
|
15
6
|
def initialize
|
16
7
|
property[:host_inventory] ||= {}
|
@@ -29,5 +20,41 @@ module Specinfra
|
|
29
20
|
end
|
30
21
|
@inventory[key.to_sym]
|
31
22
|
end
|
23
|
+
|
24
|
+
def each
|
25
|
+
keys.each do |k|
|
26
|
+
yield k, self[k]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def each_key
|
31
|
+
keys.each do |k|
|
32
|
+
yield k
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def each_value
|
37
|
+
keys.each do |k|
|
38
|
+
yield self[k]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def keys
|
43
|
+
%w{
|
44
|
+
memory
|
45
|
+
ec2
|
46
|
+
hostname
|
47
|
+
domain
|
48
|
+
fqdn
|
49
|
+
platform
|
50
|
+
platform_version
|
51
|
+
filesystem
|
52
|
+
cpu
|
53
|
+
}
|
54
|
+
end
|
32
55
|
end
|
33
56
|
end
|
57
|
+
|
58
|
+
Specinfra::HostInventory.instance.keys.each do |k|
|
59
|
+
require "specinfra/host_inventory/#{k}"
|
60
|
+
end
|
data/lib/specinfra/version.rb
CHANGED