berkshelf 7.0.7 → 7.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -3
  3. data/Rakefile +4 -4
  4. data/berkshelf.gemspec +10 -12
  5. data/bin/berks +5 -0
  6. data/lib/berkshelf.rb +8 -9
  7. data/lib/berkshelf/api_client/chef_server_connection.rb +3 -2
  8. data/lib/berkshelf/api_client/connection.rb +1 -1
  9. data/lib/berkshelf/api_client/remote_cookbook.rb +1 -1
  10. data/lib/berkshelf/berksfile.rb +41 -39
  11. data/lib/berkshelf/cached_cookbook.rb +6 -4
  12. data/lib/berkshelf/chef_config_compat.rb +2 -1
  13. data/lib/berkshelf/chef_repo_universe.rb +6 -4
  14. data/lib/berkshelf/cli.rb +6 -6
  15. data/lib/berkshelf/commands/shelf.rb +1 -1
  16. data/lib/berkshelf/community_rest.rb +6 -6
  17. data/lib/berkshelf/config.rb +3 -3
  18. data/lib/berkshelf/cookbook_store.rb +2 -4
  19. data/lib/berkshelf/core_ext.rb +1 -1
  20. data/lib/berkshelf/core_ext/file_utils.rb +3 -3
  21. data/lib/berkshelf/dependency.rb +1 -1
  22. data/lib/berkshelf/downloader.rb +9 -6
  23. data/lib/berkshelf/errors.rb +5 -2
  24. data/lib/berkshelf/file_syncer.rb +7 -12
  25. data/lib/berkshelf/formatters/human.rb +1 -1
  26. data/lib/berkshelf/formatters/json.rb +4 -4
  27. data/lib/berkshelf/installer.rb +1 -1
  28. data/lib/berkshelf/location.rb +3 -3
  29. data/lib/berkshelf/locations/git.rb +6 -12
  30. data/lib/berkshelf/lockfile.rb +14 -14
  31. data/lib/berkshelf/logger.rb +4 -2
  32. data/lib/berkshelf/mixin/git.rb +3 -3
  33. data/lib/berkshelf/packager.rb +5 -7
  34. data/lib/berkshelf/resolver.rb +1 -1
  35. data/lib/berkshelf/ridley_compat.rb +1 -1
  36. data/lib/berkshelf/shell.rb +2 -1
  37. data/lib/berkshelf/shell_out.rb +4 -3
  38. data/lib/berkshelf/source.rb +8 -7
  39. data/lib/berkshelf/source_uri.rb +1 -1
  40. data/lib/berkshelf/ssl_policies.rb +5 -9
  41. data/lib/berkshelf/thor.rb +1 -1
  42. data/lib/berkshelf/thor_ext.rb +1 -1
  43. data/lib/berkshelf/uploader.rb +11 -9
  44. data/lib/berkshelf/validator.rb +2 -8
  45. data/lib/berkshelf/version.rb +1 -1
  46. data/lib/berkshelf/visualizer.rb +3 -3
  47. data/spec/config/knife.rb +1 -1
  48. data/spec/spec_helper.rb +1 -1
  49. data/spec/support/chef_server.rb +2 -2
  50. data/spec/support/git.rb +18 -18
  51. data/spec/support/path_helpers.rb +4 -4
  52. data/spec/unit/berkshelf/berksfile_spec.rb +7 -7
  53. data/spec/unit/berkshelf/cli_spec.rb +1 -2
  54. data/spec/unit/berkshelf/community_rest_spec.rb +1 -1
  55. data/spec/unit/berkshelf/core_ext/file_utils_spec.rb +2 -2
  56. data/spec/unit/berkshelf/dependency_spec.rb +5 -5
  57. data/spec/unit/berkshelf/downloader_spec.rb +4 -8
  58. data/spec/unit/berkshelf/locations/base_spec.rb +1 -2
  59. data/spec/unit/berkshelf/locations/git_spec.rb +2 -5
  60. data/spec/unit/berkshelf/locations/path_spec.rb +1 -2
  61. data/spec/unit/berkshelf/lockfile_spec.rb +9 -18
  62. data/spec/unit/berkshelf/ridley_compat_spec.rb +2 -2
  63. data/spec/unit/berkshelf/source_spec.rb +30 -19
  64. data/spec/unit/berkshelf/ssl_policies_spec.rb +3 -6
  65. data/spec/unit/berkshelf/uploader_spec.rb +6 -10
  66. data/spec/unit/berkshelf/validator_spec.rb +0 -13
  67. metadata +39 -193
  68. data/.github/lock.yml +0 -1
  69. data/.gitignore +0 -30
  70. data/.rubocop.yml +0 -12
  71. data/.travis.yml +0 -73
  72. data/CHANGELOG.legacy.md +0 -307
  73. data/CHANGELOG.md +0 -1589
  74. data/CONTRIBUTING.md +0 -68
  75. data/Gemfile.lock +0 -292
  76. data/PLUGINS.md +0 -25
  77. data/README.md +0 -72
  78. data/Thorfile +0 -61
  79. data/appveyor.yml +0 -31
  80. data/docs/berkshelf_for_newcomers.md +0 -64
  81. data/features/artifactory.feature +0 -70
  82. data/features/berksfile.feature +0 -46
  83. data/features/commands/apply.feature +0 -41
  84. data/features/commands/contingent.feature +0 -47
  85. data/features/commands/info.feature +0 -141
  86. data/features/commands/install.feature +0 -646
  87. data/features/commands/list.feature +0 -78
  88. data/features/commands/outdated.feature +0 -176
  89. data/features/commands/package.feature +0 -17
  90. data/features/commands/search.feature +0 -17
  91. data/features/commands/shelf/list.feature +0 -32
  92. data/features/commands/shelf/show.feature +0 -113
  93. data/features/commands/shelf/uninstall.feature +0 -96
  94. data/features/commands/show.feature +0 -83
  95. data/features/commands/update.feature +0 -142
  96. data/features/commands/upload.feature +0 -499
  97. data/features/commands/vendor.feature +0 -154
  98. data/features/commands/verify.feature +0 -29
  99. data/features/commands/viz.feature +0 -66
  100. data/features/community_site.feature +0 -37
  101. data/features/help.feature +0 -11
  102. data/features/json_formatter.feature +0 -158
  103. data/features/lifecycle.feature +0 -378
  104. data/features/lockfile.feature +0 -378
  105. data/features/step_definitions/berksfile_steps.rb +0 -54
  106. data/features/step_definitions/chef/config_steps.rb +0 -12
  107. data/features/step_definitions/chef_server_steps.rb +0 -60
  108. data/features/step_definitions/cli_steps.rb +0 -18
  109. data/features/step_definitions/config_steps.rb +0 -46
  110. data/features/step_definitions/environment_steps.rb +0 -11
  111. data/features/step_definitions/filesystem_steps.rb +0 -286
  112. data/features/step_definitions/gem_steps.rb +0 -13
  113. data/features/step_definitions/json_steps.rb +0 -29
  114. data/features/step_definitions/utility_steps.rb +0 -11
  115. data/features/support/aruba.rb +0 -12
  116. data/features/support/env.rb +0 -77
  117. data/spec/fixtures/cookbooks/example_cookbook/.gitignore +0 -2
  118. data/spec/fixtures/cookbooks/example_cookbook/.kitchen.yml +0 -26
@@ -1,13 +0,0 @@
1
- Given /^the gem "(.*)" is not installed$/ do |gem_name|
2
- allow(Gem::Specification).to receive(:find_by_name)
3
- .with(gem_name)
4
- .and_raise(Gem::LoadError)
5
- end
6
-
7
- Then /^the output should contain a warning to suggest supporting the option "(.*?)" by installing "(.*?)"$/ do |option, gem_name|
8
- step "the output should contain \"This cookbook was generated with --#{option}, however, #{gem_name} is not installed.\nTo make use of --#{option}: gem install #{gem_name}\""
9
- end
10
-
11
- Then /^the output should contain a warning to suggest supporting the default for "(.*?)" by installing "(.*?)"$/ do |option, gem_name|
12
- step "the output should contain \"By default, this cookbook was generated to support #{gem_name}, however, #{gem_name} is not installed.\nTo skip support for #{gem_name}, use --no-#{option}\"\nTo install #{gem_name}: gem install #{gem_name}"
13
- end
@@ -1,29 +0,0 @@
1
- class Hash
2
- def sort_by_key(&block)
3
- keys.sort(&block).reduce({}) do |seed, key|
4
- seed[key] = self[key]
5
- if seed[key].is_a?(Hash)
6
- seed[key] = seed[key].sort_by_key(&block)
7
- elsif seed[key].is_a?(Array)
8
- seed[key] = seed[key].map do |i|
9
- i.respond_to?(:sort_by_key) ? i.sort_by_key(&block) : i
10
- end
11
- end
12
- seed
13
- end
14
- end
15
- end
16
-
17
- # Pending Ridley allowing newer Faraday and Celluloid.
18
- def clean_json_output(output)
19
- output.gsub(/^.+warning: constant ::Fixnum is deprecated$/, "") \
20
- .gsub(/^.*forwarding to private method Celluloid::PoolManager#url_prefix$/, "")
21
- end
22
-
23
- Then /^the output should contain JSON:$/ do |data|
24
- parsed = ERB.new(data).result
25
- target = JSON.pretty_generate(JSON.parse(parsed).sort_by_key)
26
- actual = JSON.pretty_generate(JSON.parse(all_commands.map { |c| clean_json_output(c.output) }.join("\n")).sort_by_key)
27
-
28
- expect(actual).to eq(target)
29
- end
@@ -1,11 +0,0 @@
1
- Given /^skip\s+"([^\"]+)"$/ do |msg|
2
- skip
3
- end
4
-
5
- Then /the output from \`(.+)\` should be the same as \`(.+)\`/ do |actual, expected|
6
- run(actual)
7
- actual_output = last_command_started.stdout
8
- run(expected)
9
- expected_output = last_command_started.stdout
10
- expect(actual_output).to eql(expected_output)
11
- end
@@ -1,12 +0,0 @@
1
- module Aruba
2
- # Force Aruba to behave like the SpawnProcess Aruba class.
3
- class InProcess
4
- def stdin
5
- @stdin
6
- end
7
-
8
- def output
9
- stdout + stderr
10
- end
11
- end
12
- end
@@ -1,77 +0,0 @@
1
- def windows?
2
- !!(RUBY_PLATFORM =~ /mswin|mingw|windows/)
3
- end
4
-
5
- require "aruba/cucumber"
6
- require "aruba/in_process"
7
- require "aruba/spawn_process"
8
- require "cucumber/rspec/doubles"
9
-
10
- Dir["spec/support/**/*.rb"].each { |f| require File.expand_path(f) }
11
-
12
- World(Berkshelf::RSpec::PathHelpers)
13
-
14
- # these tests used to start a chef-zero server on one port, and a berks-api server on another port
15
- # they now start a chef-zero server that supports the universe endpoint on one port.
16
- #
17
- # if there becomes a need to integration test talking to a supermarket/universe endpoint and then
18
- # talking to a separate chef-server, then these features could be split back up again, but the
19
- # Berkshelf::RSpec::ChefServer helper class would need to support managing multiple chef-zero servers.
20
- CHEF_SERVER_PORT = 26310
21
- BERKS_API_PORT = 26310
22
-
23
- at_exit do
24
- Berkshelf::RSpec::ChefServer.stop
25
- end
26
-
27
- Before do
28
-
29
- # Legacy ENV variables until we can move over to all InProcess
30
- Berkshelf.instance_variable_set(:@berkshelf_path, nil)
31
- ENV["BERKSHELF_PATH"] = berkshelf_path.to_s
32
- ENV["BERKSHELF_CONFIG"] = Berkshelf.config.path.to_s
33
- ENV["BERKSHELF_CHEF_CONFIG"] = chef_config_path.to_s
34
-
35
- aruba.config.command_launcher = :in_process
36
- aruba.config.main_class = Berkshelf::Cli::Runner
37
- @dirs = ["spec/tmp/aruba"] # set aruba's temporary directory
38
-
39
- clean_tmp_path
40
- Berkshelf.initialize_filesystem
41
- Berkshelf::CookbookStore.instance.initialize_filesystem
42
- reload_configs
43
- Berkshelf::CachedCookbook.instance_variable_set(:@loaded_cookbooks, nil)
44
-
45
- # This appears to be dead code
46
- # endpoints = [
47
- # {
48
- # type: "chef_server",
49
- # options: {
50
- # url: "http://localhost:#{CHEF_SERVER_PORT}",
51
- # client_name: "reset",
52
- # client_key: File.expand_path("spec/config/berkshelf.pem"),
53
- # },
54
- # },
55
- # ]
56
-
57
- Berkshelf::RSpec::ChefServer.start(port: CHEF_SERVER_PORT)
58
-
59
- aruba.config.io_wait_timeout = Cucumber::JRUBY ? 7 : 5
60
- @aruba_timeout_seconds = Cucumber::JRUBY ? 35 : 15
61
- end
62
-
63
- Before("@spawn") do
64
- aruba.config.command_launcher = :spawn
65
-
66
- Berkshelf.instance_variable_set(:@berkshelf_path, nil)
67
- set_environment_variable("BERKSHELF_PATH", berkshelf_path.to_s)
68
- set_environment_variable("BERKSHELF_CONFIG", Berkshelf.config.path.to_s)
69
- set_environment_variable("BERKSHELF_CHEF_CONFIG", chef_config_path.to_s)
70
- end
71
-
72
- Before("@slow_process") do
73
- aruba.config.io_wait_timeout = Cucumber::JRUBY ? 70 : 30
74
- @aruba_timeout_seconds = Cucumber::JRUBY ? 140 : 60
75
- end
76
-
77
- require "berkshelf/cli"
@@ -1,2 +0,0 @@
1
- .kitchen/
2
- .kitchen.local.yml
@@ -1,26 +0,0 @@
1
- ---
2
- driver_plugin: vagrant
3
-
4
- platforms:
5
- - name: ubuntu-12.04
6
- driver_config:
7
- box: canonical-ubuntu-12.04
8
- box_url: http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box
9
- require_chef_omnibus: true
10
- - name: ubuntu-10.04
11
- driver_config:
12
- box: opscode-ubuntu-10.04
13
- box_url: http://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-10.04_chef-11.2.0.box
14
- - name: centos-6.3
15
- driver_config:
16
- box: opscode-centos-6.3
17
- box_url: http://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-6.3_chef-11.2.0.box
18
- - name: centos-5.8
19
- driver_config:
20
- box: opscode-centos-5.8
21
- box_url: http://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-5.8_chef-11.2.0.box
22
-
23
- suites:
24
- - name: default
25
- run_list: []
26
- attributes: {}