Skip to content

Commit 7c72cd3

Browse files
authored
Merge pull request #37 from FundingCircle/update-ruby-and-lint
Specify required_ruby_version >= 3.1.0 and run rubocop
2 parents 8b8fba3 + eb09e71 commit 7c72cd3

19 files changed

Lines changed: 278 additions & 213 deletions

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Set up Ruby
3232
uses: ruby/setup-ruby@v1
3333
with:
34-
ruby-version: 3.3
34+
ruby-version: 3.4
3535
bundler-cache: true
3636

3737
- name: Run tests

.github/workflows/publish-gem.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Ruby
1616
uses: ruby/setup-ruby@v1
1717
with:
18-
ruby-version: '3.3'
18+
ruby-version: '3.4'
1919
bundler-cache: true
2020

2121
- name: Build gem

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.4.2

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24

35
gemspec

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Utility which will output a table containing gem versions used across your projects.
44

55
[![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)
67

78
## Install
89

bin/hellgrid

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
23

34
require 'pathname'
45
# XXX: BUNDLE_GEMFILE should be provided because the internals of bundler require a 'Gemfile' or '.bundle' to

exe/hellgrid

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
23

34
require 'pathname'
45
# XXX: BUNDLE_GEMFILE should be provided because the internals of bundler require a 'Gemfile' or '.bundle' to

hellgrid.gemspec

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
project_root = File.dirname(__FILE__)
24
lib = File.join(project_root, 'lib')
35

@@ -11,15 +13,23 @@ Gem::Specification.new do |s|
1113
s.description = 'Display gem versions used across your projects in a table'
1214
s.authors = ['Deyan Dobrinov', 'Aleksandar Ivanov']
1315
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
1523
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/})
1826
s.require_paths = ['lib']
1927
s.homepage = 'https://github.com/FundingCircle/hellgrid'
2028
s.license = 'BSD-3-Clause'
2129

30+
s.required_ruby_version = '>= 3.1.0'
31+
2232
s.add_runtime_dependency 'bundler', '>= 1.11.0', '< 3'
2333

24-
s.add_development_dependency 'rspec', '~> 3.8.0'
34+
s.add_development_dependency 'rspec', '~> 3.13'
2535
end

lib/hellgrid.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'bundler'
24
require 'find'
35
require 'hellgrid/project'

lib/hellgrid/cli.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Hellgrid
24
class CLI
35
def self.start(argv = ARGV)
@@ -11,8 +13,8 @@ def initialize(argv = ARGV)
1113
attr_reader :argv
1214

1315
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?
1618

1719
folders = argv.empty? ? [Dir.pwd] : argv
1820

0 commit comments

Comments
 (0)