simp-rake-helpers 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODk1NjE0ZDMwY2E2YzkxODJhN2M0MTBmOGMzZjJmYzNjNmYxM2NhOQ==
4
+ YmY2NThjNDVjYjQ0YWNhMjdhYTE3MmE0OGQ5N2IxMjU1NjMwYjRkOQ==
5
5
  data.tar.gz: !binary |-
6
- MWQwOTA1NjEzZTEwZjEwOGMxYzU3MjA1MjY1MjJkYTZlMzZkZjI4MA==
6
+ YmEwOWM1YTRlZTRiZDc3YjljY2ZjMGU2MTlhNjhiMDA3M2VjZjM5ZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjUzOWYxZWMyZmFiMmQxOWRhNDU0ZjcwYjgzZGZmNDdiMzg5N2RhNWZiMmNh
10
- MDY3ZmE4NWYwN2ExZDE2YTEwZjQ2MmIyMWE2ZTY2NzUwZDA0NTA0ODVhOTYy
11
- YjhmMzM5YzM3MGFmYTVmNzc5Yzg0NTNlZDliZjI2ZDdlZGM5OTU=
9
+ NWI5ODIwMWZlNzA5NDI0OTMxMjcwODk0NWExYWJmNDZjOTE5NDhhYmM5YjJm
10
+ MTA5ZDQwM2E3MDFkNWZkOTg2YjI2ZDIxYTdjY2Y5Zjk0YmVkZjk0OGUxMmMz
11
+ NTdjNDEwMjlmNWE5NzM0YzBmNjkxZGIzOWJhMjkwYjE3NWVhYjY=
12
12
  data.tar.gz: !binary |-
13
- ODExOWRjNjQxMGQxNWNhNTQxNjUxMmNkMjBiNTE4ODlmMjc2NmUwYzg2NDdi
14
- MGI0ZTgyMGUwZWRkMTk1MGU2ZDMwNDVhMzBmMTBjODU0NjdiZjE3YmNhZDdm
15
- YTE1OTZjOTUxNDNhN2Q5NmU2YjBjNGI0ZWExM2UxOGVlNzZhNjA=
13
+ NDFlNWY3YWIyOTIzZjU0ZWI0NDNiZDliMDM0MWZjNGMzMGVhNjE4MTJhOGI1
14
+ ZTFhMWU3ZDc5YTI0ZTA2MDE0MDQzMjVlNzViYTllYmVlYzZmNGE3NDM2MzEz
15
+ YzU2Y2VhYzA0Nzc5MTA1N2ZiMjcxYTliOTM1NzVhYmYwZjliNDI=
data/README.md CHANGED
@@ -46,10 +46,19 @@ gem_sources.each { |gem_source| source gem_source }
46
46
 
47
47
  group :test do
48
48
  gem 'puppet', puppetversion
49
-
50
- # Something in the test suites has issues with Hiera 3.1+
51
- # See https://tickets.puppetlabs.com/browse/HI-505
52
- gem 'hiera', '~> 3.0.0'
49
+ gem 'beaker-rspec'
50
+ gem 'vagrant-wrapper'
51
+
52
+ # Puppet 4+ has issues with Hiera 3.1+
53
+ if puppetversion.to_s =~ />(\d+)/
54
+ pversion = $1
55
+ else
56
+ pversion = puppetversion
57
+ end
58
+
59
+ if Gem::Dependency.new('puppet', '~> 4.0').match?('puppet', pversion)
60
+ gem 'hiera', '~> 3.0.0'
61
+ end
53
62
 
54
63
  # simp-rake-helpers does not suport puppet 2.7.X
55
64
  if "#{ENV['PUPPET_VERSION']}".scan(/\d+/).first != '2' &&
@@ -106,7 +106,11 @@ end
106
106
  module Simp; end
107
107
  module Simp::Rake; end
108
108
  module Simp::Rake::Build
