hellgrid 0.3.5 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5065d2ad293d7b72ae198d3a4ab7af155b404b23cd85512ff85e50fd289d8ce5
4
- data.tar.gz: a0e75613e9456775b4e864060bb0a7050f9ecc4e1f36a5f9130a9fd9e204322c
3
+ metadata.gz: 45b2dbb5da3e867734b318f5d61cbf06987e954edea63e276cf79ad12a2c7f4d
4
+ data.tar.gz: b6b1e73ef8adf70ee4bdcf60363c356ee7087c6c89a9acc08b97fe225b9f0b6d
5
5
  SHA512:
6
- metadata.gz: a48874b5df424ed602fdda5a602d3745fc703c64c260fb3ef1117e2cb0958a4600e526b79c459c82ac6579b89846a27a8d04883f6d09f9477a5133b69914017e
7
- data.tar.gz: e9445c22f028d94cdd31b8a16715eba9eea35b8983f59f8ca2f482d211d1b2fac059e631939319a2b3275225e8c12caf372026cb4da26dd2650660826491b6b1
6
+ metadata.gz: 0d0853644dd857b99e243ea1ab3cc0b714bdf2cee1457b9aeee7d0bead8bcf8e037abad8048d8c5ac5b45b637185faf8fbf28239be1f526514a4ad629936acd8
7
+ data.tar.gz: bfb3fbaa42975c2bbc6d6b6692c2e4530f9c900f415c458e8b6516f26eacf3785048b6a9ed7b0abdaf5c2cb7d441ed2c0dbbeab63633f6dfc1826cd4c3a382ae
data/Gemfile.lock CHANGED
@@ -1,15 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hellgrid (0.3.5)
4
+ hellgrid (0.5.0)
5
5
  bundler (>= 1.11.0, < 3)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- diff-lcs (1.4.4)
11
- docile (1.3.5)
12
- json (2.5.1)
10
+ diff-lcs (1.5.1)
13
11
  rspec (3.8.0)
14
12
  rspec-core (~> 3.8.0)
15
13
  rspec-expectations (~> 3.8.0)
@@ -23,19 +21,14 @@ GEM
23
21
  diff-lcs (>= 1.2.0, < 2.0)
24
22
  rspec-support (~> 3.8.0)
25
23
  rspec-support (3.8.3)
26
- simplecov (0.16.1)
27
- docile (~> 1.1)
28
- json (>= 1.8, < 3)
29
- simplecov-html (~> 0.10.0)
30
- simplecov-html (0.10.2)
31
24
 
32
25
  PLATFORMS
33
26
  ruby
27
+ x86_64-linux
34
28
 
35
29
  DEPENDENCIES
36
30
  hellgrid!
37
31
  rspec (~> 3.8.0)
38
- simplecov (~> 0.16.0)
39
32
 
40
33
  BUNDLED WITH
41
- 1.17.3
34
+ 2.5.9
data/README.md CHANGED
@@ -2,8 +2,7 @@
2
2
 
3
3
  Utility which will output a table containing gem versions used across your projects.
4
4
 
