berkshelf 7.0.10 → 7.1.0

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.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -3
  3. data/berkshelf.gemspec +1 -1
  4. data/lib/berkshelf.rb +1 -1
  5. data/lib/berkshelf/berksfile.rb +30 -30
  6. data/lib/berkshelf/cli.rb +5 -5
  7. data/lib/berkshelf/location.rb +3 -3
  8. data/lib/berkshelf/lockfile.rb +9 -9
  9. data/lib/berkshelf/packager.rb +2 -2
  10. data/lib/berkshelf/uploader.rb +4 -4
  11. data/lib/berkshelf/version.rb +1 -1
  12. data/spec/support/git.rb +18 -18
  13. data/spec/support/path_helpers.rb +4 -4
  14. data/spec/tmp/berkshelf/cookbooks/dep-1.0.0/attributes/default.rb +0 -0
  15. data/spec/tmp/berkshelf/cookbooks/dep-1.0.0/files/default/file.h +0 -0
  16. data/spec/tmp/berkshelf/cookbooks/dep-1.0.0/metadata.rb +2 -0
  17. data/spec/tmp/berkshelf/cookbooks/dep-1.0.0/recipes/default.rb +0 -0
  18. data/spec/tmp/berkshelf/cookbooks/dep-1.0.0/templates/default/template.erb +0 -0
  19. data/spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/attributes/default.rb +0 -0
  20. data/spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/files/default/file.h +0 -0
  21. data/spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/metadata.rb +3 -0
  22. data/spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/recipes/default.rb +0 -0
  23. data/spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/templates/default/template.erb +0 -0
  24. data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/attributes/default.rb +0 -0
  25. data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/files/default/file.h +0 -0
  26. data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/metadata.rb +3 -0
  27. data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/recipes/default.rb +0 -0
  28. data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/templates/default/template.erb +0 -0
  29. metadata +19 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1209065e8abc3141efc5b789c212f990184a652cd89a0414ba4fefb2bc9c419
4
- data.tar.gz: 627233958a52340668fcc510f5142eaf37a8dec3130dd8f99d389004f26a7d8d
3
+ metadata.gz: db4572fef41dd9da70dbc590f97cac73ff70ef9c5206ae82dca20145f2d64da7
4
+ data.tar.gz: b31969725a11b43359027fa3e729381bc1515fdc8845601d473aac647f521b7e
5
5
  SHA512:
6
- metadata.gz: 6a41ffac6b3b389d138f2bd430520b1e64257455f6b3332058d6f07bd7a52d0a60d24063206ffb54fb87c3645a92ef9087d0b653fc332bbc57f6335501bdbac6
7
- data.tar.gz: 667994356ccb8b8be2b2be7ff191b5da06e4d95d75f98f7ef6124a404b8b5ee1397236f335cfd7317e8fb21b3df8f242d1e6f30e62c617f2360cfb3e5a61d590
6
+ metadata.gz: f760c4eca41839953b82dc30c4cb50ef60aff3ec7fc7c13a80d313f72d4d0ce775a61ae4c49b95de52d5a29f963d6a0d70d5a511af37d8aca900f05f72ef7f7d
7
+ data.tar.gz: 40f5a28f40e62e91c0b69ac8020611f9513cf03fc4e376c3edb1d60ad327288ecb3060daf4b4fd3e392e2a068838ccc7b0e9da72d3be6a0620835bbc9e0783fa
data/Gemfile CHANGED
@@ -11,10 +11,9 @@ group :build do
11
11
  end
12
12
 
13
13
  group :development do
14
- # these all deliberately float because berkshelf has a Gemfile.lock that
15
- # equality pins them. temporarily pin as necessary for API breaks.
16
14
  gem "chef-bin" # for the proxy tests
17
- gem "aruba", ">= 0.10.0"
15
+ gem "aruba", "~> 0.10" # Stay below 1 until aruba/in_process monkeypatching stops
16
+ gem "cucumber", "< 4.0" # until we identify what is generating the ~@no_run tag in CI
18
17
  gem "cucumber-expressions", "= 5.0.13"
19
18
  gem "chef-zero", ">= 4.0"
20
19
  gem "dep_selector", ">= 1.0"
@@ -38,7 +38,7 @@ Gem::Specification.new do |s|
38
38
  s.add_dependency "octokit", "~> 4.0"
39
39
  s.add_dependency "mixlib-archive", ">= 0.4", "< 2.0"
