hellgrid 0.4.0 → 0.5.0

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: e0caa065abbaea139e9e998f08b984d34aa1ebfcf6a5295c09328c24a9df7e79
4
- data.tar.gz: cdcaa19a6cab7bb2db6d8269752e63832dfc4bfec60b421c1859ec3810e3c918
3
+ metadata.gz: 45b2dbb5da3e867734b318f5d61cbf06987e954edea63e276cf79ad12a2c7f4d
4
+ data.tar.gz: b6b1e73ef8adf70ee4bdcf60363c356ee7087c6c89a9acc08b97fe225b9f0b6d
5
5
  SHA512:
6
- metadata.gz: 4914b6fffb95580d2419bb67e3553ac90516b3f4de72bc58dced496e518250e9e33de44e89f0c71cb7a6ec8e68224e3896ad5db76c9736c1b4cfbd27650851e4
7
- data.tar.gz: c36915d2f8353171f1a158fead43c3ebde8e34ee8a1e77b4ead403e963c0c8a6b4b6d7b99a55efdbb01e64b9e1821e01bafa136f91c762e72877f59e1f134df9
6
+ metadata.gz: 0d0853644dd857b99e243ea1ab3cc0b714bdf2cee1457b9aeee7d0bead8bcf8e037abad8048d8c5ac5b45b637185faf8fbf28239be1f526514a4ad629936acd8
7
+ data.tar.gz: bfb3fbaa42975c2bbc6d6b6692c2e4530f9c900f415c458e8b6516f26eacf3785048b6a9ed7b0abdaf5c2cb7d441ed2c0dbbeab63633f6dfc1826cd4c3a382ae
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hellgrid (0.4.0)
4
+ hellgrid (0.5.0)
5
5
  bundler (>= 1.11.0, < 3)
6
6
 
7
7
  GEM
@@ -31,4 +31,4 @@ DEPENDENCIES
31
31
  rspec (~> 3.8.0)
32
32
 
33
33
  BUNDLED WITH
34
- 2.5.3
34
+ 2.5.9
data/README.md CHANGED
@@ -15,12 +15,14 @@ gem install hellgrid
15
15
  Let say that you have a directory `/path/to/root/dir` somewhere in which the Ruby projects `foo` and `bar` could be found.
16
16
 
17
17
  Executing:
18
+
18
19
  ```bash
19
20
  hellgrid /path/to/root/dir
20
21
  ```
21
22
 
22
23
  To search recursively (should you have nested projects), use the `-r ` flag:
23
- ```
24
+
25
+ ```bash
24
26
  hellgrid -r /path/to/root/dir
25
27
  ```
26
28
 
@@ -35,7 +37,21 @@ Should result in:
35
37
  rspec-mocks | 2.0.0 | 3.0.4
36
38
  rake | 10.0.0 | 11.1.0
37
39
  rspec-support | x | 3.0.4
38
- 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
39
55
  ```
40
56
 
41
57
  ## License
data/lib/hellgrid/cli.rb CHANGED
@@ -12,6 +12,8 @@ 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|
@@ -24,7 +26,10 @@ module Hellgrid
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.4.0'
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hellgrid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Deyan Dobrinov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-03-28 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
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
- rubygems_version: 3.5.3
92
+ rubygems_version: 3.5.9
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: Gem version dependency matrix