stove 4.0.0 → 4.1.0

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: f8523b3a26a8c2df2b1db61f884976dff941ccd6
4
- data.tar.gz: 35b2772379fa8aa342ea127044c8b49a2f4b19c5
3
+ metadata.gz: 81f9d1281c571d2ef3fb23ea93ceb2b1d435ea60
4
+ data.tar.gz: 7762c7e2004f355e7ad385754e1813573c84f727
5
5
  SHA512:
6
- metadata.gz: 94696e97b331ed3be0e81843e072b830ef0ddd6c4408fcd729eef208fae383694edc83282d5ed618b1fb4541ddcc9e24f1eefd3dd62e26773718b4ec8eebadd6
7
- data.tar.gz: 0916263e890e2947b6cdf5f67e88810f61d1e7d84c42c560d440d832739cea4527b142c9549484ac9b40169ee24c680304b89b5203a0798fbb79b73b024a04de
6
+ metadata.gz: b338e1852007ae23bd882c39b4592aa7a470fa856cb64b3d400cf326010149d85a7cb9a52df29bc2b801411a9d50df1c3d30ee03115dcdb802d316f2e131cf9f
7
+ data.tar.gz: d546ac3c3d3f3b5b9c7a7924f657fcf9f3ddbcc97ec64f8a1caef324c48f4774b97b4b069f87e535e0b6ed8cd28e72ee14af38ed44c040366a76239900f31eb0
@@ -2,6 +2,10 @@
2
2
 
3
3
  This is the Changelog for the Stove gem.
4
4
 
5
+ ## v4.1.0 (2016-06-02)
6
+
7
+ - Support uploading cookbooks to Supermarket that lack a metadata.rb, but have a metadata.json
8
+
5
9
  ## v4.0.0 (2016-05-05)
6
10
 
7
11
  - This version of stove now requires Ruby 2.0 or later
@@ -142,10 +142,13 @@ module Stove
142
142
 
143
143
  def from_file(path)
144
144
  path = path.to_s
145
+ path_json = File.join(File.dirname(path), 'metadata.json')
145
146
 
146
147
  if File.exist?(path) && File.readable?(path)
147
148
  self.instance_eval(IO.read(path), path, 1)
148
149
  self
150
+ elsif File.exist?(path_json) && File.readable?(path_json)
151
+ metadata_from_json(path_json)
149
152
  else
150
153
  raise Error::MetadataNotFound.new(path: path)
151
154
  end
@@ -198,6 +201,14 @@ module Stove
198
201
 
199
202
  private
200
203
 
204
+ def metadata_from_json(path)
205
+ json = JSON.parse(IO.read(path))
206
+ json.keys.each do |key|
207
+ set_or_return(key.to_sym, json[key])
208
+ end
209
+ self
210
+ end
211
+
201
212
  def set_or_return(symbol, arg)
202
213
  iv_symbol = "@#{symbol.to_s}".to_sym
203
214
 
@@ -9,7 +9,7 @@ module Stove
9
9
  def initialize(name = nil)
10
10
  yield self if block_given?
11
11
 
12
- desc 'Publish this cookbook' unless ::Rake.application.last_comment
12
+ desc 'Publish this cookbook' unless ::Rake.application.last_description
13
13
  task(name || :publish) do |t, args|
14
14
  Cli.new(stove_opts || []).execute!
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module Stove
2
- VERSION = '4.0.0'
2
+ VERSION = '4.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stove
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Vargo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-05 00:00:00.000000000 Z
11
+ date: 2016-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-api