hellgrid 0.5.0 → 0.6.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: 45b2dbb5da3e867734b318f5d61cbf06987e954edea63e276cf79ad12a2c7f4d
4
- data.tar.gz: b6b1e73ef8adf70ee4bdcf60363c356ee7087c6c89a9acc08b97fe225b9f0b6d
3
+ metadata.gz: a0f138a05d08063ddc1d002fbf3d7d195e96207c564b2ff73adaa3b668be48b8
4
+ data.tar.gz: b450c6cee8da0a0cc7ff7c9581257a9613f2ddf4a501d5dd3bba72fd78f16818
5
5
  SHA512:
6
- metadata.gz: 0d0853644dd857b99e243ea1ab3cc0b714bdf2cee1457b9aeee7d0bead8bcf8e037abad8048d8c5ac5b45b637185faf8fbf28239be1f526514a4ad629936acd8
7
- data.tar.gz: bfb3fbaa42975c2bbc6d6b6692c2e4530f9c900f415c458e8b6516f26eacf3785048b6a9ed7b0abdaf5c2cb7d441ed2c0dbbeab63633f6dfc1826cd4c3a382ae
6
+ metadata.gz: '083415ebc8dcae4086b35643caf0f9bc00dd2dc3afd7e7c122802a6d2ce99c9118f5cfd62fe1456d1cf6a3ae0bfc436434e9d55c51dad3699f3674e84160c4d5'
7
+ data.tar.gz: dea3e5793165bb105f95be2b1bde34a46e7107cd9a25d6c6ef88384ed0877031886a76377e91ee34b79af2ced35ba605efbb87dbdf690536c2e59e6da9d06300
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
data/Gemfile.lock CHANGED
@@ -1,26 +1,26 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hellgrid (0.5.0)
4
+ hellgrid (0.6.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.5.1)
11
- rspec (3.8.0)
12
- rspec-core (~> 3.8.0)
13
- rspec-expectations (~> 3.8.0)
14
- rspec-mocks (~> 3.8.0)
15
- rspec-core (3.8.2)
16
- rspec-support (~> 3.8.0)
17
- rspec-expectations (3.8.6)
10
+ diff-lcs (1.6.0)
11
+ rspec (3.13.0)
12
+ rspec-core (~> 3.13.0)
13
+ rspec-expectations (~> 3.13.0)
14
+ rspec-mocks (~> 3.13.0)
15
+ rspec-core (3.13.3)
16
+ rspec-support (~> 3.13.0)
17
+ rspec-expectations (3.13.3)
18
18
  diff-lcs (>= 1.2.0, < 2.0)
19
- rspec-support (~> 3.8.0)
20
- rspec-mocks (3.8.2)
19
+ rspec-support (~> 3.13.0)
20
+ rspec-mocks (3.13.2)
21
21
  diff-lcs (>= 1.2.0, < 2.0)
22
- rspec-support (~> 3.8.0)
23
- rspec-support (3.8.3)
22
+ rspec-support (~> 3.13.0)
23
+ rspec-support (3.13.2)
24
24
 
25
25
  PLATFORMS
26
26
  ruby
@@ -28,7 +28,7 @@ PLATFORMS
28
28
 
29
29
  DEPENDENCIES
30
30
  hellgrid!
31
- rspec (~> 3.8.0)
31
+ rspec (~> 3.13)
32
32
 
33
33
  BUNDLED WITH
34
- 2.5.9
34
+ 2.6.2
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  Utility which will output a table containing gem versions used across your projects.
4
4
 
5
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)
6
+ [![Gem Version](https://badge.fury.io/rb/hellgrid.svg)](https://badge.fury.io/rb/hellgrid)
6
7
 
7
8
  ## Install
8
9
 
data/bin/hellgrid CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'pathname'
4
5
  # XXX: BUNDLE_GEMFILE should be provided because the internals of bundler require a 'Gemfile' or '.bundle' to
data/exe/hellgrid CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'pathname'
4
5
  # XXX: BUNDLE_GEMFILE should be provided because the internals of bundler require a 'Gemfile' or '.bundle' to
data/hellgrid.gemspec CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  project_root = File.dirname(__FILE__)
2
4
  lib = File.join(project_root, 'lib')
3
5
 
@@ -11,15 +13,23 @@ Gem::Specification.new do |s|
11
13
  s.description = 'Display gem versions used across your projects in a table'
12
14
  s.authors = ['Deyan Dobrinov', 'Aleksandar Ivanov']
13
15
  s.email = ['engineering+hellgrid@fundingcircle.com']
14
- s.files = Dir.chdir(project_root) { Dir['lib/**/*.rb'] + Dir['bin/*'] + Dir['exe/*'] + Dir['spec/**/*.rb'] + %w(Gemfile Gemfile.lock README.md hellgrid.gemspec) }
16
+ s.files = Dir.chdir(project_root) do
17
+ Dir['lib/**/*.rb'] +
18
+ Dir['bin/*'] +
19
+ Dir['exe/*'] +
20
+ Dir['spec/**/*.rb'] +
21
+ %w[Gemfile Gemfile.lock README.md hellgrid.gemspec]
22
+ end
15
23
  s.bindir = 'exe'
16
- s.executables = s.files.grep(/^exe\//) { |f| File.basename(f) }
17
- s.test_files = s.files.grep(/^spec\//)
24
+ s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
+ s.test_files = s.files.grep(%r{^spec/})
18
26
  s.require_paths = ['lib']
19
27
  s.homepage = 'https://github.com/FundingCircle/hellgrid'
20
28
  s.license = 'BSD-3-Clause'
21
29
 
30
+ s.required_ruby_version = '>= 3.1.0'
31
+
22
32
  s.add_runtime_dependency 'bundler', '>= 1.11.0', '< 3'
23
33
 
24
- s.add_development_dependency 'rspec', '~> 3.8.0'
34
+ s.add_development_dependency 'rspec', '~> 3.13'
25
35
  end
data/lib/hellgrid/cli.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Hellgrid
2
4
  class CLI
3
5
  def self.start(argv = ARGV)
@@ -11,8 +13,8 @@ module Hellgrid
11
13
  attr_reader :argv
12
14
 
13
15
  def start
14
- recursive_search = !!(argv.delete('-r'))
15
- transpose = !!(argv.delete('-t'))
16
+ recursive_search = !argv.delete('-r').nil?
17
+ transpose = !argv.delete('-t').nil?
16
18
 
17
19
  folders = argv.empty? ? [Dir.pwd] : argv
18
20
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Hellgrid
2
4
  class Matrix
3
5
  attr_reader :projects
@@ -11,7 +13,7 @@ module Hellgrid
11
13
  end
12
14
 
13
15
  def projects_sorted_by_name
14
- @projects.sort { |a,b| a.name <=> b.name }
16
+ @projects.sort { |a, b| a.name <=> b.name }
15
17
  end
16
18
 
17
19
  def project_names
@@ -36,12 +38,12 @@ module Hellgrid
36
38
  gem_usage = Hash.new(0)
37
39
 
38
40
  projects.each do |project|
39
- project.dependency_matrix.each do |gem, _|
41
+ project.dependency_matrix.each_key do |gem|
40
42
  gem_usage[gem] += 1
41
43
  end
42
44
  end
43
45
 
44
- gem_usage.sort_by {|key, value| [-value, key] }.to_h
46
+ gem_usage.sort_by { |key, value| [-value, key] }.to_h
45
47
  end
46
48
  end
47
49
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Hellgrid
2
4
  class Project
3
5
  attr_reader :path
@@ -8,11 +10,11 @@ module Hellgrid
8
10
  end
9
11
 
10
12
  def name
11
- File.expand_path(path).gsub(File.expand_path(root) + '/', '')
13
+ File.expand_path(path).gsub("#{File.expand_path(root)}/", '')
12
14
  end
13
15
 
14
16
  def dependency_matrix
15
- @dependency_matrix ||= specs.inject(Hash.new) { |h,spec| h.merge!(spec.name.to_s => spec.version.version) }
17
+ @dependency_matrix ||= specs.inject({}) { |h, spec| h.merge!(spec.name.to_s => spec.version.version) }
16
18
  end
17
19
 
18
20
  private
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Hellgrid
2
- VERSION = '0.5.0'
4
+ VERSION = '0.6.0'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Hellgrid
2
4
  module Views
3
5
  class Console
@@ -21,7 +23,7 @@ module Hellgrid
21
23
  string << row_as_string(row)
22
24
  end
23
25
 
24
- string.join("\n") + "\n"
26
+ "#{string.join("\n")}\n"
25
27
  end
26
28
 
27
29
  private
@@ -35,9 +37,7 @@ module Hellgrid
35
37
 
36
38
  matrix.each do |row|
37
39
  row.each_with_index do |value, col_i|
38
- if value && (widths[col_i] < value.size)
39
- widths[col_i] = value.size
40
- end
40
+ widths[col_i] = value.size if value && (widths[col_i] < value.size)
41
41
  end
42
42
  end
43
43
 
data/lib/hellgrid.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler'
2
4
  require 'find'
3
5
  require 'hellgrid/project'
@@ -1,71 +1,90 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Hellgrid::Matrix do
4
6
  subject(:matrix) { described_class.new }
5
- let(:project) { [] }
6
7
 
7
- describe '#add_project' do
8
- let(:project) { double(:project) }
8
+ def stub_project(name: 'foo', dependency_matrix: {})
9
+ instance_double(Hellgrid::Project, name:, dependency_matrix:)
10
+ end
9
11
 
12
+ describe '#add_project' do
10
13
  it 'adds a project' do
11
14
  expect do
12
- matrix.add_project(project)
15
+ matrix.add_project(stub_project)
13
16
  end.to change { matrix.projects.count }.by(1)
14
17
  end
15
18
  end
16
19
 
17
20
  describe '#project_names' do
18
21
  it 'returns project names' do
19
- matrix.add_project(double(:project, name: 'foo'))
20
- matrix.add_project(double(:project, name: 'bar'))
22
+ matrix.add_project(stub_project(name: 'foo'))
23
+ matrix.add_project(stub_project(name: 'bar'))
21
24
 
22
- expect(matrix.project_names).to eq(['bar', 'foo'])
25
+ expect(matrix.project_names).to eq(%w[bar foo])
23
26
  end
24
27
  end
25
28
 
26
29
  describe '#gem_names' do
27
30
  it 'returns gem names' do
28
- matrix.add_project(double(:project, dependency_matrix: {
29
- 'a' => '1.0.1',
30
- 'b' => '2.0.1',
31
- 'c' => '3.0.1'
32
- }))
33
-
34
- matrix.add_project(double(:project, dependency_matrix: {
35
- 'b' => '2.0.2',
36
- 'c' => '3.0.2',
37
- 'd' => '4.0.2'
38
- }))
39
-
40
- expect(matrix.gem_names).to eq(['a', 'b', 'c', 'd'])
31
+ matrix.add_project(
32
+ stub_project(
33
+ dependency_matrix: {
34
+ 'a' => '1.0.1',
35
+ 'b' => '2.0.1',
36
+ 'c' => '3.0.1'
37
+ }
38
+ )
39
+ )
40
+
41
+ matrix.add_project(
42
+ stub_project(
43
+ dependency_matrix: {
44
+ 'b' => '2.0.2',
45
+ 'c' => '3.0.2',
46
+ 'd' => '4.0.2'
47
+ }
48
+ )
49
+ )
50
+
51
+ expect(matrix.gem_names).to eq(%w[a b c d])
41
52
  end
42
53
  end
43
54
 
44
55
  describe '#gems_by_usage' do
45
56
  before do
46
- matrix.add_project(double(:project, dependency_matrix: {
47
- 'a' => '1.0.1',
48
- 'b' => '2.0.1',
49
- 'c' => '3.0.1'
50
- }))
51
-
52
- matrix.add_project(double(:project, dependency_matrix: {
53
- 'b' => '2.0.2',
54
- 'c' => '3.0.2',
55
- 'd' => '4.0.2'
56
- }))
57
+ matrix.add_project(
58
+ stub_project(
59
+ dependency_matrix: {
60
+ 'a' => '1.0.1',
61
+ 'b' => '2.0.1',
62
+ 'c' => '3.0.1'
63
+ }
64
+ )
65
+ )
66
+
67
+ matrix.add_project(
68
+ stub_project(
69
+ dependency_matrix: {
70
+ 'b' => '2.0.2',
71
+ 'c' => '3.0.2',
72
+ 'd' => '4.0.2'
73
+ }
74
+ )
75
+ )
57
76
  end
58
77
 
59
78
  it 'returns an array' do
60
79
  expect(matrix.gems_by_usage).to be_a(Hash)
61
80
  end
62
81
 
63
- it 'returns ordered ' do
82
+ it 'returns ordered' do
64
83
  expected_result = {
65
- "b"=>2,
66
- "c"=>2,
67
- "a"=>1,
68
- "d"=>1
84
+ 'b' => 2,
85
+ 'c' => 2,
86
+ 'a' => 1,
87
+ 'd' => 1
69
88
  }
70
89
 
71
90
  expect(matrix.gems_by_usage).to eq(expected_result)
@@ -73,9 +92,9 @@ describe Hellgrid::Matrix do
73
92
  end
74
93
 
75
94
  describe '#projects_sorted_by_name' do
76
- let(:project_a) { double(:project, name: 'a') }
77
- let(:project_b) { double(:project, name: 'b') }
78
- let(:project_c) { double(:project, name: 'c') }
95
+ let(:project_a) { stub_project(name: 'a') }
96
+ let(:project_b) { stub_project(name: 'b') }
97
+ let(:project_c) { stub_project(name: 'c') }
79
98
 
80
99
  before do
81
100
  matrix.add_project(project_b)
@@ -92,26 +111,36 @@ describe Hellgrid::Matrix do
92
111
 
93
112
  describe '#sorted_by_most_used' do
94
113
  before do
95
- matrix.add_project(double(:project, name: 'foo', dependency_matrix: {
96
- 'a' => '1.0.1',
97
- 'b' => '2.0.1',
98
- 'c' => '3.0.1'
99
- }))
100
-
101
- matrix.add_project(double(:project, name: 'bar', dependency_matrix: {
102
- 'b' => '2.0.2',
103
- 'c' => '3.0.2',
104
- 'd' => '4.0.2'
105
- }))
114
+ matrix.add_project(
115
+ stub_project(
116
+ name: 'foo',
117
+ dependency_matrix: {
118
+ 'a' => '1.0.1',
119
+ 'b' => '2.0.1',
120
+ 'c' => '3.0.1'
121
+ }
122
+ )
123
+ )
124
+
125
+ matrix.add_project(
126
+ stub_project(
127
+ name: 'bar',
128
+ dependency_matrix: {
129
+ 'b' => '2.0.2',
130
+ 'c' => '3.0.2',
131
+ 'd' => '4.0.2'
132
+ }
133
+ )
134
+ )
106
135
  end
107
136
 
108
137
  it 'returns matrix' do
109
138
  expected_result = [
110
- [ nil, 'bar', 'foo' ],
111
- [ 'b', '2.0.2', '2.0.1' ],
112
- [ 'c', '3.0.2', '3.0.1' ],
113
- [ 'a', nil, '1.0.1' ],
114
- [ 'd', '4.0.2', nil ]
139
+ [nil, 'bar', 'foo'],
140
+ ['b', '2.0.2', '2.0.1'],
141
+ ['c', '3.0.2', '3.0.1'],
142
+ ['a', nil, '1.0.1'],
143
+ ['d', '4.0.2', nil]
115
144
  ]
116
145
 
117
146
  expect(matrix.sorted_by_most_used).to eq(expected_result)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Hellgrid::Project do
@@ -10,33 +12,33 @@ describe Hellgrid::Project do
10
12
  before do
11
13
  delete_tmp_folder
12
14
 
13
- create_file lockfile_path, <<-FOO_GEMFILE
14
- GEM
15
- remote: https://rubygems.org/
16
- specs:
17
- diff-lcs (1.2.5)
18
- rake (11.1.0)
19
- rspec (3.0.0)
20
- rspec-core (~> 3.0.0)
21
- rspec-expectations (~> 3.0.0)
22
- rspec-mocks (~> 3.0.0)
23
- rspec-core (3.0.4)
24
- rspec-support (~> 3.0.0)
25
- rspec-expectations (3.0.4)
26
- diff-lcs (>= 1.2.0, < 2.0)
27
- rspec-support (~> 3.0.0)
28
- rspec-mocks (3.0.4)
29
- rspec-support (~> 3.0.0)
30
- rspec-support (3.0.4)
15
+ create_file lockfile_path, <<~FOO_GEMFILE
16
+ GEM
17
+ remote: https://rubygems.org/
18
+ specs:
19
+ diff-lcs (1.2.5)
20
+ rake (11.1.0)
21
+ rspec (3.0.0)
22
+ rspec-core (~> 3.0.0)
23
+ rspec-expectations (~> 3.0.0)
24
+ rspec-mocks (~> 3.0.0)
25
+ rspec-core (3.0.4)
26
+ rspec-support (~> 3.0.0)
27
+ rspec-expectations (3.0.4)
28
+ diff-lcs (>= 1.2.0, < 2.0)
29
+ rspec-support (~> 3.0.0)
30
+ rspec-mocks (3.0.4)
31
+ rspec-support (~> 3.0.0)
32
+ rspec-support (3.0.4)
31
33
 
32
- PLATFORMS
33
- ruby
34
+ PLATFORMS
35
+ ruby
34
36
 
35
- DEPENDENCIES
36
- rake (= 11.1.0)
37
- rspec (= 3.0.0)
37
+ DEPENDENCIES
38
+ rake (= 11.1.0)
39
+ rspec (= 3.0.0)
38
40
 
39
- FOO_GEMFILE
41
+ FOO_GEMFILE
40
42
  end
41
43
 
42
44
  describe '#name' do
@@ -52,13 +54,13 @@ FOO_GEMFILE
52
54
 
53
55
  it 'returns dependencies' do
54
56
  expected_result = {
55
- 'diff-lcs' => '1.2.5',
56
- 'rake' => '11.1.0',
57
- 'rspec' => '3.0.0',
58
- 'rspec-core' => '3.0.4',
57
+ 'diff-lcs' => '1.2.5',
58
+ 'rake' => '11.1.0',
59
+ 'rspec' => '3.0.0',
60
+ 'rspec-core' => '3.0.4',
59
61
  'rspec-expectations' => '3.0.4',
60
- 'rspec-mocks' => '3.0.4',
61
- 'rspec-support' => '3.0.4'
62
+ 'rspec-mocks' => '3.0.4',
63
+ 'rspec-support' => '3.0.4'
62
64
  }
63
65
 
64
66
  expect(subject.dependency_matrix).to eq(expected_result)
@@ -1,26 +1,30 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Hellgrid::Views::Console do
4
- subject(:console) { described_class.new(matrix.sorted_by_most_used) }
5
- let(:matrix) do
6
- double :matrix,
7
- sorted_by_most_used: [[ nil, 'bar', 'foo' ],
8
- [ 'b', '2.0.2', '2.0.1' ],
9
- [ 'c', '3.0.2', '3.0.1' ],
10
- [ 'a', nil, '1.0.1' ],
11
- [ 'd', '4.0.2', nil ]]
6
+ subject(:console) do
7
+ described_class.new(
8
+ [
9
+ [nil, 'bar', 'foo'],
10
+ ['b', '2.0.2', '2.0.1'],
11
+ ['c', '3.0.2', '3.0.1'],
12
+ ['a', nil, '1.0.1'],
13
+ ['d', '4.0.2', nil]
14
+ ]
15
+ )
12
16
  end
13
17
 
14
18
  describe '#render_as_string' do
15
19
  it 'renders matrix' do
16
- expected_result = <<-TABLE
17
- x | bar | foo
18
- ---+-------+-------
19
- b | 2.0.2 | 2.0.1
20
- c | 3.0.2 | 3.0.1
21
- a | x | 1.0.1
22
- d | 4.0.2 | x
23
- TABLE
20
+ expected_result = <<~TABLE
21
+ x | bar | foo#{' '}
22
+ ---+-------+-------
23
+ b | 2.0.2 | 2.0.1#{' '}
24
+ c | 3.0.2 | 3.0.1#{' '}
25
+ a | x | 1.0.1#{' '}
26
+ d | 4.0.2 | x#{' '}
27
+ TABLE
24
28
 
25
29
  expect(console.render_as_string).to eq(expected_result)
26
30
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'bin/hellgrid' do
@@ -12,89 +14,89 @@ describe 'bin/hellgrid' do
12
14
  before do
13
15
  delete_tmp_folder
14
16
 
15
- create_file 'spec/tmp/in/foo/Gemfile.lock', <<-FOO_GEMFILE
16
- GEM
17
- remote: https://rubygems.org/
18
- specs:
19
- diff-lcs (1.2.5)
20
- rake (11.1.0)
21
- rspec (3.0.0)
22
- rspec-core (~> 3.0.0)
23
- rspec-expectations (~> 3.0.0)
24
- rspec-mocks (~> 3.0.0)
25
- rspec-core (3.0.4)
26
- rspec-support (~> 3.0.0)
27
- rspec-expectations (3.0.4)
28
- diff-lcs (>= 1.2.0, < 2.0)
29
- rspec-support (~> 3.0.0)
30
- rspec-mocks (3.0.4)
31
- rspec-support (~> 3.0.0)
32
- rspec-support (3.0.4)
33
-
34
- PLATFORMS
35
- ruby
36
-
37
- DEPENDENCIES
38
- rake (= 11.1.0)
39
- rspec (= 3.0.0)
40
-
41
- FOO_GEMFILE
42
-
43
- create_file 'spec/tmp/bar/Gemfile.lock', <<-BAR_GEMFILE
44
- GEM
45
- remote: https://rubygems.org/
46
- specs:
47
- diff-lcs (1.2.5)
48
- rake (10.0.0)
49
- rspec (2.0.0)
50
- rspec-core (= 2.0.0)
51
- rspec-expectations (= 2.0.0)
52
- rspec-mocks (= 2.0.0)
53
- rspec-core (2.0.0)
54
- rspec-expectations (2.0.0)
55
- diff-lcs (>= 1.1.2)
56
- rspec-mocks (2.0.0)
57
- rspec-core (= 2.0.0)
58
- rspec-expectations (= 2.0.0)
59
-
60
- PLATFORMS
61
- ruby
62
-
63
- DEPENDENCIES
64
- rake (= 10.0.0)
65
- rspec (= 2.0.0)
66
-
67
- BAR_GEMFILE
17
+ create_file 'spec/tmp/in/foo/Gemfile.lock', <<~FOO_GEMFILE
18
+ GEM
19
+ remote: https://rubygems.org/
20
+ specs:
21
+ diff-lcs (1.2.5)
22
+ rake (11.1.0)
23
+ rspec (3.0.0)
24
+ rspec-core (~> 3.0.0)
25
+ rspec-expectations (~> 3.0.0)
26
+ rspec-mocks (~> 3.0.0)
27
+ rspec-core (3.0.4)
28
+ rspec-support (~> 3.0.0)
29
+ rspec-expectations (3.0.4)
30
+ diff-lcs (>= 1.2.0, < 2.0)
31
+ rspec-support (~> 3.0.0)
32
+ rspec-mocks (3.0.4)
33
+ rspec-support (~> 3.0.0)
34
+ rspec-support (3.0.4)
35
+
36
+ PLATFORMS
37
+ ruby
38
+
39
+ DEPENDENCIES
40
+ rake (= 11.1.0)
41
+ rspec (= 3.0.0)
42
+
43
+ FOO_GEMFILE
44
+
45
+ create_file 'spec/tmp/bar/Gemfile.lock', <<~BAR_GEMFILE
46
+ GEM
47
+ remote: https://rubygems.org/
48
+ specs:
49
+ diff-lcs (1.2.5)
50
+ rake (10.0.0)
51
+ rspec (2.0.0)
52
+ rspec-core (= 2.0.0)
53
+ rspec-expectations (= 2.0.0)
54
+ rspec-mocks (= 2.0.0)
55
+ rspec-core (2.0.0)
56
+ rspec-expectations (2.0.0)
57
+ diff-lcs (>= 1.1.2)
58
+ rspec-mocks (2.0.0)
59
+ rspec-core (= 2.0.0)
60
+ rspec-expectations (= 2.0.0)
61
+
62
+ PLATFORMS
63
+ ruby
64
+
65
+ DEPENDENCIES
66
+ rake (= 10.0.0)
67
+ rspec (= 2.0.0)
68
+
69
+ BAR_GEMFILE
68
70
  end
69
71
 
70
72
  it 'returns a matrix with the versions of all used gems' do
71
- expected_result = <<-TABLE
72
- x | bar | in/foo
73
- --------------------+--------+--------
74
- diff-lcs | 1.2.5 | 1.2.5
75
- rake | 10.0.0 | 11.1.0
76
- rspec | 2.0.0 | 3.0.0
77
- rspec-core | 2.0.0 | 3.0.4
78
- rspec-expectations | 2.0.0 | 3.0.4
79
- rspec-mocks | 2.0.0 | 3.0.4
80
- rspec-support | x | 3.0.4
81
- TABLE
73
+ expected_result = <<~TABLE
74
+ x | bar | in/foo#{' '}
75
+ --------------------+--------+--------
76
+ diff-lcs | 1.2.5 | 1.2.5#{' '}
77
+ rake | 10.0.0 | 11.1.0#{' '}
78
+ rspec | 2.0.0 | 3.0.0#{' '}
79
+ rspec-core | 2.0.0 | 3.0.4#{' '}
80
+ rspec-expectations | 2.0.0 | 3.0.4#{' '}
81
+ rspec-mocks | 2.0.0 | 3.0.4#{' '}
82
+ rspec-support | x | 3.0.4#{' '}
83
+ TABLE
82
84
 
83
85
  expect(`#{PROJECT_ROOT}/bin/hellgrid #{PROJECT_ROOT}/spec/tmp`).to eq(expected_result)
84
86
  end
85
87
 
86
88
  it 'could be run from random directory' do
87
- expected_result = <<-TABLE
88
- x | bar | in/foo
89
- --------------------+--------+--------
90
- diff-lcs | 1.2.5 | 1.2.5
91
- rake | 10.0.0 | 11.1.0
92
- rspec | 2.0.0 | 3.0.0
93
- rspec-core | 2.0.0 | 3.0.4
94
- rspec-expectations | 2.0.0 | 3.0.4
95
- rspec-mocks | 2.0.0 | 3.0.4
96
- rspec-support | x | 3.0.4
97
- TABLE
89
+ expected_result = <<~TABLE
90
+ x | bar | in/foo#{' '}
91
+ --------------------+--------+--------
92
+ diff-lcs | 1.2.5 | 1.2.5#{' '}
93
+ rake | 10.0.0 | 11.1.0#{' '}
94
+ rspec | 2.0.0 | 3.0.0#{' '}
95
+ rspec-core | 2.0.0 | 3.0.4#{' '}
96
+ rspec-expectations | 2.0.0 | 3.0.4#{' '}
97
+ rspec-mocks | 2.0.0 | 3.0.4#{' '}
98
+ rspec-support | x | 3.0.4#{' '}
99
+ TABLE
98
100
 
99
101
  with_unbundled_env do
100
102
  expect(`cd ~ && #{PROJECT_ROOT}/bin/hellgrid #{PROJECT_ROOT}/spec/tmp`).to eq(expected_result)
@@ -102,17 +104,17 @@ TABLE
102
104
  end
103
105
 
104
106
  it 'uses the current working directory by default' do
105
- expected_result = <<-TABLE
106
- x | bar | in/foo
107
- --------------------+--------+--------
108
- diff-lcs | 1.2.5 | 1.2.5
109
- rake | 10.0.0 | 11.1.0
110
- rspec | 2.0.0 | 3.0.0
111
- rspec-core | 2.0.0 | 3.0.4
112
- rspec-expectations | 2.0.0 | 3.0.4
113
- rspec-mocks | 2.0.0 | 3.0.4
114
- rspec-support | x | 3.0.4
115
- TABLE
107
+ expected_result = <<~TABLE
108
+ x | bar | in/foo#{' '}
109
+ --------------------+--------+--------
110
+ diff-lcs | 1.2.5 | 1.2.5#{' '}
111
+ rake | 10.0.0 | 11.1.0#{' '}
112
+ rspec | 2.0.0 | 3.0.0#{' '}
113
+ rspec-core | 2.0.0 | 3.0.4#{' '}
114
+ rspec-expectations | 2.0.0 | 3.0.4#{' '}
115
+ rspec-mocks | 2.0.0 | 3.0.4#{' '}
116
+ rspec-support | x | 3.0.4#{' '}
117
+ TABLE
116
118
 
117
119
  with_unbundled_env do
118
120
  expect(`cd #{PROJECT_ROOT}/spec/tmp && #{PROJECT_ROOT}/bin/hellgrid`).to eq(expected_result)
@@ -126,7 +128,7 @@ TABLE
126
128
  include(
127
129
  'hellgrid',
128
130
  'spec/tmp/bar',
129
- 'spec/tmp/in/foo',
131
+ 'spec/tmp/in/foo'
130
132
  )
131
133
  )
132
134
  end
@@ -135,12 +137,12 @@ TABLE
135
137
 
136
138
  context 'when passing -t' do
137
139
  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
140
+ expected_result = <<~TABLE
141
+ x | diff-lcs | rake | rspec | rspec-core | rspec-expectations | rspec-mocks | rspec-support#{' '}
142
+ --------+----------+--------+-------+------------+--------------------+-------------+---------------
143
+ bar | 1.2.5 | 10.0.0 | 2.0.0 | 2.0.0 | 2.0.0 | 2.0.0 | x#{' '}
144
+ in/foo | 1.2.5 | 11.1.0 | 3.0.0 | 3.0.4 | 3.0.4 | 3.0.4 | 3.0.4#{' '}
145
+ TABLE
144
146
 
145
147
  with_unbundled_env do
146
148
  expect(`cd #{PROJECT_ROOT}/spec/tmp && #{PROJECT_ROOT}/bin/hellgrid -t`).to eq(expected_result)
data/spec/spec_helper.rb CHANGED
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fileutils'
2
4
  require 'hellgrid'
3
5
  require 'hellgrid/project'
4
6
  require 'hellgrid/matrix'
5
7
  require 'hellgrid/views/console'
6
8
 
7
- PROJECT_ROOT = File.expand_path('../..', __FILE__)
9
+ PROJECT_ROOT = File.expand_path('..', __dir__)
8
10
 
9
11
  def create_file(path, content)
10
12
  full_path = File.join(PROJECT_ROOT, path)
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hellgrid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Deyan Dobrinov
8
8
  - Aleksandar Ivanov
9
- autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2024-05-07 00:00:00.000000000 Z
11
+ date: 2025-02-21 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
@@ -37,14 +36,14 @@ dependencies:
37
36
  requirements:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
- version: 3.8.0
39
+ version: '3.13'
41
40
  type: :development
42
41
  prerelease: false
43
42
  version_requirements: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - "~>"
46
45
  - !ruby/object:Gem::Version
47
- version: 3.8.0
46
+ version: '3.13'
48
47
  description: Display gem versions used across your projects in a table
49
48
  email:
50
49
  - engineering+hellgrid@fundingcircle.com
@@ -74,7 +73,6 @@ homepage: https://github.com/FundingCircle/hellgrid
74
73
  licenses:
75
74
  - BSD-3-Clause
76
75
  metadata: {}
77
- post_install_message:
78
76
  rdoc_options: []
79
77
  require_paths:
80
78
  - lib
@@ -82,15 +80,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
82
80
  requirements:
83
81
  - - ">="
84
82
  - !ruby/object:Gem::Version
85
- version: '0'
83
+ version: 3.1.0
86
84
  required_rubygems_version: !ruby/object:Gem::Requirement
87
85
  requirements:
88
86
  - - ">="
89
87
  - !ruby/object:Gem::Version
90
88
  version: '0'
91
89
  requirements: []
92
- rubygems_version: 3.5.9
93
- signing_key:
90
+ rubygems_version: 3.6.2
94
91
  specification_version: 4
95
92
  summary: Gem version dependency matrix
96
93
  test_files: