chef-utils 17.1.35 → 17.4.38

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
  SHA256:
3
- metadata.gz: 3adf9958a3e25602085a26528f12a34d96fbb14e7951c3793fa4a743304f474b
4
- data.tar.gz: e9723727db0a47455af03f4f3e78437221a94ab35495e2c8ababb16678a21113
3
+ metadata.gz: 9e107bc0419240dee131ff15cc131f651fa741c7f18902db4971f518efdded3f
4
+ data.tar.gz: 38ef265b995ea11a3f7ea5ae7a2eaaf747af79dc9f603cbf4468f9e16355a797
5
5
  SHA512:
6
- metadata.gz: '028316241e1f4b2e1dedd76b9b84590db98ddbe047fd163fef094ab6eee35503f34df805a282b2f508bbb001c9abcc84533d918f28af22adb3e4e75849b7ccfa'
7
- data.tar.gz: 539833b147fb391df7dea4ec3b0dc297b19fcb3ef6a68df44bad666fa46767e6ce64f1daabc79704cacf3822d72788afe9ab27787ba398a964b006fb8a398d24
6
+ metadata.gz: cb9f1a9f2b49a9594ed325772971cd248e1b20932a20dc6f6cf31ad8f7e264481c26eaa836dd23dc25b4457dad7fb426b3d45ee2cccbedb276cddd91c38ed22f
7
+ data.tar.gz: 9249a41d1de2288654c8fce4e8973287023f221c218825015551b07d2dced778845e39a2827d7416d6a0d6a92a84f5d69e85e636e2cba508024668f011970924
data/chef-utils.gemspec CHANGED
@@ -10,17 +10,17 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["oss@chef.io"]
11
11
 
12
12
  spec.summary = %q{Basic utility functions for Core Chef Infra development}
13
- spec.homepage = "https://github.com/chef/chef/tree/master/chef-utils"
13
+ spec.homepage = "https://github.com/chef/chef/tree/main/chef-utils"
14
14
  spec.license = "Apache-2.0"
15
15
 
16
16
  spec.required_ruby_version = ">= 2.6"
17
17
 
18
18
  spec.metadata = {
19
19
  "bug_tracker_uri" => "https://github.com/chef/chef/issues",
20
- "changelog_uri" => "https://github.com/chef/chef/blob/master/CHANGELOG.md",
21
- "documentation_uri" => "https://github.com/chef/chef/tree/master/chef-utils/README.md",
22
- "homepage_uri" => "https://github.com/chef/chef/tree/master/chef-utils",
23
- "source_code_uri" => "https://github.com/chef/chef/tree/master/chef-utils",
20
+ "changelog_uri" => "https://github.com/chef/chef/blob/main/CHANGELOG.md",
21
+ "documentation_uri" => "https://github.com/chef/chef/tree/main/chef-utils/README.md",
22
+ "homepage_uri" => "https://github.com/chef/chef/tree/main/chef-utils",
23
+ "source_code_uri" => "https://github.com/chef/chef/tree/main/chef-utils",
24
24
  }
25
25
 
26
26
  spec.require_paths = ["lib"]
@@ -15,6 +15,25 @@ module ChefUtils
15
15
  PRODUCT = "Chef Automate"
16
16
  end
17
17
 
18
+ class Cli
19
+ # the chef-cli product name
20
+ PRODUCT = "Chef CLI"
21
+
22
+ # the chef-cli gem
23
+ GEM = "chef-cli"
24
+ end
25
+
26
+ class Habitat
27
+ # name of the Habitat product
28
+ PRODUCT = "Chef Habitat"
29
+
30
+ # A short designation for the product
31
+ SHORT = "habitat"
32
+
33
+ # The hab cli binary
34
+ EXEC = "hab"
35
+ end
36
+
18
37
  class Infra
19
38
  # When referencing a product directly, like Chef (Now Chef Infra)
20
39
  PRODUCT = "Chef Infra Client"
@@ -42,6 +61,17 @@ module ChefUtils
42
61
  # The suffix for Chef's /etc/chef, /var/chef and C:\\Chef directories
43
62
  # "chef" => /etc/cinc, /var/cinc, C:\\cinc
44
63
  DIR_SUFFIX = "chef"
64
+
65
+ # The client's gem
66
+ GEM = "chef"
67
+ end
68
+
69
+ class Inspec
70
+ # The InSpec product name
71
+ PRODUCT = "Chef InSpec"
72
+
73
+ # The inspec binary
74
+ EXEC = "inspec"
45
75
  end
46
76
 
47
77
  class Org
@@ -63,6 +93,9 @@ module ChefUtils
63
93
 
64
94
  # knife documentation page
65
95
  KNIFE_DOCS = "https://docs.chef.io/workstation/knife/"
96
+
97
+ # the name of the overall infra product
98
+ PRODUCT = "Chef Infra"
66
99
  end
67
100
 
68
101
  class Server
@@ -88,8 +121,14 @@ module ChefUtils
88
121
  end
89
122
 
90
123
  class Workstation
124
+ # The full marketing name of the product
125
+ PRODUCT = "Chef Workstation"
126
+
91
127
  # The suffix for Chef Workstation's /opt/chef-workstation or C:\\opscode\chef-workstation
92
128
  DIR_SUFFIX = "chef-workstation"
129
+
130
+ # Workstation banner/help text
131
+ DOCS = "https://docs.chef.io/workstation/"
93
132
  end
94
133
 
95
134
  class Zero
@@ -77,7 +77,7 @@ module ChefUtils
77
77
  # @return [Boolean]
78
78
  #
79
79
  def macos?(node = __getnode)
80
- node["platform_family"] == "mac_os_x"
80
+ node ? node["platform_family"] == "mac_os_x" : macos_ruby?
81
81
  end
82
82
  # chef-sugar backcompat method
83
83
  alias_method :osx?, :macos?
@@ -86,6 +86,17 @@ module ChefUtils
86
86
  # chef-sugar backcompat method
87
87
  alias_method :mac_os_x?, :macos?
88
88
 
89
+ # Determine if the Ruby VM is currently running on a Mac node (This is useful primarily for internal use
90
+ # by Chef Infra Client before the node object exists).
91
+ #
92
+ # @since 17.3
93
+ #
94
+ # @return [Boolean]
95
+ #
96
+ def macos_ruby?
97
+ !!(RUBY_PLATFORM =~ /darwin/)
98
+ end
99
+
89
100
  # Determine if the current node is a member of the 'rhel' platform family (Red Hat, CentOS, Oracle or Scientific Linux, but NOT Amazon Linux or Fedora).
90
101
  #
91
102
  # @param [Chef::Node] node the node to check
@@ -45,7 +45,7 @@ module ChefUtils
45
45
  pool ||= ChefUtils::DefaultThreadPool.instance.pool
46
46
 
47
47
  futures = map do |item|
48
- future = Concurrent::Future.execute(executor: pool) do
48
+ Concurrent::Future.execute(executor: pool) do
49
49
  yield item
50
50
  end
51
51
  end
@@ -16,5 +16,5 @@
16
16
 
17
17
  module ChefUtils
18
18
  CHEFUTILS_ROOT = File.expand_path("..", __dir__)
19
- VERSION = "17.1.35"
19
+ VERSION = "17.4.38"
20
20
  end
@@ -25,7 +25,7 @@ def pf_reports_true_for(*args)
25
25
  expect(described_class.send(method, node)).to be true
26
26
  end
27
27
  end
28
- (PLATFORM_FAMILY_HELPERS - [ :windows_ruby? ] - args).each do |method|
28
+ (PLATFORM_FAMILY_HELPERS - %i{windows_ruby? macos_ruby?} - args).each do |method|
29
29
  it "reports false for #{method}" do
30
30
  expect(described_class.send(method, node)).to be false
31
31
  end
@@ -41,7 +41,7 @@ RSpec.describe ChefUtils::DSL::PlatformFamily do
41
41
  end
42
42
  end
43
43
 
44
- ( PLATFORM_FAMILY_HELPERS - [ :windows_ruby? ]).each do |helper|
44
+ ( PLATFORM_FAMILY_HELPERS - %i{windows_ruby? macos_ruby?}).each do |helper|
45
45
  it "has the #{helper} in the ChefUtils module" do
46
46
  expect(ChefUtils).to respond_to(helper)
47
47
  end
@@ -220,4 +220,16 @@ RSpec.describe ChefUtils::DSL::PlatformFamily do
220
220
  end
221
221
  end
222
222
  end
223
+
224
+ context "node-independent mac APIs" do
225
+ if RUBY_PLATFORM.match?(/darwin/)
226
+ it "reports true for :macos_ruby?" do
227
+ expect(described_class.macos_ruby?).to be true
228
+ end
229
+ else
230
+ it "reports false for :macos_ruby?" do
231
+ expect(described_class.macos_ruby?).to be false
232
+ end
233
+ end
234
+ end
223
235
  end
@@ -112,7 +112,7 @@ RSpec.describe ChefUtils::ParallelMap do
112
112
  end
113
113
 
114
114
  it "recursive parallel_each will not deadlock" do
115
- ans = Timeout.timeout(30) do
115
+ Timeout.timeout(30) do
116
116
  (1..2).parallel_each { |i| (1..2).parallel_each { |i| i } }
117
117
  end
118
118
  end
@@ -125,7 +125,7 @@ RSpec.describe ChefUtils::ParallelMap do
125
125
  end
126
126
 
127
127
  it "parallel_each is lazy" do
128
- ans = Timeout.timeout(30) do
128
+ Timeout.timeout(30) do
129
129
  (1..).lazy.parallel_each { |i| i }.first(5)
130
130
  end
131
131
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 17.1.35
4
+ version: 17.4.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-11 00:00:00.000000000 Z
11
+ date: 2021-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -70,15 +70,15 @@ files:
70
70
  - spec/unit/dsl/windows_spec.rb
71
71
  - spec/unit/mash_spec.rb
72
72
  - spec/unit/parallel_map_spec.rb
73
- homepage: https://github.com/chef/chef/tree/master/chef-utils
73
+ homepage: https://github.com/chef/chef/tree/main/chef-utils
74
74
  licenses:
75
75
  - Apache-2.0
76
76
  metadata:
77
77
  bug_tracker_uri: https://github.com/chef/chef/issues
78
- changelog_uri: https://github.com/chef/chef/blob/master/CHANGELOG.md
79
- documentation_uri: https://github.com/chef/chef/tree/master/chef-utils/README.md
80
- homepage_uri: https://github.com/chef/chef/tree/master/chef-utils
81
- source_code_uri: https://github.com/chef/chef/tree/master/chef-utils
78
+ changelog_uri: https://github.com/chef/chef/blob/main/CHANGELOG.md
79
+ documentation_uri: https://github.com/chef/chef/tree/main/chef-utils/README.md
80
+ homepage_uri: https://github.com/chef/chef/tree/main/chef-utils
81
+ source_code_uri: https://github.com/chef/chef/tree/main/chef-utils
82
82
  post_install_message:
83
83
  rdoc_options: []
84
84
  require_paths:
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
- rubygems_version: 3.2.15
97
+ rubygems_version: 3.2.22
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Basic utility functions for Core Chef Infra development