knife-supermarket 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: bcc161bf2cd8fd29483a6e6edaef9ce22e81e13c
4
- data.tar.gz: b6e10ebb089cfb2aa93ac9dcb46b30ea83084ef2
3
+ metadata.gz: 8474981819bce841989f81880315cfda302b7a93
4
+ data.tar.gz: 66872e5a548a8d94e415e2ae2d13ddadbd71fa67
5
5
  SHA512:
6
- metadata.gz: 83910ba6e26da78c05f5df73e3a53f02a229fa3fc7f022b85df97b15fafdc5647964e14be8fc85c0a9f48391403d41e5c9b2734e22a8e30d7141b4e81d9bf43e
7
- data.tar.gz: 1fd733b3f5f2d39b15b2d9ff370faffb0c2625d4d53486966f4b3acf994159177af8a79a42374cbe81d01a5336cdcdc0ff89d24b141fdead528713ae78a02568
6
+ metadata.gz: e29ed028e2a28e238d39501b871f93980980737fdd1e55beea1ad512c3de6b6830f689bced4ac2083fb11eb8faf27cd52aac2350e5300cf29b88070baff302a0
7
+ data.tar.gz: ab5b5d0ba35d16cc7a0f70d3a51fbcaf7a024ea81d85141e3145ccbb7f73dfdf4af176815b02819e22ca927ecdb4ac923664df7c72b48785f7569c474a5a056b
@@ -1,3 +1,6 @@
1
+ ## v0.2.1
2
+ * Pass empty string for category
3
+
1
4
  ## v0.2.0
2
5
  * Add support for specifying --cookbook-path on `knife supermarket share`
3
6
 
@@ -22,7 +22,7 @@ class Chef
22
22
  class Knife
23
23
  class SupermarketShare < Knife::CookbookSiteShare
24
24
 
25
- banner "knife supermarket share COOKBOOK CATEGORY (options)"
25
+ banner "knife supermarket share COOKBOOK (options)"
26
26
  category "supermarket"
27
27
 
28
28
  deps do
@@ -44,10 +44,26 @@ class Chef
44
44
  :description => "A colon-separated path to look for cookbooks in",
45
45
  :proc => lambda { |o| Chef::Config.cookbook_path = o.split(":") }
46
46
 
47
+ # since we subclass cookbook_site and it expects a category, pass a phantom empty category
48
+ # parameter before invoking Chef::Knife::CookbookSiteShare#run ...
49
+ # Tested on 11.16.4 and 12.0.3.
50
+ def run
51
+ @name_args << "" if @name_args.length == 1
52
+ super
53
+ end
47
54
  def do_upload(cookbook_filename, cookbook_category, user_id, user_secret_filename)
48
55
  uri = "#{config[:supermarket_site]}/api/v1/cookbooks"
49
56
 
50
- category_string = { 'category'=>cookbook_category }.to_json
57
+ # Categories are optional both in knife cookbook site
58
+ # (which this plugin seeks to replace) and on the
59
+ # Supermarket community site. Best practice now
60
+ # seems to be to just omit the category entirely.
61
+ #
62
+ # see:
63
+ # https://github.com/chef/supermarket/pull/915
64
+ # https://github.com/chef/chef/pull/2198
65
+
66
+ category_string = { 'category'=>'' }.to_json
51
67
 
52
68
  http_resp = Chef::CookbookSiteStreamingUploader.post(uri, user_id, user_secret_filename, {
53
69
  :tarball => File.open(cookbook_filename),
@@ -1,6 +1,6 @@
1
1
  module Knife
2
2
  module Supermarket
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  MAJOR, MINOR, TINY = VERSION.split('.')
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-supermarket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Webber
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-11 00:00:00.000000000 Z
11
+ date: 2015-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef