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: 47da182a1b53cca73f1f0972dc563e4cf3d44c1e4e9bc902f5d83ea983bdae74
4
- data.tar.gz: 93a01f5b61a66278ccb0dab8ff5c5e08dbb8a37e45909e7ab1bb08ee756c2966
3
+ metadata.gz: 7a7e8b93f7e80e8221f025bc46d0f264ffcfdfadf1111cbe73289697ba4e68c7
4
+ data.tar.gz: ff921f3831649e8981727a5d1d4afeb341be6a08b0760b239748b56273578e40
5
5
  SHA512:
6
- metadata.gz: 7e8e5cce417bfa34298845c302b07a819cf1d4a969a82de3f503587f56f4b47a7fb2ba2b86e72d1e4e00f7ba964f56b010097646ad9cf19a09fcc6c79e80035a
7
- data.tar.gz: 1743c7840bbec6c58e6dd62e2060509ef5c43dbe7a712ef585c489f8669cdf76d7f5f58fc6a3f4863723e336e2fb08c1205ecf2e3181ed833dfa0f8c4742a416
6
+ metadata.gz: 948d8f90071888f6c2dcea6538308ca10bc8561c005ef4df2e217742cb4a4161c06dd6f2a001b7024f172cfdfbaf464a0dee5a7eefe697992f8e8a8794c700b9
7
+ data.tar.gz: 549aa9fe92c8524403cfb8bde8d4a3fd205eb09a23f0df637d7ad1453316dcc72cc2ff8c4e40d6f8900105d54a1755830aa7c4a29b89883f578cf4f72e9fc8eb
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- license-acceptance (1.0.8)
4
+ license-acceptance (1.0.11)
5
5
  pastel (~> 0.7)
6
6
  tomlrb (~> 1.2)
7
7
  tty-box (~> 0.3)
@@ -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 == :latest || version.nil?
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["HOMEDRIVE"] || "C:"
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
@@ -1,3 +1,3 @@
1
1
  module LicenseAcceptance
2
- VERSION = "1.0.8"
2
+ VERSION = "1.0.11"
3
3
  end
@@ -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.8
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-14 00:00:00.000000000 Z
11
+ date: 2019-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pastel