109
+
109
110
  class Deps < ::Rake::TaskLib
111
+ require 'pager'
112
+ include Pager
113
+
110
114
  def initialize( base_dir )
111
115
  @base_dir = base_dir
112
116
  define_tasks
@@ -136,6 +140,82 @@ module Simp::Rake::Build
136
140
  FileUtils.remove_entry_secure "Puppetfile"
137
141
  end
138
142
 
143
+ desc <<-EOM
144
+ Provide a log of changes to all modules from the given top level Git reference.
145
+
146
+ Arguments:
147
+ * :ref => The git ref to use as the oldest point for all logs.
148
+ EOM
149
+ task :changelog, [:ref] do |t,args|
150
+ method = 'tracking'
151
+
152
+ git_logs = Hash.new
153
+
154
+ Dir.chdir(@base_dir) do
155
+
156
+ ref = args[:ref]
157
+ refdate = nil
158
+ begin
159
+ refdate = %x(git log -1 --format=%ai #{ref}).chomp
160
+ refdate = nil unless $?.success?
161
+ rescue Exception
162
+ #noop
163
+ end
164
+
165
+ fail("You must specify a valid reference") unless ref
166
+ fail("Could not find a Git log for #{ref}") unless refdate
167
+
168
+ fake_lp = FakeLibrarian.new("Puppetfile.#{method}")
169
+ mods_with_changes = {}
170
+
171
+ # Need to fake this one to run at the top level
172
+ base_module = {
173
+ 'simp-core' => {
174
+ :git => 'undef',
175
+ :ref => ref,
176
+ :path => '.'
177
+ }
178
+ }
179
+
180
+ # Gather up the top level first
181
+ log_output = %x(git log --since='#{refdate}' --stat --reverse).chomp
182
+ git_logs['__SIMP CORE__'] = log_output unless log_output.strip.empty?
183
+
184
+ fake_lp.each_module do |environment, name, path|
185
+ unless File.directory?(path)
186
+ $stderr.puts("Warning: '#{path}' is not a module...skipping")
187
+ next
188
+ end
189
+
190
+ repo = Librarian::Puppet::Source::Git::Repository.new(environment,path)
191
+
192
+ if repo.path && File.directory?(repo.path)
193
+ Dir.chdir(repo.path) do
194
+ log_output = %x(git log --since='#{refdate}' --stat --reverse).chomp
195
+
196
+ git_logs[name] = log_output unless log_output.strip.empty?
197
+ end
198
+ end
199
+ end
200
+
201
+ if git_logs.empty?
202
+ puts "No changes found for any components since '#{refdate}'"
203
+ else
204
+ page
205
+
206
+ git_logs.keys.sort.each do |mod_name|
207
+ puts <<-EOM
208
+ ========
209
+ #{mod_name}:
210
+
211
+ #{git_logs[mod_name].gsub(/^/,' ')}
212
+
213
+ EOM
214
+ end
215
+ end
216
+ end
217
+ end
218
+
139
219
  desc <<-EOM
140
220
  Get the status of the project Git repositories
141
221
 
@@ -146,7 +226,7 @@ module Simp::Rake::Build
146
226
  EOM
147
227
  task :status, [:method] do |t,args|
148
228
  args.with_defaults(:method => 'tracking')
149
- Dir.chdir @base_dir
229
+ Dir.chdir(@base_dir)
150
230
  @dirty_repos = nil
151
231
 
152
232
  fake_lp = FakeLibrarian.new("Puppetfile.#{args[:method]}")
@@ -2,5 +2,5 @@ module Simp; end
2
2
  module Simp::Rake; end
3
3
 
4
4
  class Simp::Rake::Helpers
5
- VERSION = '1.2.1'
5
+ VERSION = '1.3.0'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-rake-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-03-24 00:00:00.000000000 Z
12
+ date: 2016-03-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -17,98 +17,98 @@ dependencies:
17
17
  requirements:
18
18
  - - ~>
19
19
  - !ruby/object:Gem::Version
20
- version: '1'
20
+ version: '1.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ~>
26
26
  - !ruby/object:Gem::Version
27
- version: '1'
27
+ version: '1.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ~>
33
33
  - !ruby/object:Gem::Version
34
- version: '10'
34
+ version: '10.0'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - ~>
40
40
  - !ruby/object:Gem::Version
41
- version: '10'
41
+ version: '10.0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: coderay
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ~>
47
47
  - !ruby/object:Gem::Version
48
- version: '1'
48
+ version: '1.0'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - ~>
54
54
  - !ruby/object:Gem::Version
55
- version: '1'
55
+ version: '1.0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: puppet
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - ! '>='
61
61
  - !ruby/object:Gem::Version
62
- version: '3'
62
+ version: '3.0'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - ! '>='
68
68
  - !ruby/object:Gem::Version
69
- version: '3'
69
+ version: '3.0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: puppet-lint
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - ~>
75
75
  - !ruby/object:Gem::Version
76
- version: '1'
76
+ version: '1.0'
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - ~>
82
82
  - !ruby/object:Gem::Version
83
- version: '1'
83
+ version: '1.0'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: puppetlabs_spec_helper
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - ~>
89
89
  - !ruby/object:Gem::Version
90
- version: '0'
90
+ version: '0.0'
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - ~>
96
96
  - !ruby/object:Gem::Version
97
- version: '0'
97
+ version: '0.0'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: parallel
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - ~>
103
103
  - !ruby/object:Gem::Version
104
- version: '1'
104
+ version: '1.0'
105
105
  type: :runtime
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - ~>
110
110
  - !ruby/object:Gem::Version
111
- version: '1'
111
+ version: '1.0'
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: simp-rspec-puppet-facts
114
114
  requirement: !ruby/object:Gem::Requirement
@@ -165,6 +165,20 @@ dependencies:
165
165
  - - ~>
166
166
  - !ruby/object:Gem::Version
167
167
  version: '2.4'
168
+ - !ruby/object:Gem::Dependency
169
+ name: pager
170
+ requirement: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ! '>='
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ type: :runtime
176
+ prerelease: false
177
+ version_requirements: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - ! '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
168
182
  - !ruby/object:Gem::Dependency
169
183
  name: gitlog-md
170
184
  requirement: !ruby/object:Gem::Requirement
@@ -185,28 +199,28 @@ dependencies:
185
199
  requirements:
186
200
  - - ~>
187
201
  - !ruby/object:Gem::Version
188
- version: '0'
202
+ version: '0.0'
189
203
  type: :development
190
204
  prerelease: false
191
205
  version_requirements: !ruby/object:Gem::Requirement
192
206
  requirements:
193
207
  - - ~>
194
208
  - !ruby/object:Gem::Version
195
- version: '0'
209
+ version: '0.0'
196
210
  - !ruby/object:Gem::Dependency
197
211
  name: pry-doc
198
212
  requirement: !ruby/object:Gem::Requirement
199
213
  requirements:
200
214
  - - ~>
201
215
  - !ruby/object:Gem::Version
202
- version: '0'
216
+ version: '0.0'
203
217
  type: :development
204
218
  prerelease: false
205
219
  version_requirements: !ruby/object:Gem::Requirement
206
220
  requirements:
207
221
  - - ~>
208
222
  - !ruby/object:Gem::Version
209
- version: '0'
223
+ version: '0.0'
210
224
  - !ruby/object:Gem::Dependency
211
225
  name: highline
212
226
  requirement: !ruby/object:Gem::Requirement
@@ -233,98 +247,98 @@ dependencies:
233
247
  requirements:
234
248
  - - ~>
235
249
  - !ruby/object:Gem::Version
236
- version: '3'
250
+ version: '3.0'
237
251
  type: :development
238
252
  prerelease: false
239
253
  version_requirements: !ruby/object:Gem::Requirement
240
254
  requirements:
241
255
  - - ~>
242
256
  - !ruby/object:Gem::Version
243
- version: '3'
257
+ version: '3.0'
244
258
  - !ruby/object:Gem::Dependency
245
259
  name: guard
246
260
  requirement: !ruby/object:Gem::Requirement
247
261
  requirements:
248
262
  - - ~>
249
263
  - !ruby/object:Gem::Version
250
- version: '2'
264
+ version: '2.0'
251
265
  type: :development
252
266
  prerelease: false
253
267
  version_requirements: !ruby/object:Gem::Requirement
254
268
  requirements:
255
269
  - - ~>
256
270
  - !ruby/object:Gem::Version
257
- version: '2'
271
+ version: '2.0'
258
272
  - !ruby/object:Gem::Dependency
259
273
  name: guard-shell
260
274
  requirement: !ruby/object:Gem::Requirement
261
275
  requirements:
262
276
  - - ~>
263
277
  - !ruby/object:Gem::Version
264
- version: '0'
278
+ version: '0.0'
265
279
  type: :development
266
280
  prerelease: false
267
281
  version_requirements: !ruby/object:Gem::Requirement
268
282
  requirements:
269
283
  - - ~>
270
284
  - !ruby/object:Gem::Version
271
- version: '0'
285
+ version: '0.0'
272
286
  - !ruby/object:Gem::Dependency
273
287
  name: guard-rspec
274
288
  requirement: !ruby/object:Gem::Requirement
275
289
  requirements:
276
290
  - - ~>
277
291
  - !ruby/object:Gem::Version
278
- version: '4'
292
+ version: '4.0'
279
293
  type: :development
280
294
  prerelease: false
281
295
  version_requirements: !ruby/object:Gem::Requirement
282
296
  requirements:
283
297
  - - ~>
284
298
  - !ruby/object:Gem::Version
285
- version: '4'
299
+ version: '4.0'
286
300
  - !ruby/object:Gem::Dependency
287
301
  name: beaker
288
302
  requirement: !ruby/object:Gem::Requirement
289
303
  requirements:
290
304
  - - ~>
291
305
  - !ruby/object:Gem::Version
292
- version: '2'
306
+ version: '2.0'
293
307
  type: :development
294
308
  prerelease: false
295
309
  version_requirements: !ruby/object:Gem::Requirement
296
310
  requirements:
297
311
  - - ~>
298
312
  - !ruby/object:Gem::Version
299
- version: '2'
313
+ version: '2.0'
300
314
  - !ruby/object:Gem::Dependency
301
315
  name: beaker-rspec
302
316
  requirement: !ruby/object:Gem::Requirement
303
317
  requirements:
304
318
  - - ~>
305
319
  - !ruby/object:Gem::Version
306
- version: '5'
320
+ version: '5.0'
307
321
  type: :development
308
322
  prerelease: false
309
323
  version_requirements: !ruby/object:Gem::Requirement
310
324
  requirements:
311
325
  - - ~>
312
326
  - !ruby/object:Gem::Version
313
- version: '5'
327
+ version: '5.0'
314
328
  - !ruby/object:Gem::Dependency
315
329
  name: rspec-core
316
330
  requirement: !ruby/object:Gem::Requirement
317
331
  requirements:
318
332
  - - ~>
319
333
  - !ruby/object:Gem::Version
320
- version: '3'
334
+ version: '3.0'
321
335
  type: :development
322
336
  prerelease: false
323
337
  version_requirements: !ruby/object:Gem::Requirement
324
338
  requirements:
325
339
  - - ~>
326
340
  - !ruby/object:Gem::Version
327
- version: '3'
341
+ version: '3.0'
328
342
  description: ! ' "simp-rake-helpers provides common methods for SIMP Rake Tasks"
329
343
 
330
344
  '