puppetfile-updater 0.2.1 → 0.3.0
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 +8 -8
- data/README.md +1 -0
- data/lib/puppetfile-updater/task.rb +17 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzYyZDZiNzAxNzA4Njg4MjEwYjFjODViMDMzZDNkNjcxNGJjMTA4NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTk2NTgxNGZlMjcyZDg2Y2I3NjlmMmJjOGJlMGY3YjJjMTYxNzc0Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzYzNjQ4ODhiMDFiYTlhOWYwYzM1YmMxZmRlZTE5NGNkMjEyZDc2NDE4ODJl
|
10
|
+
MjMyMmU5MjljMjI0ZWM1ZDQ5ODliNWQ0ZDA2YmFmOTcwNTZiMmUxNjg4YzUz
|
11
|
+
YjJiYTI5MzQ4OGE4MjJiNzMzYjJkOTlhZDBhN2U1ZTc5ZjY5N2U=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmFiNDIzNmIxODFkNWE1M2NmOGFkMzlhZDA4MDc5MjgwZWQ5Njg4MDJhZmNk
|
14
|
+
ZGViZDllNjdlMWI0ZGRjZWJlMmU0YTJkNDUxZDM2ZWM3MThhNDI1NDk2ZjI0
|
15
|
+
YzI1NzM3ZmEzYTg0YmMxMTFmNDMyODFmYjcyZjIzYWM5NDBhYzU=
|
data/README.md
CHANGED
@@ -16,6 +16,7 @@ class PuppetfileUpdater
|
|
16
16
|
attr_accessor :major
|
17
17
|
attr_accessor :gh_login
|
18
18
|
attr_accessor :gh_password
|
19
|
+
attr_accessor :debug
|
19
20
|
|
20
21
|
# Public: Initialise a new PuppetfileUpdater::RakeTask.
|
21
22
|
#
|
@@ -60,28 +61,43 @@ class PuppetfileUpdater
|
|
60
61
|
)
|
61
62
|
aug.load!
|
62
63
|
|
64
|
+
error_path = '/augeas/files/Puppetfile/error'
|
65
|
+
unless aug.match('/augeas/files/Puppetfile/error').size == 0
|
66
|
+
msg = "Failed to parse Puppetfile at line #{aug.get(error_path+'/line')}, "
|
67
|
+
msg << "character #{aug.get(error_path+'/char')}: "
|
68
|
+
msg << aug.get('/augeas/files/Puppetfile/error/message')
|
69
|
+
abort msg
|
70
|
+
end
|
71
|
+
|
63
72
|
# Update from GitHub
|
64
73
|
aug.match("/files/Puppetfile/*[git=~regexp('.*/#{@user}/.*')]").each do |mpath|
|
65
74
|
m = aug.get(mpath)
|
75
|
+
puts "D: Considering #{m} for git update" if @debug
|
66
76
|
next if !@module.nil? && @module != m.gsub(%r{.*[-/]}, '')
|
77
|
+
puts "D: #{m} selected by filters" if @debug
|
67
78
|
|
68
79
|
warn "W: #{m} is a fork!" unless m =~ /#{@user}/
|
69
80
|
|
70
81
|
git_url = aug.get("#{mpath}/git")
|
71
82
|
repo = Octokit::Repository.from_url(git_url.gsub(/\.git$/, ''))
|
72
83
|
commits = github.commits(repo)
|
73
|
-
|
84
|
+
ref = commits[0].sha[0...7]
|
85
|
+
puts "D: New ref for #{m} is #{ref}" if @debug
|
86
|
+
aug.set("#{mpath}/ref", ref)
|
74
87
|
end
|
75
88
|
|
76
89
|
# Update from Forge
|
77
90
|
PuppetForge.user_agent = 'Puppetfile-Updater/0.1.0'
|
78
91
|
aug.match("/files/Puppetfile/*[label()!='#comment' and .=~regexp('#{@user}/.*') and @version]").each do |mpath|
|
79
92
|
m = aug.get(mpath).gsub('/', '-')
|
93
|
+
puts "D: Considering #{m} for forge update" if @debug
|
80
94
|
next if !@module.nil? && @module != m.gsub(%r{.*[-/]}, '')
|
95
|
+
puts "D: #{m} selected by filters"
|
81
96
|
v = aug.get("#{mpath}/@version")
|
82
97
|
forge_m = PuppetForge::Module.find(m)
|
83
98
|
release = forge_m.releases.select { |r| r.deleted_at.nil? }[0]
|
84
99
|
new_v = release.version
|
100
|
+
puts "D: New version for #{m} is #{new_v}" if @debug
|
85
101
|
if new_v.split('.')[0] != v.split('.')[0]
|
86
102
|
if @major
|
87
103
|
warn "W: #{m} has incompatible changes between #{v} and #{new_v}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppetfile-updater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Camptocamp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|