license-acceptance 1.0.8 → 1.0.11
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a7e8b93f7e80e8221f025bc46d0f264ffcfdfadf1111cbe73289697ba4e68c7
|
4
|
+
data.tar.gz: ff921f3831649e8981727a5d1d4afeb341be6a08b0760b239748b56273578e40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 948d8f90071888f6c2dcea6538308ca10bc8561c005ef4df2e217742cb4a4161c06dd6f2a001b7024f172cfdfbaf464a0dee5a7eefe697992f8e8a8794c700b9
|
7
|
+
data.tar.gz: 549aa9fe92c8524403cfb8bde8d4a3fd205eb09a23f0df637d7ad1453316dcc72cc2ff8c4e40d6f8900105d54a1755830aa7c4a29b89883f578cf4f72e9fc8eb
|
data/Gemfile.lock
CHANGED
data/config/product_info.toml
CHANGED
@@ -31,6 +31,11 @@ id = "push-jobs-server"
|
|
31
31
|
pretty_name = "Chef Push Jobs Server"
|
32
32
|
filename = "push_jobs_server"
|
33
33
|
|
34
|
+
[[products]]
|
35
|
+
id = "push-jobs-client"
|
36
|
+
pretty_name = "Chef Push Jobs Client"
|
37
|
+
filename = "push_jobs_client"
|
38
|
+
|
34
39
|
[[products]]
|
35
40
|
id = "chef-dk"
|
36
41
|
pretty_name = "Chef Development Kit"
|
@@ -49,5 +54,6 @@ license_required_version = "0.4"
|
|
49
54
|
"infra-client" = ["inspec"]
|
50
55
|
"infra-server" = ["infra-client"]
|
51
56
|
"push-jobs-server" = ["infra-client", "infra-server"]
|
57
|
+
"push-jobs-client" = ["infra-client"]
|
52
58
|
"chef-dk" = ["infra-client", "inspec"]
|
53
59
|
"chef-workstation" = ["infra-client", "inspec"]
|
@@ -104,7 +104,7 @@ module LicenseAcceptance
|
|
104
104
|
product = product_reader.lookup_by_mixlib(mixlib_name)
|
105
105
|
return false if product.nil?
|
106
106
|
# If they don't pass a version we assume they want latest
|
107
|
-
return true if version ==
|
107
|
+
return true if version.to_s == "latest" || version.nil?
|
108
108
|
Gem::Version.new(version) >= Gem::Version.new(product.license_required_version)
|
109
109
|
end
|
110
110
|
|
@@ -21,7 +21,7 @@ module LicenseAcceptance
|
|
21
21
|
|
22
22
|
def default_license_locations
|
23
23
|
if windows?
|
24
|
-
root = ENV
|
24
|
+
root = ENV.fetch("SYSTEMDRIVE","C:")
|
25
25
|
l = [ File.join(root, "chef/accepted_licenses/") ]
|
26
26
|
unless is_root?
|
27
27
|
# Look through a list of possible user locations and pick the first one that exists
|
@@ -266,6 +266,14 @@ RSpec.describe LicenseAcceptance::Acceptor do
|
|
266
266
|
end
|
267
267
|
end
|
268
268
|
|
269
|
+
describe "when version is 'latest'" do
|
270
|
+
let(:version) { "latest" }
|
271
|
+
it "returns true" do
|
272
|
+
expect(reader).to receive(:lookup_by_mixlib).with(mixlib_name).and_return product
|
273
|
+
expect(acc.license_required?(mixlib_name, version)).to eq(true)
|
274
|
+
end
|
275
|
+
end
|
276
|
+
|
269
277
|
describe "when version is nil" do
|
270
278
|
let(:version) { nil }
|
271
279
|
it "returns true" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: license-acceptance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tyler-ball
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pastel
|