5
- [![Build Status`](https://circleci.com/gh/FundingCircle/hellgrid.svg?style=svg)](https://circleci.com/gh/FundingCircle/hellgrid)
6
- [![Maintainability](https://api.codeclimate.com/v1/badges/13deecf7ca1f69197cbe/maintainability)](https://codeclimate.com/github/FundingCircle/hellgrid/maintainability)
5
+ [![Build & Test](https://github.com/FundingCircle/hellgrid/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/FundingCircle/hellgrid/actions/workflows/build-and-test.yml)
7
6
 
8
7
  ## Install
9
8
 
@@ -16,12 +15,14 @@ gem install hellgrid
16
15
  Let say that you have a directory `/path/to/root/dir` somewhere in which the Ruby projects `foo` and `bar` could be found.
17
16
 
18
17
  Executing:
18
+
19
19
  ```bash
20
20
  hellgrid /path/to/root/dir
21
21
  ```
22
22
 
23
23
  To search recursively (should you have nested projects), use the `-r ` flag:
24
- ```
24
+
25
+ ```bash
25
26
  hellgrid -r /path/to/root/dir
26
27
  ```
27
28
 
@@ -36,7 +37,21 @@ Should result in:
36
37
  rspec-mocks | 2.0.0 | 3.0.4
37
38
  rake | 10.0.0 | 11.1.0
38
39
  rspec-support | x | 3.0.4
39
- hellgrid | x | x
40
+ ```
41
+
42
+ To have the gems as columns, use the `-t` flag:
43
+
44
+ ```bash
45
+ hellgrid -t /path/to/root/dir
46
+ ```
47
+
48
+ Should result in:
49
+
50
+ ```bash
51
+ x | diff-lcs | rake | rspec | rspec-core | rspec-expectations | rspec-mocks | rspec-support
52
+ --------+----------+--------+-------+------------+--------------------+-------------+---------------
53
+ bar | 1.2.5 | 10.0.0 | 2.0.0 | 2.0.0 | 2.0.0 | 2.0.0 | x
54
+ foo | 1.2.5 | 11.1.0 | 3.0.0 | 3.0.4 | 3.0.4 | 3.0.4 | 3.0.4
40
55
  ```
41
56
 
42
57
  ## License
data/hellgrid.gemspec CHANGED
@@ -22,5 +22,4 @@ Gem::Specification.new do |s|
22
22
  s.add_runtime_dependency 'bundler', '>= 1.11.0', '< 3'
23
23
 
24
24
  s.add_development_dependency 'rspec', '~> 3.8.0'
25
- s.add_development_dependency 'simplecov', '~> 0.16.0'
26
25
  end
data/lib/hellgrid/cli.rb CHANGED
@@ -12,19 +12,24 @@ module Hellgrid
12
12
 
13
13
  def start
14
14
  recursive_search = !!(argv.delete('-r'))
15
+ transpose = !!(argv.delete('-t'))
16
+
15
17
  folders = argv.empty? ? [Dir.pwd] : argv
16
18
 
17
19
  folders.each do |folder|
18
20
  matrix = Hellgrid::Matrix.new
19
21
 
20
22
  Find.find(folder) do |path|
21
- if File.directory?(path) && File.exists?(File.join(path, 'Gemfile.lock'))
23
+ if File.directory?(path) && File.exist?(File.join(path, 'Gemfile.lock'))
22
24
  matrix.add_project(Hellgrid::Project.new(folder, path))
23
25
  Find.prune unless recursive_search
24
26
  end
25
27
  end
26
28
 
27
- view = Hellgrid::Views::Console.new(matrix.sorted_by_most_used)
29
+ data = matrix.sorted_by_most_used
30
+ data = data.transpose if transpose
31
+
32
+ view = Hellgrid::Views::Console.new(data)
28
33
 
29
34
  view.render
30
35
  end
@@ -1,3 +1,3 @@
1
1
  module Hellgrid
2
- VERSION = '0.3.5'
2
+ VERSION = '0.5.0'
3
3
  end
@@ -132,4 +132,19 @@ TABLE
132
132
  end
133
133
  end
134
134
  end
135
+
136
+ context 'when passing -t' do
137
+ it 'transposes the result and the project names on the left' do
138
+ expected_result = <<-TABLE
139
+ x | diff-lcs | rake | rspec | rspec-core | rspec-expectations | rspec-mocks | rspec-support
140
+ --------+----------+--------+-------+------------+--------------------+-------------+---------------
141
+ bar | 1.2.5 | 10.0.0 | 2.0.0 | 2.0.0 | 2.0.0 | 2.0.0 | x
142
+ in/foo | 1.2.5 | 11.1.0 | 3.0.0 | 3.0.4 | 3.0.4 | 3.0.4 | 3.0.4
143
+ TABLE
144
+
145
+ with_unbundled_env do
146
+ expect(`cd #{PROJECT_ROOT}/spec/tmp && #{PROJECT_ROOT}/bin/hellgrid -t`).to eq(expected_result)
147
+ end
148
+ end
149
+ end
135
150
  end
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,3 @@
1
- require 'simplecov'
2
- SimpleCov.start
3
-
4
1
  require 'fileutils'
5
2
  require 'hellgrid'
6
3
  require 'hellgrid/project'
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hellgrid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Deyan Dobrinov
8
8
  - Aleksandar Ivanov
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-02-19 00:00:00.000000000 Z
12
+ date: 2024-05-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -45,20 +45,6 @@ dependencies:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 3.8.0
48
- - !ruby/object:Gem::Dependency
49
- name: simplecov
50
- requirement: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: 0.16.0
55
- type: :development
56
- prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 0.16.0
62
48
  description: Display gem versions used across your projects in a table
63
49
  email:
64
50
  - engineering+hellgrid@fundingcircle.com
@@ -88,7 +74,7 @@ homepage: https://github.com/FundingCircle/hellgrid
88
74
  licenses:
89
75
  - BSD-3-Clause
90
76
  metadata: {}
91
- post_install_message:
77
+ post_install_message:
92
78
  rdoc_options: []
93
79
  require_paths:
94
80
  - lib
@@ -103,8 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
89
  - !ruby/object:Gem::Version
104
90
  version: '0'
105
91
  requirements: []
106
- rubygems_version: 3.0.3
107
- signing_key:
92
+ rubygems_version: 3.5.9
93
+ signing_key:
108
94
  specification_version: 4
109
95
  summary: Gem version dependency matrix
110
96
  test_files: