berktacular 1.0.0 → 1.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6406cbc6a3da17b4bf06d75953d84b6ab648b08
4
- data.tar.gz: f05fdf6ac3fc1087f94b0147280c254d083f4f0f
3
+ metadata.gz: eeb6b4f68edec2f117fac5fe278528a608a147e7
4
+ data.tar.gz: bfac47d7cf35f86f56eb4d424b55f7b5684d85c7
5
5
  SHA512:
6
- metadata.gz: e4c097ae8d61574ea027f200ab651294b3f3045dce6e81434e6f7b8c55f16b5476ae6d0f15770c1b15afe06eca9592c2e2c16be0bc71f994dd4da71fe21a7600
7
- data.tar.gz: 5b3c6047f2c51cd241423ea341586273b14e3b5f2940b14a678bc11bdd0c2a9e9f314533b48cb612cb5aee1ace1a27706752ecd1417c9e410f4a8505f098c67a
6
+ metadata.gz: 067c4df6bf09bfc3891017c04c77b737a290cb28e1c435e0f4e79706b8d61c113bcb45536f387747a9aea951f82cabd0f77a727898fe09ca0a549d703e2c2336
7
+ data.tar.gz: 54674b306779da178c450f63783a60012d66e23fd57bc16b8c91868e79c29e3889fa38246bd47282de66c8b1fbb58871e1f3846ee5cda5454bccf245561a3b3a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -205,7 +205,7 @@ module Berktacular
205
205
  candidates = b.check_updates
206
206
  next unless candidates.any?
207
207
  puts "Cookbook: #{b.name} (auto upgrade: #{b.auto_upgrade ? 'enabled' : 'disabled'})",
208
- "\tCurrent:#{b.version_number}",
208
+ "\tCurrent: #{b.version_number}",
209
209
  "\tUpdates: #{candidates.join(", ")}"
210
210
  end
211
211
  end
@@ -218,7 +218,10 @@ module Berktacular
218
218
  raise "No token given, can't connect to git" unless @opts[:github_token]
219
219
  puts "Connecting to git with supplied github_token" if @opts[:verbose]
220
220
  require 'octokit'
221
- @opts[:git_client] ||= Octokit::Client.new(access_token: @opts[:github_token])
221
+ @opts[:git_client] ||= Octokit::Client.new(
222
+ access_token: @opts[:github_token],
223
+ auto_paginate: true
224
+ )
222
225
  end
223
226
 
224
227
  def metadata_from_json(json_str)
@@ -61,15 +61,17 @@ module Berktacular
61
61
 
62
62
  # @return [Array] a list of available cookbook version newer then we started with, with most recent first
63
63
  def check_updates
64
+ tag_re = Regexp.new(
65
+ "^#{ (@config || {})['tag'] || '%{version}' }$" % { :version => "(#{VERSION_RE.source})" }
66
+ )
64
67
  @candidates ||= if @config && @config['github']
65
68
  get_tags_from_github
66
69
  else
67
70
  []
68
71
  end.collect do |tag|
69
- next if @config.has_key?('rel') && ! /^#{@name}-[v\d]/.match(tag)
70
- m = VERSION_RE.match(tag)
72
+ m = tag_re.match(tag)
71
73
  next unless m
72
- v = m[0]
74
+ v = m[1]
73
75
  begin
74
76
  t = Semverse::Version.new(v)
75
77
  rescue Semverse::InvalidVersionFormat
@@ -111,7 +113,12 @@ module Berktacular
111
113
 
112
114
  # return [Array] a list of tags from the github repository of this cookbook.
113
115
  def get_tags_from_github
114
- @git_client.repo(@config['github']).rels[:tags].get.data.map { |obj| obj.name }
116
+ @@tags_cache ||= {}
117
+ repo_path = @config['github']
118
+ return @@tags_cache[repo_path] if @@tags_cache[repo_path]
119
+ tags = @git_client.tags(@config['github']).map { |obj| obj.name }
120
+ @@tags_cache[repo_path] = tags
121
+ tags
115
122
  end
116
123
 
117
124
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berktacular
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Harvey-Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-09 00:00:00.000000000 Z
11
+ date: 2014-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solve