berkshelf 7.0.6 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -7
  3. data/Rakefile +2 -2
  4. data/berkshelf.gemspec +9 -10
  5. data/bin/berks +5 -0
  6. data/lib/berkshelf.rb +2 -2
  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/berksfile.rb +47 -41
  10. data/lib/berkshelf/cached_cookbook.rb +6 -4
  11. data/lib/berkshelf/chef_config_compat.rb +1 -0
  12. data/lib/berkshelf/chef_repo_universe.rb +6 -4
  13. data/lib/berkshelf/cli.rb +12 -7
  14. data/lib/berkshelf/commands/shelf.rb +1 -1
  15. data/lib/berkshelf/community_rest.rb +4 -4
  16. data/lib/berkshelf/config.rb +1 -1
  17. data/lib/berkshelf/core_ext.rb +1 -1
  18. data/lib/berkshelf/core_ext/file_utils.rb +2 -2
  19. data/lib/berkshelf/dependency.rb +1 -1
  20. data/lib/berkshelf/downloader.rb +10 -3
  21. data/lib/berkshelf/errors.rb +2 -2
  22. data/lib/berkshelf/formatters/human.rb +1 -1
  23. data/lib/berkshelf/formatters/json.rb +4 -4
  24. data/lib/berkshelf/installer.rb +1 -1
  25. data/lib/berkshelf/location.rb +3 -3
  26. data/lib/berkshelf/lockfile.rb +14 -14
  27. data/lib/berkshelf/logger.rb +4 -2
  28. data/lib/berkshelf/mixin/git.rb +1 -1
  29. data/lib/berkshelf/packager.rb +2 -2
  30. data/lib/berkshelf/resolver.rb +1 -1
  31. data/lib/berkshelf/ridley_compat.rb +1 -1
  32. data/lib/berkshelf/shell.rb +1 -0
  33. data/lib/berkshelf/source.rb +6 -5
  34. data/lib/berkshelf/ssl_policies.rb +1 -3
  35. data/lib/berkshelf/thor.rb +1 -1
  36. data/lib/berkshelf/thor_ext.rb +1 -1
  37. data/lib/berkshelf/uploader.rb +11 -9
  38. data/lib/berkshelf/version.rb +1 -1
  39. data/lib/berkshelf/visualizer.rb +1 -1
  40. data/spec/config/knife.rb +1 -1
  41. data/spec/support/chef_server.rb +2 -2
  42. data/spec/support/git.rb +18 -18
  43. data/spec/support/path_helpers.rb +4 -4
  44. data/spec/tmp/berkshelf/cookbooks/dep-1.0.0/attributes/default.rb +0 -0
  45. data/spec/tmp/berkshelf/cookbooks/dep-1.0.0/files/default/file.h +0 -0
  46. data/spec/tmp/berkshelf/cookbooks/dep-1.0.0/metadata.rb +2 -0
  47. data/spec/tmp/berkshelf/cookbooks/dep-1.0.0/recipes/default.rb +0 -0
  48. data/spec/tmp/berkshelf/cookbooks/dep-1.0.0/templates/default/template.erb +0 -0
  49. data/spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/attributes/default.rb +0 -0
  50. data/spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/files/default/file.h +0 -0
  51. data/spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/metadata.rb +3 -0
  52. data/spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/recipes/default.rb +0 -0
  53. data/spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/templates/default/template.erb +0 -0
  54. data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/attributes/default.rb +0 -0
  55. data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/files/default/file.h +0 -0
  56. data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/metadata.rb +3 -0
  57. data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/recipes/default.rb +0 -0
  58. data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/templates/default/template.erb +0 -0
  59. data/spec/unit/berkshelf/berksfile_spec.rb +7 -7
  60. data/spec/unit/berkshelf/cli_spec.rb +1 -2
  61. data/spec/unit/berkshelf/community_rest_spec.rb +1 -1
  62. data/spec/unit/berkshelf/core_ext/file_utils_spec.rb +2 -2
  63. data/spec/unit/berkshelf/dependency_spec.rb +5 -5
  64. data/spec/unit/berkshelf/downloader_spec.rb +29 -8
  65. data/spec/unit/berkshelf/locations/base_spec.rb +1 -2
  66. data/spec/unit/berkshelf/locations/path_spec.rb +1 -2
  67. data/spec/unit/berkshelf/lockfile_spec.rb +9 -18
  68. data/spec/unit/berkshelf/ridley_compat_spec.rb +1 -1
  69. data/spec/unit/berkshelf/source_spec.rb +8 -7
  70. data/spec/unit/berkshelf/ssl_policies_spec.rb +3 -5
  71. data/spec/unit/berkshelf/uploader_spec.rb +6 -10
  72. metadata +49 -188
  73. data/.github/lock.yml +0 -1
  74. data/.gitignore +0 -30
  75. data/.rubocop.yml +0 -12
  76. data/.travis.yml +0 -73
  77. data/CHANGELOG.legacy.md +0 -307
  78. data/CHANGELOG.md +0 -1582
  79. data/CONTRIBUTING.md +0 -68
  80. data/Gemfile.lock +0 -301
  81. data/PLUGINS.md +0 -25
  82. data/README.md +0 -72
  83. data/Thorfile +0 -61
  84. data/appveyor.yml +0 -31
  85. data/docs/berkshelf_for_newcomers.md +0 -64
  86. data/features/artifactory.feature +0 -70
  87. data/features/berksfile.feature +0 -46
  88. data/features/commands/apply.feature +0 -41
  89. data/features/commands/contingent.feature +0 -47
  90. data/features/commands/info.feature +0 -141
  91. data/features/commands/install.feature +0 -646
  92. data/features/commands/list.feature +0 -78
  93. data/features/commands/outdated.feature +0 -127
  94. data/features/commands/package.feature +0 -17
  95. data/features/commands/search.feature +0 -17
  96. data/features/commands/shelf/list.feature +0 -32
  97. data/features/commands/shelf/show.feature +0 -113
  98. data/features/commands/shelf/uninstall.feature +0 -96
  99. data/features/commands/show.feature +0 -83
  100. data/features/commands/update.feature +0 -142
  101. data/features/commands/upload.feature +0 -499
  102. data/features/commands/vendor.feature +0 -154
  103. data/features/commands/verify.feature +0 -29
  104. data/features/commands/viz.feature +0 -66
  105. data/features/community_site.feature +0 -37
  106. data/features/help.feature +0 -11
  107. data/features/json_formatter.feature +0 -158
  108. data/features/lifecycle.feature +0 -378
  109. data/features/lockfile.feature +0 -378
  110. data/features/step_definitions/berksfile_steps.rb +0 -54
  111. data/features/step_definitions/chef/config_steps.rb +0 -12
  112. data/features/step_definitions/chef_server_steps.rb +0 -60
  113. data/features/step_definitions/cli_steps.rb +0 -18
  114. data/features/step_definitions/config_steps.rb +0 -46
  115. data/features/step_definitions/environment_steps.rb +0 -11
  116. data/features/step_definitions/filesystem_steps.rb +0 -286
  117. data/features/step_definitions/gem_steps.rb +0 -13
  118. data/features/step_definitions/json_steps.rb +0 -29
  119. data/features/step_definitions/utility_steps.rb +0 -11
  120. data/features/support/aruba.rb +0 -12
  121. data/features/support/env.rb +0 -77
  122. data/spec/fixtures/cookbooks/example_cookbook/.gitignore +0 -2
  123. 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: {}