File tree Expand file tree Collapse file tree 11 files changed +51
-32
lines changed
Expand file tree Collapse file tree 11 files changed +51
-32
lines changed Original file line number Diff line number Diff line change @@ -2,31 +2,40 @@ require: rubocop-rspec
22
33AllCops :
44 TargetRubyVersion : 2.6
5+ NewCops : enable
56 Exclude :
67 - bin/*
78 - vendor/**/*
89 - Guardfile
910
11+ Layout/LineLength :
12+ Max : 140
13+
1014Layout/SpaceInsideHashLiteralBraces :
1115 EnforcedStyle : no_space
1216
17+ Lint/EmptyBlock :
18+ Exclude :
19+ - spec/**/*
20+ - lib/proforma/services/exporter.rb
21+
1322Metrics/ClassLength :
1423 Max : 150
1524
16- Metrics/LineLength :
17- Max : 140
18-
1925Metrics/BlockLength :
2026 Exclude :
21- - ' spec/**/*'
27+ - spec/**/*
2228 - proforma.gemspec
2329
24- RSpec/NestedGroups :
25- Max : 5
26-
2730Style/Documentation :
2831 Enabled : false
2932
33+ RSpec/NestedGroups :
34+ Max : 5
35+
3036RSpec/DescribeClass :
3137 Exclude :
3238 - spec/custom_matchers/*
39+
40+ RSpec/MultipleMemoizedHelpers :
41+ Enabled : false
Original file line number Diff line number Diff line change 1818 minitest (>= 5.1 )
1919 tzinfo (~> 2.0 )
2020 zeitwerk (~> 2.3 )
21- ast (2.4.1 )
21+ ast (2.4.2 )
2222 byebug (11.1.3 )
2323 coderay (1.1.3 )
2424 concurrent-ruby (1.1.8 )
4444 rspec (>= 2.99.0 , < 4.0 )
4545 i18n (1.8.10 )
4646 concurrent-ruby (~> 1.0 )
47- jaro_winkler (1.5.4 )
4847 listen (3.2.1 )
4948 rb-fsevent (~> 0.10 , >= 0.10.3 )
5049 rb-inotify (~> 0.9 , >= 0.9.10 )
5958 notiffany (0.1.3 )
6059 nenv (~> 0.1 )
6160 shellany (~> 0.0 )
62- parallel (1.19.2 )
63- parser (2.7 .1.4 )
61+ parallel (1.20.1 )
62+ parser (3.0 .1.0 )
6463 ast (~> 2.4.1 )
6564 pry (0.13.1 )
6665 coderay (~> 1.1 )
7473 rb-fsevent (0.10.3 )
7574 rb-inotify (0.10.1 )
7675 ffi (~> 1.0 )
76+ regexp_parser (2.1.1 )
77+ rexml (3.2.5 )
7778 rspec (3.10.0 )
7879 rspec-core (~> 3.10.0 )
7980 rspec-expectations (~> 3.10.0 )
8990 diff-lcs (>= 1.2.0 , < 2.0 )
9091 rspec-support (~> 3.10.0 )
9192 rspec-support (3.10.0 )
92- rubocop (0.77.0 )
93- jaro_winkler (~> 1.5.1 )
93+ rubocop (1.12.1 )
9494 parallel (~> 1.10 )
95- parser (>= 2.6 )
95+ parser (>= 3.0.0.0 )
9696 rainbow (>= 2.2.2 , < 4.0 )
97+ regexp_parser (>= 1.8 , < 3.0 )
98+ rexml
99+ rubocop-ast (>= 1.2.0 , < 2.0 )
97100 ruby-progressbar (~> 1.7 )
98- unicode-display_width (>= 1.4.0 , < 1.7 )
99- rubocop-rspec (1.41.0 )
100- rubocop (>= 0.68.1 )
101- ruby-progressbar (1.10.1 )
101+ unicode-display_width (>= 1.4.0 , < 3.0 )
102+ rubocop-ast (1.4.1 )
103+ parser (>= 2.7.1.5 )
104+ rubocop-rspec (2.2.0 )
105+ rubocop (~> 1.0 )
106+ rubocop-ast (>= 1.1.0 )
107+ ruby-progressbar (1.11.0 )
102108 rubyzip (2.3.0 )
103109 shellany (0.0.1 )
104110 simplecov (0.21.2 )
110116 thor (1.0.1 )
111117 tzinfo (2.0.4 )
112118 concurrent-ruby (~> 1.0 )
113- unicode-display_width (1.6.1 )
119+ unicode-display_width (2.0.0 )
114120 zeitwerk (2.4.2 )
115121
116122PLATFORMS
@@ -127,8 +133,8 @@ DEPENDENCIES
127133 rake (~> 13.0 )
128134 rspec (~> 3.0 )
129135 rspec-collection_matchers (~> 1.2.0 )
130- rubocop (~> 0.77.0 )
131- rubocop-rspec (~> 1.41 .0 )
136+ rubocop (~> 1.12.1 )
137+ rubocop-rspec (~> 2.2 .0 )
132138 simplecov (~> 0.21.2 )
133139
134140BUNDLED WITH
Original file line number Diff line number Diff line change 22
33module Proforma
44 class ProformaError < StandardError ; end
5+
56 class PostGenerateValidationError < ProformaError ; end
7+
68 class PreImportValidationError < ProformaError ; end
79end
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def add_test_configuration(xml, test)
3030 if test . meta_data
3131 xml . send ( 'test-meta-data' ) do
3232 # underscore is used to disambiguate tag names from ruby methods
33- test . meta_data . each { |key , value | xml [ 'c' ] . send ( key . to_s + '_' , value ) }
33+ test . meta_data . each { |key , value | xml [ 'c' ] . send ( " #{ key } _" , value ) }
3434 end
3535 end
3636 end
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def any_data_tag(any_data_node)
7878 { } . tap do |any_data |
7979 return any_data if any_data_node . nil?
8080
81- any_data_node . attributes . values . each { |attribute | any_data [ attribute . name ] = attribute . value }
81+ any_data_node . attributes . each_value { |attribute | any_data [ attribute . name ] = attribute . value }
8282 any_data_node . children . each { |any_data_tag | any_data [ any_data_tag . name ] = any_data_tag . children . first . text }
8383 end
8484 end
Original file line number Diff line number Diff line change @@ -87,9 +87,10 @@ def add_model_solution(model_solution_node)
8787 def add_file ( file_node )
8888 file_tag = file_node . children . first
8989 file = nil
90- if /embedded-(bin|txt)-file/ . match? file_tag . name
90+ case file_tag . name
91+ when /embedded-(bin|txt)-file/
9192 file = TaskFile . new ( embedded_file_attributes ( file_node . attributes , file_tag ) )
92- elsif /attached-(bin|txt)-file/ . match? file_tag . name
93+ when /attached-(bin|txt)-file/
9394 file = TaskFile . new ( attached_file_attributes ( file_node . attributes , file_tag ) )
9495 end
9596 @task . files << file
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ Gem::Specification.new do |spec|
1515 spec . homepage = 'https://github.com/openHPI/proforma'
1616 spec . license = 'MIT'
1717
18+ spec . required_ruby_version = '~> 2.6'
1819 # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
1920 # to allow pushing to a single host or delete this section to allow pushing to any host.
2021 # if spec.respond_to?(:metadata)
@@ -51,7 +52,7 @@ Gem::Specification.new do |spec|
5152 spec . add_development_dependency 'rake' , '~> 13.0'
5253 spec . add_development_dependency 'rspec' , '~> 3.0'
5354 spec . add_development_dependency 'rspec-collection_matchers' , '~> 1.2.0'
54- spec . add_development_dependency 'rubocop' , '~> 0.77.0 '
55- spec . add_development_dependency 'rubocop-rspec' , '~> 1.41 .0'
55+ spec . add_development_dependency 'rubocop' , '~> 1.12.1 '
56+ spec . add_development_dependency 'rubocop-rspec' , '~> 2.2 .0'
5657 spec . add_development_dependency 'simplecov' , '~> 0.21.2'
5758end
Original file line number Diff line number Diff line change 393393 let ( :version ) { '2.0.1' }
394394
395395 it 'creates a file with the correct version' do
396- expect ( doc . namespaces [ 'xmlns' ] ) . to eql 'urn:proforma:v2.0.1'
396+ expect ( doc . namespaces [ 'xmlns' ] ) . to eql 'urn:proforma:v2.0.1'
397397 end
398398 end
399399
400400 context 'when version is 2.0' do
401401 let ( :version ) { '2.0' }
402402
403403 it 'creates a file with the correct version' do
404- expect ( doc . namespaces [ 'xmlns' ] ) . to eql 'urn:proforma:v2.0'
404+ expect ( doc . namespaces [ 'xmlns' ] ) . to eql 'urn:proforma:v2.0'
405405 end
406406 end
407407
Original file line number Diff line number Diff line change 99require 'factory_bot'
1010require 'pry-byebug'
1111
12- Dir [ './spec/support/**/*.rb' ] . each { |f | require f }
12+ Dir [ './spec/support/**/*.rb' ] . sort . each { |f | require f }
1313# RSpec::Support::ObjectFormatter.default_instance.max_formatted_output_length = 999_999_999
1414RSpec . configure do |config |
1515 # Enable flags like --only-failures and --next-failure
Original file line number Diff line number Diff line change @@ -41,6 +41,6 @@ def array_equal?(object, other)
4141 end
4242
4343 def attributes ( object )
44- Hash [ object . instance_variables . map { |e | [ e . slice ( 1 , e . length - 1 ) . to_sym , object . instance_variable_get ( e ) ] } ]
44+ object . instance_variables . map { |e | [ e . slice ( 1 , e . length - 1 ) . to_sym , object . instance_variable_get ( e ) ] } . to_h
4545 end
4646end
You can’t perform that action at this time.
0 commit comments