ohai 14.5.0 → 14.5.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,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a51cf17407e9d91624a5fa169e8057d15a75eac70805fc38a4fcbf928141121b
4
- data.tar.gz: 69c101063af73a9b0aba3f0956e57ce9c488607e76f605d1425e0d40951bcb38
3
+ metadata.gz: 43d635401a670d3a17696baedc004962bbabb702055df16763a8814f920fa3ce
4
+ data.tar.gz: 75d091cb7e4d9e8993224ed95b2dd19212293afb925e7b202325cacac2157105
5
5
  SHA512:
6
- metadata.gz: 354f6a0bd33873e3d8b124eeb23bfd111bd8b6cf46642fd119c3dd5cfd82666629ccff70fad44b08ac4a7fb2900a566cc0639558b0b5b2d10b95cec4d2e5a052
7
- data.tar.gz: 67bdf1bfc49797e0f61d95c96e2ad769c124ea19dc682358ae5fc27042cd8cdc4e08ea3f831a05c5b5edf3e1dd495579e90e9ac1321d7d678db41f58f167b4b9
6
+ metadata.gz: 532516c9be86772a63d5cdd33b6f6533e99a4861cead69cf67c5f3fa4695635731de6511e009b08f2930390908a3ed63ab249c5f42c3d7ff5b457a73537301b1
7
+ data.tar.gz: 05c0a5ea12747b483379734911f40c18cd17fb7cc22ef1484bf6d8ff97f90127631d543e5051bd9debbc4970696ee44a47ea486a226c8dea4a6457c8d10405c2
@@ -43,6 +43,7 @@ module Ohai
43
43
  end
44
44
  end
45
45
 
46
+ # @param name [String]
46
47
  def self.plugin(name, &block)
47
48
  raise Ohai::Exceptions::InvalidPluginName, "#{name} is not a valid plugin name. A valid plugin name is a symbol which begins with a capital letter and contains no underscores" unless NamedPlugin.valid_name?(name)
48
49
 
@@ -61,6 +62,8 @@ module Ohai
61
62
  end
62
63
 
63
64
  # Cross platform /dev/null to support testability
65
+ #
66
+ # @return [String]
64
67
  def self.dev_null
65
68
  if RUBY_PLATFORM =~ /mswin|mingw|windows/
66
69
  "NUL"
@@ -26,7 +26,7 @@ module Ohai
26
26
  @hints = {}
27
27
  end
28
28
 
29
- # parse the JSON conents of a hint file. Return an empty hash if the file has
29
+ # parse the JSON contents of a hint file. Return an empty hash if the file has
30
30
  # no JSON content
31
31
  # @param filename [String] the hint file path
32
32
  def self.parse_hint_file(filename)
@@ -62,12 +62,18 @@ module Ohai
62
62
 
63
63
  # Searches all plugin paths and returns an Array of PluginFile objects
64
64
  # representing each plugin file.
65
+ #
66
+ # @param dir [Array, String] directory/directories to load plugins from
67
+ # @return [Array<Ohai::Loader::PluginFile>]
65
68
  def plugin_files_by_dir(dir = Ohai.config[:plugin_path])
66
69
  Array(dir).inject([]) do |plugin_files, plugin_path|
67
70
  plugin_files + PluginFile.find_all_in(plugin_path)
68
71
  end
69
72
  end
70
73
 
74
+ # loads all plugin classes
75
+ #
76
+ # @return [Array<String>]
71
77
  def load_all
72
78
  plugin_files_by_dir.each do |plugin_file|
73
79
  load_plugin_class(plugin_file.path, plugin_file.plugin_root)
@@ -76,6 +82,8 @@ module Ohai
76
82
  collect_v7_plugins
77
83
  end
78
84
 
85
+ # load additional plugins classes from a given directory
86
+ # @param from [String] path to a directory with additional plugins to load
79
87
  def load_additional(from)
80
88
  from = [ Ohai.config[:plugin_path], from].flatten
81
89
  plugin_files_by_dir(from).collect do |plugin_file|
@@ -88,6 +96,9 @@ module Ohai
88
96
  # Load a specified file as an ohai plugin and creates an instance of it.
89
97
  # Not used by ohai itself, but can be used to load a plugin for testing
90
98
  # purposes.
99
+ #
100
+ # @param plugin_path [String]
101
+ # @param plugin_dir_path [String]
91
102
  def load_plugin(plugin_path, plugin_dir_path = nil)
92
103
  plugin_class = load_plugin_class(plugin_path, plugin_dir_path)
93
104
  return nil unless plugin_class.kind_of?(Class)
@@ -22,7 +22,7 @@ module Ohai
22
22
  class Log
23
23
  extend Mixlib::Log
24
24
 
25
- # this class loading initalization is so that we don't lose early logger
25
+ # this class loading initialization is so that we don't lose early logger
26
26
  # messages when run from the CLI?
27
27
  init(STDERR)
28
28
  level = :info # rubocop:disable Lint/UselessAssignment
@@ -29,6 +29,7 @@ require "ohai/provides_map"
29
29
  require "ohai/hints"
30
30
  require "mixlib/shellout"
31
31
  require "ohai/config"
32
+ require "ffi_yajl"
32
33
 
33
34
  module Ohai
34
35
  class System
@@ -53,6 +54,10 @@ module Ohai
53
54
  reset_system
54
55
  end
55
56
 
57
+ # clears the current collected data, clears the provides map for plugins,
58
+ # refreshes hints, and reconfigures ohai. In short this gets Ohai into a first run state
59
+ #
60
+ # @return [void]
56
61
  def reset_system
57
62
  @data = Mash.new
58
63
  @provides_map = ProvidesMap.new
@@ -73,6 +78,10 @@ module Ohai
73
78
  @data[key]
74
79
  end
75
80
 
81
+ # resets the system and loads then runs the plugins
82
+ #
83
+ # @param [Array<String>] attribute_filter
84
+ # @return [void]
76
85
  def all_plugins(attribute_filter = nil)
77
86
  # Reset the system when all_plugins is called since this function
78
87
  # can be run multiple times in order to pick up any changes in the
@@ -18,5 +18,5 @@
18
18
 
19
19
  module Ohai
20
20
  OHAI_ROOT = File.expand_path(File.dirname(__FILE__))
21
- VERSION = "14.5.0".freeze
21
+ VERSION = "14.5.4".freeze
22
22
  end
@@ -5,7 +5,6 @@ require "ohai/version"
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "ohai"
7
7
  s.version = Ohai::VERSION
8
- s.platform = Gem::Platform::RUBY
9
8
  s.summary = "Ohai profiles your system and emits JSON"
10
9
  s.description = s.summary
11
10
  s.license = "Apache-2.0"
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: 14.5.0
4
+ version: 14.5.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: 2018-09-14 00:00:00.000000000 Z
11
+ date: 2018-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: systemu