hellgrid 0.3.0 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +24 -16
- data/README.md +2 -1
- data/bin/hellgrid +4 -19
- data/exe/hellgrid +10 -0
- data/hellgrid.gemspec +8 -5
- data/lib/hellgrid.rb +3 -0
- data/lib/hellgrid/cli.rb +33 -0
- data/lib/hellgrid/version.rb +1 -1
- data/spec/hellgrid_spec.rb +12 -8
- data/spec/spec_helper.rb +3 -0
- metadata +35 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5065d2ad293d7b72ae198d3a4ab7af155b404b23cd85512ff85e50fd289d8ce5
|
4
|
+
data.tar.gz: a0e75613e9456775b4e864060bb0a7050f9ecc4e1f36a5f9130a9fd9e204322c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a48874b5df424ed602fdda5a602d3745fc703c64c260fb3ef1117e2cb0958a4600e526b79c459c82ac6579b89846a27a8d04883f6d09f9477a5133b69914017e
|
7
|
+
data.tar.gz: e9445c22f028d94cdd31b8a16715eba9eea35b8983f59f8ca2f482d211d1b2fac059e631939319a2b3275225e8c12caf372026cb4da26dd2650660826491b6b1
|
data/Gemfile.lock
CHANGED
@@ -1,33 +1,41 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hellgrid (0.3.
|
4
|
+
hellgrid (0.3.5)
|
5
|
+
bundler (>= 1.11.0, < 3)
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: https://rubygems.org/
|
8
9
|
specs:
|
9
|
-
diff-lcs (1.
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
rspec-
|
14
|
-
|
15
|
-
rspec-
|
16
|
-
rspec-
|
10
|
+
diff-lcs (1.4.4)
|
11
|
+
docile (1.3.5)
|
12
|
+
json (2.5.1)
|
13
|
+
rspec (3.8.0)
|
14
|
+
rspec-core (~> 3.8.0)
|
15
|
+
rspec-expectations (~> 3.8.0)
|
16
|
+
rspec-mocks (~> 3.8.0)
|
17
|
+
rspec-core (3.8.2)
|
18
|
+
rspec-support (~> 3.8.0)
|
19
|
+
rspec-expectations (3.8.6)
|
17
20
|
diff-lcs (>= 1.2.0, < 2.0)
|
18
|
-
rspec-support (~> 3.
|
19
|
-
rspec-mocks (3.
|
21
|
+
rspec-support (~> 3.8.0)
|
22
|
+
rspec-mocks (3.8.2)
|
20
23
|
diff-lcs (>= 1.2.0, < 2.0)
|
21
|
-
rspec-support (~> 3.
|
22
|
-
rspec-support (3.
|
24
|
+
rspec-support (~> 3.8.0)
|
25
|
+
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)
|
23
31
|
|
24
32
|
PLATFORMS
|
25
33
|
ruby
|
26
34
|
|
27
35
|
DEPENDENCIES
|
28
|
-
bundler (~> 1.11, >= 1.11.0)
|
29
36
|
hellgrid!
|
30
|
-
rspec (~> 3.
|
37
|
+
rspec (~> 3.8.0)
|
38
|
+
simplecov (~> 0.16.0)
|
31
39
|
|
32
40
|
BUNDLED WITH
|
33
|
-
1.
|
41
|
+
1.17.3
|
data/README.md
CHANGED
@@ -2,7 +2,8 @@
|
|
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=
|
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)
|
6
7
|
|
7
8
|
## Install
|
8
9
|
|
data/bin/hellgrid
CHANGED
@@ -1,28 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'pathname'
|
4
|
-
|
4
|
+
# XXX: BUNDLE_GEMFILE should be provided because the internals of bundler require a 'Gemfile' or '.bundle' to
|
5
|
+
# work properly. Without this the script will fail if there isn't a Gemfile somewhere up the directory chain
|
6
|
+
ENV['BUNDLE_GEMFILE'] ||= File.join(File.expand_path('../..', Pathname.new(__FILE__).realpath), 'Gemfile')
|
5
7
|
|
6
8
|
require 'rubygems'
|
7
9
|
require 'bundler/setup'
|
8
|
-
require 'find'
|
9
10
|
|
10
11
|
require 'hellgrid'
|
11
12
|
|
12
|
-
|
13
|
-
folders = ARGV.empty? ? [Dir.pwd] : ARGV
|
14
|
-
|
15
|
-
folders.each do |folder|
|
16
|
-
matrix = Hellgrid::Matrix.new
|
17
|
-
|
18
|
-
Find.find(folder) do |path|
|
19
|
-
if File.directory?(path) && File.exists?(File.join(path, 'Gemfile.lock'))
|
20
|
-
matrix.add_project(Hellgrid::Project.new(folder, path))
|
21
|
-
Find.prune unless recursive_search
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
view = Hellgrid::Views::Console.new(matrix.sorted_by_most_used)
|
26
|
-
|
27
|
-
view.render
|
28
|
-
end
|
13
|
+
Hellgrid::CLI.start
|
data/exe/hellgrid
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'pathname'
|
4
|
+
# XXX: BUNDLE_GEMFILE should be provided because the internals of bundler require a 'Gemfile' or '.bundle' to
|
5
|
+
# work properly. Without this the script will fail if there isn't a Gemfile somewhere up the directory chain
|
6
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', Pathname.new(__FILE__).realpath)
|
7
|
+
|
8
|
+
require 'hellgrid'
|
9
|
+
|
10
|
+
Hellgrid::CLI.start
|
data/hellgrid.gemspec
CHANGED
@@ -7,17 +7,20 @@ require 'hellgrid/version'
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = 'hellgrid'
|
9
9
|
s.version = Hellgrid::VERSION
|
10
|
-
s.date = '2016-09-20'
|
11
10
|
s.summary = 'Gem version dependency matrix'
|
11
|
+
s.description = 'Display gem versions used across your projects in a table'
|
12
12
|
s.authors = ['Deyan Dobrinov', 'Aleksandar Ivanov']
|
13
13
|
s.email = ['engineering+hellgrid@fundingcircle.com']
|
14
|
-
s.files = Dir.chdir(project_root) { Dir['lib/**/*.rb'] + Dir['bin/*'] + Dir['spec/**/*.rb'] + %w(Gemfile Gemfile.lock README.md hellgrid.gemspec) }
|
15
|
-
s.
|
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) }
|
15
|
+
s.bindir = 'exe'
|
16
|
+
s.executables = s.files.grep(/^exe\//) { |f| File.basename(f) }
|
16
17
|
s.test_files = s.files.grep(/^spec\//)
|
17
18
|
s.require_paths = ['lib']
|
18
19
|
s.homepage = 'https://github.com/FundingCircle/hellgrid'
|
19
20
|
s.license = 'BSD-3-Clause'
|
20
21
|
|
21
|
-
s.
|
22
|
-
|
22
|
+
s.add_runtime_dependency 'bundler', '>= 1.11.0', '< 3'
|
23
|
+
|
24
|
+
s.add_development_dependency 'rspec', '~> 3.8.0'
|
25
|
+
s.add_development_dependency 'simplecov', '~> 0.16.0'
|
23
26
|
end
|
data/lib/hellgrid.rb
CHANGED
data/lib/hellgrid/cli.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
module Hellgrid
|
2
|
+
class CLI
|
3
|
+
def self.start(argv = ARGV)
|
4
|
+
new(argv).start
|
5
|
+
end
|
6
|
+
|
7
|
+
def initialize(argv = ARGV)
|
8
|
+
@argv = argv
|
9
|
+
end
|
10
|
+
|
11
|
+
attr_reader :argv
|
12
|
+
|
13
|
+
def start
|
14
|
+
recursive_search = !!(argv.delete('-r'))
|
15
|
+
folders = argv.empty? ? [Dir.pwd] : argv
|
16
|
+
|
17
|
+
folders.each do |folder|
|
18
|
+
matrix = Hellgrid::Matrix.new
|
19
|
+
|
20
|
+
Find.find(folder) do |path|
|
21
|
+
if File.directory?(path) && File.exists?(File.join(path, 'Gemfile.lock'))
|
22
|
+
matrix.add_project(Hellgrid::Project.new(folder, path))
|
23
|
+
Find.prune unless recursive_search
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
view = Hellgrid::Views::Console.new(matrix.sorted_by_most_used)
|
28
|
+
|
29
|
+
view.render
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/hellgrid/version.rb
CHANGED
data/spec/hellgrid_spec.rb
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'bin/hellgrid' do
|
4
|
+
def with_unbundled_env(&block)
|
5
|
+
if Bundler.respond_to?(:with_unbundled_env)
|
6
|
+
Bundler.with_unbundled_env(&block)
|
7
|
+
else
|
8
|
+
Bundler.with_clean_env(&block)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
4
12
|
before do
|
5
13
|
delete_tmp_folder
|
6
14
|
|
@@ -88,7 +96,7 @@ TABLE
|
|
88
96
|
rspec-support | x | 3.0.4
|
89
97
|
TABLE
|
90
98
|
|
91
|
-
|
99
|
+
with_unbundled_env do
|
92
100
|
expect(`cd ~ && #{PROJECT_ROOT}/bin/hellgrid #{PROJECT_ROOT}/spec/tmp`).to eq(expected_result)
|
93
101
|
end
|
94
102
|
end
|
@@ -106,23 +114,19 @@ TABLE
|
|
106
114
|
rspec-support | x | 3.0.4
|
107
115
|
TABLE
|
108
116
|
|
109
|
-
|
117
|
+
with_unbundled_env do
|
110
118
|
expect(`cd #{PROJECT_ROOT}/spec/tmp && #{PROJECT_ROOT}/bin/hellgrid`).to eq(expected_result)
|
111
119
|
end
|
112
120
|
end
|
113
121
|
|
114
122
|
context 'when passing -r' do
|
115
123
|
it 'searches recursively within folders if you flag it to' do
|
116
|
-
|
117
|
-
expect(`cd #{PROJECT_ROOT} && #{PROJECT_ROOT}/bin/hellgrid -r
|
124
|
+
with_unbundled_env do
|
125
|
+
expect(`cd #{PROJECT_ROOT} && #{PROJECT_ROOT}/bin/hellgrid -r`.lines.first).to(
|
118
126
|
include(
|
119
127
|
'hellgrid',
|
120
128
|
'spec/tmp/bar',
|
121
129
|
'spec/tmp/in/foo',
|
122
|
-
'rspec',
|
123
|
-
'3.4.0',
|
124
|
-
'2.0.0',
|
125
|
-
'3.0.0'
|
126
130
|
)
|
127
131
|
)
|
128
132
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,57 +1,65 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hellgrid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Deyan Dobrinov
|
8
8
|
- Aleksandar Ivanov
|
9
|
-
autorequire:
|
10
|
-
bindir:
|
9
|
+
autorequire:
|
10
|
+
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-02-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: bundler
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 1.11.0
|
21
|
+
- - "<"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '3'
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
21
28
|
- - ">="
|
22
29
|
- !ruby/object:Gem::Version
|
23
|
-
version:
|
30
|
+
version: 1.11.0
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3'
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: rspec
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 3.8.0
|
24
41
|
type: :development
|
25
42
|
prerelease: false
|
26
43
|
version_requirements: !ruby/object:Gem::Requirement
|
27
44
|
requirements:
|
28
45
|
- - "~>"
|
29
46
|
- !ruby/object:Gem::Version
|
30
|
-
version:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 3.4.0
|
47
|
+
version: 3.8.0
|
34
48
|
- !ruby/object:Gem::Dependency
|
35
|
-
name:
|
49
|
+
name: simplecov
|
36
50
|
requirement: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
41
|
-
- - ">="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 1.11.0
|
54
|
+
version: 0.16.0
|
44
55
|
type: :development
|
45
56
|
prerelease: false
|
46
57
|
version_requirements: !ruby/object:Gem::Requirement
|
47
58
|
requirements:
|
48
59
|
- - "~>"
|
49
60
|
- !ruby/object:Gem::Version
|
50
|
-
version:
|
51
|
-
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: 1.11.0
|
54
|
-
description:
|
61
|
+
version: 0.16.0
|
62
|
+
description: Display gem versions used across your projects in a table
|
55
63
|
email:
|
56
64
|
- engineering+hellgrid@fundingcircle.com
|
57
65
|
executables:
|
@@ -63,8 +71,10 @@ files:
|
|
63
71
|
- Gemfile.lock
|
64
72
|
- README.md
|
65
73
|
- bin/hellgrid
|
74
|
+
- exe/hellgrid
|
66
75
|
- hellgrid.gemspec
|
67
76
|
- lib/hellgrid.rb
|
77
|
+
- lib/hellgrid/cli.rb
|
68
78
|
- lib/hellgrid/matrix.rb
|
69
79
|
- lib/hellgrid/project.rb
|
70
80
|
- lib/hellgrid/version.rb
|
@@ -78,7 +88,7 @@ homepage: https://github.com/FundingCircle/hellgrid
|
|
78
88
|
licenses:
|
79
89
|
- BSD-3-Clause
|
80
90
|
metadata: {}
|
81
|
-
post_install_message:
|
91
|
+
post_install_message:
|
82
92
|
rdoc_options: []
|
83
93
|
require_paths:
|
84
94
|
- lib
|
@@ -93,9 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
103
|
- !ruby/object:Gem::Version
|
94
104
|
version: '0'
|
95
105
|
requirements: []
|
96
|
-
|
97
|
-
|
98
|
-
signing_key:
|
106
|
+
rubygems_version: 3.0.3
|
107
|
+
signing_key:
|
99
108
|
specification_version: 4
|
100
109
|
summary: Gem version dependency matrix
|
101
110
|
test_files:
|
@@ -104,4 +113,3 @@ test_files:
|
|
104
113
|
- spec/hellgrid/views/console_spec.rb
|
105
114
|
- spec/hellgrid_spec.rb
|
106
115
|
- spec/spec_helper.rb
|
107
|
-
has_rdoc:
|