File tree 6 files changed +20
-23
lines changed
6 files changed +20
-23
lines changed Original file line number Diff line number Diff line change 50
50
strategy :
51
51
matrix :
52
52
ruby :
53
+ - ' 2.5'
53
54
- ' 2.6'
54
55
- ' 2.7'
55
56
- ' 3.0'
Original file line number Diff line number Diff line change @@ -6,9 +6,10 @@ AllCops:
6
6
Exclude :
7
7
- !ruby/regexp /katello-installer/
8
8
- !ruby/regexp /.spec/
9
- TargetRubyVersion : 2.0
9
+ TargetRubyVersion : 2.5
10
+ NewCops : enable
10
11
11
- Metrics /LineLength :
12
+ Layout /LineLength :
12
13
Max : 120
13
14
14
15
Metrics/ClassLength :
@@ -17,14 +18,14 @@ Metrics/ClassLength:
17
18
Metrics/BlockLength :
18
19
Max : 50
19
20
20
- Documentation :
21
+ Style/ Documentation :
21
22
Enabled : false # don't require documentation
22
23
23
- MethodLength :
24
+ Metrics/ MethodLength :
24
25
Description : ' Avoid methods longer than 30 lines of code.'
25
26
Max : 30
26
27
27
- HashSyntax :
28
+ Style/ HashSyntax :
28
29
Enabled : false # don't force 1.9 hash syntax
29
30
30
31
Layout/EmptyLinesAroundClassBody :
Original file line number Diff line number Diff line change 1
- # rubocop:disable Naming/FileName
2
1
source 'https://rubygems.org'
3
2
4
- if RUBY_VERSION < '2.1'
5
- gem 'psych' , '~> 2.0'
6
- end
7
-
8
3
group :test do
9
4
gem 'deep_merge'
10
5
gem 'json'
11
6
gem 'minitest'
12
7
gem 'mocha'
13
8
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
20
9
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
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
- $LOAD_PATH. unshift File . dirname ( __FILE__ )
3
+ $LOAD_PATH. unshift __dir__
4
4
5
- files = Dir [ File . dirname ( __FILE__ ) + ' /forklift/**/*.rb' ]
5
+ files = Dir [ " #{ __dir__ } /forklift/**/*.rb" ]
6
6
files . uniq . each { |f | require f }
7
7
8
8
module Forklift
Original file line number Diff line number Diff line change 5
5
module Forklift
6
6
class BoxDistributor
7
7
8
- VAGRANTFILE_API_VERSION = '2' . freeze
8
+ VAGRANTFILE_API_VERSION = '2'
9
9
10
10
def initialize ( boxes )
11
11
@ansible_groups = { }
@@ -177,12 +177,12 @@ def configure_networks(networks)
177
177
def configure_ansible ( machine , ansible , box_name )
178
178
return unless ansible
179
179
180
- if ansible . key? ( 'group' ) && ! ansible [ 'group' ] . nil?
180
+ unless ansible [ 'group' ] . nil?
181
181
@ansible_groups [ ansible [ 'group' ] . to_s ] ||= [ ]
182
182
@ansible_groups [ ansible [ 'group' ] . to_s ] << box_name
183
183
end
184
184
185
- if ansible . key? ( 'server' ) && ! ansible [ 'server' ] . nil?
185
+ unless ansible [ 'server' ] . nil?
186
186
@ansible_groups [ "server-#{ box_name } " ] = ansible [ 'server' ]
187
187
end
188
188
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def add_boxes!(box_file)
31
31
32
32
def filter_boxes!
33
33
box_config = Settings . new . settings [ 'boxes' ]
34
- return unless box_config && box_config . key? ( 'exclude' )
34
+ return unless box_config & .key? ( 'exclude' )
35
35
36
36
@boxes . reject! do |name , _box |
37
37
box_config [ 'exclude' ] . any? { |exclude | name . match ( /#{ exclude } / ) }
You can’t perform that action at this time.
0 commit comments