onceover 3.17.1 → 3.17.2

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
  SHA256:
3
- metadata.gz: e6886259693e386c10aaebdd590be798363b38e823e4d7eb266d4f32f303cf2a
4
- data.tar.gz: afdcc34051329c3a584803af4164f42aef9d2ac22e37bf14a35546f5ed8f45e3
3
+ metadata.gz: 2dca2d14bc7059827f3bcbe11eb8c0c00c43be5c37c45ac9fb3533562dab4e7b
4
+ data.tar.gz: d45c009adb4edae1b828fee5a0b51552c02bfc4dc7eefcb5b09a1832e8509170
5
5
  SHA512:
6
- metadata.gz: 6f5b35dfa27bf5b8e6477ffcd3ea985935698d0562cc55ab679e80c501ce15ecb17deb47c81dc276e4bc8634662be7354b0578a122f3258f6f5cb8f00a43dcb5
7
- data.tar.gz: 68c7771cfadc3ef7d9e43569e06e4ce40288a07db464eeaffc4c67b95558dab7b3c76f4e88dcb62ef82f02baf3e8ac13bc17cb988ead6164d96a05e43ef25ebd
6
+ metadata.gz: 13b3969909f9966f78663ba0568f96b557ef769c1a13a0d999d15d50a057ffa3584570b2c6e3c31b79aa09980c8088b62dc4ec665b073b60157243beb11d55cb
7
+ data.tar.gz: 3209f3771d3db26c9ba8f40a06225ac29b452fc012c08e9dfa6ea60cb485ad173448eb9d3aa491f0ed76d5ccdb068ffde61583a1a7fbe232fe352d5cd4874960
data/README.md CHANGED
@@ -700,3 +700,4 @@ Cheers to all of those who helped out:
700
700
  - @raphink
701
701
  - @tequeter
702
702
  - @alexjfisher
703
+ - @smortex
@@ -206,7 +206,7 @@ class Onceover
206
206
  end
207
207
 
208
208
  def print_puppetfile_table
209
- require 'table_print'
209
+ require 'terminal-table'
210
210
  require 'versionomy'
211
211
  require 'colored'
212
212
  require 'r10k/puppetfile'
@@ -221,48 +221,44 @@ class Onceover
221
221
  threads = []
222
222
  puppetfile.modules.each do |mod|
223
223
  threads << Thread.new do
224
- return_hash = {}
224
+ row = []
225
225
  logger.debug "Loading data for #{mod.full_name}"
226
- return_hash[:full_name] = mod.full_name
226
+ row << mod.full_name
227
227
  if mod.is_a?(R10K::Module::Forge)
228
- return_hash[:current_version] = mod.expected_version
229
- return_hash[:latest_version] = mod.v3_module.current_release.version
230
- return_hash[:endorsement] = mod.v3_module.endorsement
228
+ row << mod.expected_version
229
+ row << mod.v3_module.current_release.version
230
+
231
+ current = Versionomy.parse(mod.expected_version)
232
+ latest = Versionomy.parse(mod.v3_module.current_release.version)
233
+ row << if current.major < latest.major
234
+ "Major".red
235
+ elsif current.minor < latest.minor
236
+ "Minor".yellow
237
+ elsif current.tiny < latest.tiny
238
+ "Tiny".green
239
+ else
240
+ "No".green
241
+ end
242
+
243
+ row << mod.v3_module.endorsement
231
244
  superseded_by = mod.v3_module.superseded_by
232
- return_hash[:superseded_by] = superseded_by.nil? ? '' : superseded_by[:slug]
233
- current = Versionomy.parse(return_hash[:current_version])
234
- latest = Versionomy.parse(return_hash[:latest_version])
235
- if current.major < latest.major
236
- return_hash[:out_of_date] = "Major".red
237
- elsif current.minor < latest.minor
238
- return_hash[:out_of_date] = "Minor".yellow
239
- elsif current.tiny < latest.tiny
240
- return_hash[:out_of_date] = "Tiny".green
241
- else
242
- return_hash[:out_of_date] = "No".green
243
- end
245
+ row << (superseded_by.nil? ? '' : superseded_by[:slug])
244
246
  else
245
- return_hash[:current_version] = "N/A"
246
- return_hash[:latest_version] = "N/A"
247
- return_hash[:out_of_date] = "N/A"
248
- return_hash[:endorsement] = "N/A"
249
- return_hash[:superseded_by] = "N/A"
247
+ row << "N/A"
248
+ row << "N/A"
249
+ row << "N/A"
250
+ row << "N/A"
251
+ row << "N/A"
250
252
  end
251
- output_array << return_hash
253
+ output_array << row
252
254
  end
253
255
  end
254
256
 
255
257
  threads.map(&:join)
256
258
 
257
- tp(
258
- output_array,
259
- {:full_name => {:display_name => "Full Name"}},
260
- {:current_version => {:display_name => "Current Version"}},
261
- {:latest_version => {:display_name => "Latest Version"}},
262
- {:out_of_date => {:display_name => "Out of Date?"}},
263
- {:endorsement => {:display_name => "Endorsement"}},
264
- {:superseded_by => {:display_name => "Superseded by"}}
265
- )
259
+ output_array.sort_by! { |line| line[0] }
260
+
261
+ puts Terminal::Table.new(headings: ["Full Name", "Current Version", "Latest Version", "Out of Date?", "Endorsement", "Superseded by"], rows: output_array)
266
262
  end
267
263
 
268
264
  def update_puppetfile
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "onceover"
7
- s.version = "3.17.1"
7
+ s.version = "3.17.2"
8
8
  s.authors = ["Dylan Ratcliffe"]
9
9
  s.email = ["dylan.ratcliffe@puppet.com"]
10
10
  s.homepage = "https://github.com/dylanratcliffe/onceover"
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.add_runtime_dependency 'rspec', '>= 3.0.0'
35
35
  s.add_runtime_dependency 'rspec-puppet', ">= 2.4.0"
36
36
  s.add_runtime_dependency 'rspec_junit_formatter', '>= 0.2.0'
37
- s.add_runtime_dependency 'table_print', '>= 1.0.0'
37
+ s.add_runtime_dependency 'terminal-table', '>= 1.8.0'
38
38
  s.add_runtime_dependency 'versionomy', '>= 0.5.0'
39
39
 
40
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onceover
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.17.1
4
+ version: 3.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Ratcliffe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-01 00:00:00.000000000 Z
11
+ date: 2020-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backticks
@@ -235,19 +235,19 @@ dependencies:
235
235
  - !ruby/object:Gem::Version
236
236
  version: 0.2.0
237
237
  - !ruby/object:Gem::Dependency
238
- name: table_print
238
+ name: terminal-table
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
241
  - - ">="
242
242
  - !ruby/object:Gem::Version
243
- version: 1.0.0
243
+ version: 1.8.0
244
244
  type: :runtime
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - ">="
249
249
  - !ruby/object:Gem::Version
250
- version: 1.0.0
250
+ version: 1.8.0
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: versionomy
253
253
  requirement: !ruby/object:Gem::Requirement