berktacular 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/berktacular/berksfile.rb +5 -2
- data/lib/berktacular/cookbook.rb +11 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eeb6b4f68edec2f117fac5fe278528a608a147e7
|
4
|
+
data.tar.gz: bfac47d7cf35f86f56eb4d424b55f7b5684d85c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 067c4df6bf09bfc3891017c04c77b737a290cb28e1c435e0f4e79706b8d61c113bcb45536f387747a9aea951f82cabd0f77a727898fe09ca0a549d703e2c2336
|
7
|
+
data.tar.gz: 54674b306779da178c450f63783a60012d66e23fd57bc16b8c91868e79c29e3889fa38246bd47282de66c8b1fbb58871e1f3846ee5cda5454bccf245561a3b3a
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.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
|
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(
|
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)
|
data/lib/berktacular/cookbook.rb
CHANGED
@@ -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
|
-
|
70
|
-
m = VERSION_RE.match(tag)
|
72
|
+
m = tag_re.match(tag)
|
71
73
|
next unless m
|
72
|
-
v = m[
|
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
|
-
|
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.
|
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-
|
11
|
+
date: 2014-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solve
|