Skip to content

Commit 982aa49

Browse files
committed
Set Ruby 2.5 as the minimum version
1 parent e195333 commit 982aa49

File tree

6 files changed

+20
-23
lines changed

6 files changed

+20
-23
lines changed

.github/workflows/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
strategy:
5151
matrix:
5252
ruby:
53+
- '2.5'
5354
- '2.6'
5455
- '2.7'
5556
- '3.0'

vagrant/.rubocop.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ AllCops:
66
Exclude:
77
- !ruby/regexp /katello-installer/
88
- !ruby/regexp /.spec/
9-
TargetRubyVersion: 2.0
9+
TargetRubyVersion: 2.5
10+
NewCops: enable
1011

11-
Metrics/LineLength:
12+
Layout/LineLength:
1213
Max: 120
1314

1415
Metrics/ClassLength:
@@ -17,14 +18,14 @@ Metrics/ClassLength:
1718
Metrics/BlockLength:
1819
Max: 50
1920

20-
Documentation:
21+
Style/Documentation:
2122
Enabled: false # don't require documentation
2223

23-
MethodLength:
24+
Metrics/MethodLength:
2425
Description: 'Avoid methods longer than 30 lines of code.'
2526
Max: 30
2627

27-
HashSyntax:
28+
Style/HashSyntax:
2829
Enabled: false # don't force 1.9 hash syntax
2930

3031
Layout/EmptyLinesAroundClassBody:

vagrant/Gemfile

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
1-
# rubocop:disable Naming/FileName
21
source 'https://rubygems.org'
32

4-
if RUBY_VERSION < '2.1'
5-
gem 'psych', '~> 2.0'
6-
end
7-
83
group :test do
94
gem 'deep_merge'
105
gem 'json'
116
gem 'minitest'
127
gem 'mocha'
138
gem 'rake'
14-
if RUBY_VERSION < '3.1'
15-
# we need a rubocop that still can manage Ruby 2.0 code
16-
# but 0.49.x is not compatible with Ruby 3.1
17-
gem 'rubocop', '<0.50'
18-
end
19-
end
209

21-
# rubocop:enable Naming/FileName
10+
# Supports Ruby 2.5
11+
# https://docs.rubocop.org/rubocop/compatibility.html#support-matrix
12+
gem 'rubocop', '~> 1.28.0'
13+
gem 'rubocop-minitest'
14+
gem 'rubocop-performance'
15+
gem 'rubocop-rake'
16+
end

vagrant/lib/forklift.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# frozen_string_literal: true
22

3-
$LOAD_PATH.unshift File.dirname(__FILE__)
3+
$LOAD_PATH.unshift __dir__
44

5-
files = Dir[File.dirname(__FILE__) + '/forklift/**/*.rb']
5+
files = Dir["#{__dir__}/forklift/**/*.rb"]
66
files.uniq.each { |f| require f }
77

88
module Forklift

vagrant/lib/forklift/box_distributor.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
module Forklift
66
class BoxDistributor
77

8-
VAGRANTFILE_API_VERSION = '2'.freeze
8+
VAGRANTFILE_API_VERSION = '2'
99

1010
def initialize(boxes)
1111
@ansible_groups = {}
@@ -177,12 +177,12 @@ def configure_networks(networks)
177177
def configure_ansible(machine, ansible, box_name)
178178
return unless ansible
179179

180-
if ansible.key?('group') && !ansible['group'].nil?
180+
unless ansible['group'].nil?
181181
@ansible_groups[ansible['group'].to_s] ||= []
182182
@ansible_groups[ansible['group'].to_s] << box_name
183183
end
184184

185-
if ansible.key?('server') && !ansible['server'].nil?
185+
unless ansible['server'].nil?
186186
@ansible_groups["server-#{box_name}"] = ansible['server']
187187
end
188188

vagrant/lib/forklift/box_factory.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def add_boxes!(box_file)
3131

3232
def filter_boxes!
3333
box_config = Settings.new.settings['boxes']
34-
return unless box_config && box_config.key?('exclude')
34+
return unless box_config&.key?('exclude')
3535

3636
@boxes.reject! do |name, _box|
3737
box_config['exclude'].any? { |exclude| name.match(/#{exclude}/) }

0 commit comments

Comments
 (0)