40
40
  s.add_dependency "concurrent-ruby", "~> 1.0"
41
- s.add_dependency "chef", ">= 13.6.52"
41
+ s.add_dependency "chef", ">= 15.7.32" # needed for --skip-syntax-check
42
42
  s.add_dependency "chef-config"
43
43
  # this is required for Mixlib::Config#from_json
44
44
  s.add_dependency "mixlib-config", ">= 2.2.5"
@@ -169,7 +169,7 @@ module Berkshelf
169
169
  raise ChefConnectionError, "Missing required attribute in your Berkshelf configuration: chef.client_key"
170
170
  end
171
171
 
172
- RidleyCompat.new_client(ridley_options, &block)
172
+ RidleyCompat.new_client(**ridley_options, &block)
173
173
  rescue ChefConnectionError, BerkshelfError
174
174
  raise
175
175
  rescue => ex
@@ -740,41 +740,41 @@ module Berkshelf
740
740
 
741
741
  private
742
742
 
743
- # Ensure the lockfile is present on disk.
744
- #
745
- # @raise [LockfileNotFound]
746
- # if the lockfile does not exist on disk
747
- #
748
- # @return [true]
743
+ # Ensure the lockfile is present on disk.
744
+ #
745
+ # @raise [LockfileNotFound]
746
+ # if the lockfile does not exist on disk
747
+ #
748
+ # @return [true]
749
749
  def validate_lockfile_present!
750
750
  raise LockfileNotFound unless lockfile.present?
751
751
 
752
752
  true
753
753
  end
754
754
 
755
- # Ensure that all dependencies defined in the Berksfile exist in this
756
- # lockfile.
757
- #
758
- # @raise [LockfileOutOfSync]
759
- # if there are dependencies specified in the Berksfile which do not
760
- # exist (or are not satisifed by) the lockfile
761
- #
762
- # @return [true]
755
+ # Ensure that all dependencies defined in the Berksfile exist in this
756
+ # lockfile.
757
+ #
758
+ # @raise [LockfileOutOfSync]
759
+ # if there are dependencies specified in the Berksfile which do not
760
+ # exist (or are not satisifed by) the lockfile
761
+ #
762
+ # @return [true]
763
763
  def validate_lockfile_trusted!
764
764
  raise LockfileOutOfSync unless lockfile.trusted?
765
765
 
766
766
  true
767
767
  end
768
768
 
769
- # Ensure that all dependencies in the lockfile are installed on this
770
- # system. You should validate that the lockfile can be trusted before
771
- # using this method.
772
- #
773
- # @raise [DependencyNotInstalled]
774
- # if the dependency in the lockfile is not in the Berkshelf shelf on
775
- # this system
776
- #
777
- # @return [true]
769
+ # Ensure that all dependencies in the lockfile are installed on this
770
+ # system. You should validate that the lockfile can be trusted before
771
+ # using this method.
772
+ #
773
+ # @raise [DependencyNotInstalled]
774
+ # if the dependency in the lockfile is not in the Berkshelf shelf on
775
+ # this system
776
+ #
777
+ # @return [true]
778
778
  def validate_dependencies_installed!
779
779
  lockfile.graph.locks.each do |_, dependency|
780
780
  unless dependency.installed?
@@ -785,13 +785,13 @@ module Berkshelf
785
785
  true
786
786
  end
787
787
 
788
- # Determine if any cookbooks were specified that aren't in our shelf.
789
- #
790
- # @param [Array<String>] names
791
- # a list of cookbook names
792
- #
793
- # @raise [DependencyNotFound]
794
- # if a cookbook name is given that does not exist
788
+ # Determine if any cookbooks were specified that aren't in our shelf.
789
+ #
790
+ # @param [Array<String>] names
791
+ # a list of cookbook names
792
+ #
793
+ # @raise [DependencyNotFound]
794
+ # if a cookbook name is given that does not exist
795
795
  def validate_cookbook_names!(names)
796
796
  missing = names - lockfile.graph.locks.keys
797
797
 
@@ -419,11 +419,11 @@ module Berkshelf
419
419
 
420
420
  private
421
421
 
422
- # Print a list of the given cookbooks. This is used by various
423
- # methods like {list} and {contingent}.
424
- #
425
- # @param [Array<CachedCookbook>] cookbooks
426
- #
422
+ # Print a list of the given cookbooks. This is used by various
423
+ # methods like {list} and {contingent}.
424
+ #
425
+ # @param [Array<CachedCookbook>] cookbooks
426
+ #
427
427
  def print_list(cookbooks)
428
428
  Array(cookbooks).sort.each do |cookbook|
429
429
  Berkshelf.formatter.msg " * #{cookbook.cookbook_name} (#{cookbook.version})"
@@ -28,9 +28,9 @@ module Berkshelf
28
28
 
29
29
  private
30
30
 
31
- # Load the correct location from the given options.
32
- #
33
- # @return [Class, nil]
31
+ # Load the correct location from the given options.
32
+ #
33
+ # @return [Class, nil]
34
34
  def klass_from_options(options)
35
35
  options.each do |key, _|
36
36
  id = key.to_s.capitalize
@@ -511,8 +511,8 @@ module Berkshelf
511
511
  "#<Berkshelf::Lockfile #{Pathname.new(filepath).basename}, dependencies: #{dependencies.inspect}>"
512
512
  end
513
513
 
514
- # The class responsible for parsing the lockfile and turning it into a
515
- # useful data structure.
514
+ # The class responsible for parsing the lockfile and turning it into a
515
+ # useful data structure.
516
516
  class LockfileParser
517
517
  NAME_VERSION = '(?! )(.*?)(?: \(([^-]*)(?:-(.*))?\))?'.freeze
518
518
  DEPENDENCY_PATTERN = /^ {2}#{NAME_VERSION}$/.freeze
@@ -599,9 +599,9 @@ module Berkshelf
599
599
 
600
600
  private
601
601
 
602
- # Parse a dependency line.
603
- #
604
- # @param [String] line
602
+ # Parse a dependency line.
603
+ #
604
+ # @param [String] line
605
605
  def parse_dependency(line)
606
606
  if line =~ DEPENDENCY_PATTERN
607
607
  name, version = $1, $2
@@ -615,9 +615,9 @@ module Berkshelf
615
615
  end
616
616
  end
617
617
 
618
- # Parse a graph line.
619
- #
620
- # @param [String] line
618
+ # Parse a graph line.
619
+ #
620
+ # @param [String] line
621
621
  def parse_graph(line)
622
622
  if line =~ DEPENDENCY_PATTERN
623
623
  name, version = $1, $2
@@ -631,7 +631,7 @@ module Berkshelf
631
631
  end
632
632
  end
633
633
 
634
- # The class representing an internal graph.
634
+ # The class representing an internal graph.
635
635
  class Graph
636
636
  include Enumerable
637
637
 
@@ -64,10 +64,10 @@ module Berkshelf
64
64
 
65
65
  private
66
66
 
67
- # @return [String]
67
+ # @return [String]
68
68
  attr_reader :out_dir
69
69
 
70
- # @return [String]
70
+ # @return [String]
71
71
  attr_reader :filename
72
72
  end
73
73
  end
@@ -45,10 +45,10 @@ module Berkshelf
45
45
 
46
46
  private
47
47
 
48
- # Upload the list of cookbooks to the Chef Server, with some exception
49
- # wrapping.
50
- #
51
- # @param [Array<String>] cookbooks
48
+ # Upload the list of cookbooks to the Chef Server, with some exception
49
+ # wrapping.
50
+ #
51
+ # @param [Array<String>] cookbooks
52
52
  def upload(cookbooks)
53
53
  Berkshelf.log.info "Starting upload"
54
54
 
@@ -1,3 +1,3 @@
1
1
  module Berkshelf
2
- VERSION = "7.0.10".freeze
2
+ VERSION = "7.1.0".freeze
3
3
  end
@@ -84,26 +84,26 @@ module Berkshelf
84
84
 
85
85
  private
86
86
 
87
- # The path to store the local git clones.
88
- #
89
- # @return [Pathname]
87
+ # The path to store the local git clones.
88
+ #
89
+ # @return [Pathname]
90
90
  def clones
91
91
  ensure_and_return(tmp_path.join("clones"))
92
92
  end
93
93
 
94
- # The path to store the git remotes.
95
- #
96
- # @return [Pathname]
94
+ # The path to store the git remotes.
95
+ #
96
+ # @return [Pathname]
97
97
  def remotes
98
98
  ensure_and_return(tmp_path.join("remotes"))
99
99
  end
100
100
 
101
- # Generate a cookbook by the given name.
102
- #
103
- # @param [#to_s] name
104
- # the name of the cookbook to create
105
- # @param [Hash] options
106
- # the list ooptions to pass to the generator
101
+ # Generate a cookbook by the given name.
102
+ #
103
+ # @param [#to_s] name
104
+ # the name of the cookbook to create
105
+ # @param [Hash] options
106
+ # the list ooptions to pass to the generator
107
107
  def generate_git_cookbook(name, options = {})
108
108
  options = {
109
109
  skip_vagrant: true,
@@ -114,12 +114,12 @@ module Berkshelf
114
114
  Berkshelf::Cli.new.invoke(:cookbook, [name.to_s], options)
115
115
  end
116
116
 
117
- # Make sure the given path exists and return the path
118
- #
119
- # @param [#to_s] path
120
- # the path to create and return
121
- #
122
- # @return [Pathname]
117
+ # Make sure the given path exists and return the path
118
+ #
119
+ # @param [#to_s] path
120
+ # the path to create and return
121
+ #
122
+ # @return [Pathname]
123
123
  def ensure_and_return(path)
124
124
  FileUtils.mkdir(path) unless File.exist?(path)
125
125
  Pathname.new(path).expand_path
@@ -50,10 +50,10 @@ module Berkshelf
50
50
 
51
51
  private
52
52
 
53
- # This is the magical "reset" function that gives us a clean working
54
- # directory on each run.
55
- #
56
- # @return [nil]
53
+ # This is the magical "reset" function that gives us a clean working
54
+ # directory on each run.
55
+ #
56
+ # @return [nil]
57
57
  def reload_configs
58
58
  Berkshelf.chef_config = chef_config
59
59
 
@@ -0,0 +1,2 @@
1
+ name 'dep'
2
+ version '1.0.0'
@@ -0,0 +1,3 @@
1
+ name 'ekaf'
2
+ version '1.0.0'
3
+ depends 'dep', '~> 1.0.0'
@@ -0,0 +1,3 @@
1
+ name 'fake'
2
+ version '1.0.0'
3
+ depends 'dep', '~> 1.0.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berkshelf
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.10
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Winsor
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2020-04-27 00:00:00.000000000 Z
15
+ date: 2020-06-25 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: mixlib-shellout
@@ -164,14 +164,14 @@ dependencies:
164
164
  requirements:
165
165
  - - ">="
166
166
  - !ruby/object:Gem::Version
167
- version: 13.6.52
167
+ version: 15.7.32
168
168
  type: :runtime
169
169
  prerelease: false
170
170
  version_requirements: !ruby/object:Gem::Requirement
171
171
  requirements:
172
172
  - - ">="
173
173
  - !ruby/object:Gem::Version
174
- version: 13.6.52
174
+ version: 15.7.32
175
175
  - !ruby/object:Gem::Dependency
176
176
  name: chef-config
177
177
  requirement: !ruby/object:Gem::Requirement
@@ -314,6 +314,21 @@ files:
314
314
  - spec/support/matchers/filepath_matchers.rb
315
315
  - spec/support/path_helpers.rb
316
316
  - spec/support/shared_examples/formatter.rb
317
+ - spec/tmp/berkshelf/cookbooks/dep-1.0.0/attributes/default.rb
318
+ - spec/tmp/berkshelf/cookbooks/dep-1.0.0/files/default/file.h
319
+ - spec/tmp/berkshelf/cookbooks/dep-1.0.0/metadata.rb
320
+ - spec/tmp/berkshelf/cookbooks/dep-1.0.0/recipes/default.rb
321
+ - spec/tmp/berkshelf/cookbooks/dep-1.0.0/templates/default/template.erb
322
+ - spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/attributes/default.rb
323
+ - spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/files/default/file.h
324
+ - spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/metadata.rb
325
+ - spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/recipes/default.rb
326
+ - spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/templates/default/template.erb
327
+ - spec/tmp/berkshelf/cookbooks/fake-1.0.0/attributes/default.rb
328
+ - spec/tmp/berkshelf/cookbooks/fake-1.0.0/files/default/file.h
329
+ - spec/tmp/berkshelf/cookbooks/fake-1.0.0/metadata.rb
330
+ - spec/tmp/berkshelf/cookbooks/fake-1.0.0/recipes/default.rb
331
+ - spec/tmp/berkshelf/cookbooks/fake-1.0.0/templates/default/template.erb
317
332
  - spec/unit/berkshelf/berksfile_spec.rb
318
333
  - spec/unit/berkshelf/berkshelf/api_client/connection_spec.rb
319
334
  - spec/unit/berkshelf/berkshelf/api_client/remote_cookbook_spec.rb