proformaxml 1.5.0 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a99c650e5288b8e0d9e377a808d4837c2e9f7d54830a52201d03ffc947d25b34
4
- data.tar.gz: 99088e189b997b80f20d0abe18fa18dc3b113ebfb0db7ecf6b7b1120d811aa33
3
+ metadata.gz: d6a424eb17efb03a22dac8b018ed30feb977fad2d37a5362f792647a5f3a8c42
4
+ data.tar.gz: 1f277120bc96e89608064bdcd2357eab6914e2f1f115400505a79d05b880411c
5
5
  SHA512:
6
- metadata.gz: dd7648193e3408806e11c069ebf7c86e14ff456ecf0d7050a6d4c9caf4ed6895e477421c22c23e61ff82ae644c5fb175f15632a443a324fbba50686e5ca9e2b0
7
- data.tar.gz: 667600bb7fc60f57345d25609fd80f9d5c352a7f21e52672413e7aa9986df8b4b5353db7ad09d446974a3200e459a537e8a75255c1a17f184d544f448786fd7a
6
+ metadata.gz: 0ab036a003a5292b736e1ab0b501c452c2c03a3966982084649f7a45b5761af66df108882de8c1c79c0b5d8759f6bd7fb3f2968867798b8084d7f1c596e949dd
7
+ data.tar.gz: 16428bbc3cb3b2f7e5c609a1836ae96119ba1e72b09c71021e41b18fd46a89c8c532f659b83223a48677d4580e3fca96adbd84ceb75f5a94c8118d01d6d7a1b3
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- proformaxml (1.5.0)
5
- activemodel (>= 5.2.3, < 8.0.0)
6
- activesupport (>= 5.2.3, < 8.0.0)
4
+ proformaxml (1.5.2)
5
+ activemodel (>= 5.2.3, < 9.0.0)
6
+ activesupport (>= 5.2.3, < 9.0.0)
7
7
  dachsfisch (~> 1.0.0)
8
8
  nokogiri (>= 1.10.2, < 2.0.0)
9
9
  rubyzip (>= 1.2.2, < 3.0.0)
@@ -11,35 +11,39 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activemodel (7.1.3.4)
15
- activesupport (= 7.1.3.4)
16
- activesupport (7.1.3.4)
14
+ activemodel (8.0.0)
15
+ activesupport (= 8.0.0)
16
+ activesupport (8.0.0)
17
17
  base64
18
+ benchmark (>= 0.3)
18
19
  bigdecimal
19
- concurrent-ruby (~> 1.0, >= 1.0.2)
20
+ concurrent-ruby (~> 1.0, >= 1.3.1)
20
21
  connection_pool (>= 2.2.5)
21
22
  drb
22
23
  i18n (>= 1.6, < 2)
24
+ logger (>= 1.4.2)
23
25
  minitest (>= 5.1)
24
- mutex_m
25
- tzinfo (~> 2.0)
26
+ securerandom (>= 0.3)
27
+ tzinfo (~> 2.0, >= 2.0.5)
28
+ uri (>= 0.13.1)
26
29
  ast (2.4.2)
27
30
  base64 (0.2.0)
31
+ benchmark (0.4.0)
28
32
  bigdecimal (3.1.8)
29
33
  byebug (11.1.3)
30
34
  coderay (1.1.3)
31
- concurrent-ruby (1.3.3)
35
+ concurrent-ruby (1.3.4)
32
36
  connection_pool (2.4.1)
33
- dachsfisch (1.0.0)
37
+ dachsfisch (1.0.2)
34
38
  nokogiri (>= 1.14.1, < 2.0.0)
35
39
  diff-lcs (1.5.1)
36
- docile (1.4.0)
40
+ docile (1.4.1)
37
41
  drb (2.2.1)
38
- factory_bot (6.4.6)
42
+ factory_bot (6.5.0)
39
43
  activesupport (>= 5.0.0)
40
44
  ffi (1.17.0)
41
45
  formatador (1.1.0)
42
- guard (2.18.1)
46
+ guard (2.19.0)
43
47
  formatador (>= 0.2.4)
44
48
  listen (>= 2.7, < 4.0)
45
49
  lumberjack (>= 1.0.12, < 2.0)
@@ -53,27 +57,27 @@ GEM
53
57
  guard (~> 2.1)
54
58
  guard-compat (~> 1.1)
55
59
  rspec (>= 2.99.0, < 4.0)
56
- i18n (1.14.5)
60
+ i18n (1.14.6)
57
61
  concurrent-ruby (~> 1.0)
58
- json (2.7.2)
62
+ json (2.8.1)
59
63
  language_server-protocol (3.17.0.3)
60
64
  listen (3.9.0)
61
65
  rb-fsevent (~> 0.10, >= 0.10.3)
62
66
  rb-inotify (~> 0.9, >= 0.9.10)
67
+ logger (1.6.1)
63
68
  lumberjack (1.2.10)
64
69
  method_source (1.1.0)
65
70
  mini_portile2 (2.8.7)
66
- minitest (5.24.1)
67
- mutex_m (0.2.0)
71
+ minitest (5.25.1)
68
72
  nenv (0.3.0)
69
- nokogiri (1.16.6)
73
+ nokogiri (1.16.7)
70
74
  mini_portile2 (~> 2.8.2)
71
75
  racc (~> 1.4)
72
76
  notiffany (0.1.3)
73
77
  nenv (~> 0.1)
74
78
  shellany (~> 0.0)
75
- parallel (1.25.1)
76
- parser (3.3.4.0)
79
+ parallel (1.26.3)
80
+ parser (3.3.6.0)
77
81
  ast (~> 2.4.1)
78
82
  racc
79
83
  pry (0.14.2)
@@ -82,75 +86,73 @@ GEM
82
86
  pry-byebug (3.10.1)
83
87
  byebug (~> 11.0)
84
88
  pry (>= 0.13, < 0.15)
85
- racc (1.8.0)
86
- rack (3.1.6)
89
+ racc (1.8.1)
90
+ rack (3.1.8)
87
91
  rainbow (3.1.1)
88
92
  rake (13.2.1)
89
93
  rb-fsevent (0.11.2)
90
94
  rb-inotify (0.11.1)
91
95
  ffi (~> 1.0)
92
96
  regexp_parser (2.9.2)
93
- rexml (3.3.2)
94
- strscan
95
97
  rspec (3.13.0)
96
98
  rspec-core (~> 3.13.0)
97
99
  rspec-expectations (~> 3.13.0)
98
100
  rspec-mocks (~> 3.13.0)
99
101
  rspec-collection_matchers (1.2.1)
100
102
  rspec-expectations (>= 2.99.0.beta1)
101
- rspec-core (3.13.0)
103
+ rspec-core (3.13.2)
102
104
  rspec-support (~> 3.13.0)
103
- rspec-expectations (3.13.1)
105
+ rspec-expectations (3.13.3)
104
106
  diff-lcs (>= 1.2.0, < 2.0)
105
107
  rspec-support (~> 3.13.0)
106
108
  rspec-github (2.4.0)
107
109
  rspec-core (~> 3.0)
108
- rspec-mocks (3.13.1)
110
+ rspec-mocks (3.13.2)
109
111
  diff-lcs (>= 1.2.0, < 2.0)
110
112
  rspec-support (~> 3.13.0)
111
113
  rspec-support (3.13.1)
112
- rubocop (1.65.0)
114
+ rubocop (1.68.0)
113
115
  json (~> 2.3)
114
116
  language_server-protocol (>= 3.17.0)
115
117
  parallel (~> 1.10)
116
118
  parser (>= 3.3.0.2)
117
119
  rainbow (>= 2.2.2, < 4.0)
118
120
  regexp_parser (>= 2.4, < 3.0)
119
- rexml (>= 3.2.5, < 4.0)
120
- rubocop-ast (>= 1.31.1, < 2.0)
121
+ rubocop-ast (>= 1.32.2, < 2.0)
121
122
  ruby-progressbar (~> 1.7)
122
123
  unicode-display_width (>= 2.4.0, < 3.0)
123
- rubocop-ast (1.31.3)
124
+ rubocop-ast (1.34.1)
124
125
  parser (>= 3.3.1.0)
125
126
  rubocop-factory_bot (2.26.1)
126
127
  rubocop (~> 1.61)
127
- rubocop-performance (1.21.1)
128
+ rubocop-performance (1.22.1)
128
129
  rubocop (>= 1.48.1, < 2.0)
129
130
  rubocop-ast (>= 1.31.1, < 2.0)
130
- rubocop-rails (2.25.1)
131
+ rubocop-rails (2.27.0)
131
132
  activesupport (>= 4.2.0)
132
133
  rack (>= 1.1)
133
- rubocop (>= 1.33.0, < 2.0)
134
+ rubocop (>= 1.52.0, < 2.0)
134
135
  rubocop-ast (>= 1.31.1, < 2.0)
135
- rubocop-rspec (3.0.3)
136
+ rubocop-rspec (3.2.0)
136
137
  rubocop (~> 1.61)
137
138
  rubocop-rspec_rails (2.30.0)
138
139
  rubocop (~> 1.61)
139
140
  rubocop-rspec (~> 3, >= 3.0.1)
140
141
  ruby-progressbar (1.13.0)
141
142
  rubyzip (2.3.2)
143
+ securerandom (0.3.1)
142
144
  shellany (0.0.1)
143
145
  simplecov (0.22.0)
144
146
  docile (~> 1.1)
145
147
  simplecov-html (~> 0.11)
146
148
  simplecov_json_formatter (~> 0.1)
147
- simplecov-html (0.12.3)
149
+ simplecov-html (0.13.1)
148
150
  simplecov_json_formatter (0.1.4)
149
- strscan (3.1.0)
150
- thor (1.3.1)
151
+ thor (1.3.2)
151
152
  tzinfo (2.0.6)
152
153
  concurrent-ruby (~> 1.0)
153
- unicode-display_width (2.5.0)
154
+ unicode-display_width (2.6.0)
155
+ uri (1.0.1)
154
156
 
155
157
  PLATFORMS
156
158
  ruby
@@ -176,4 +178,4 @@ DEPENDENCIES
176
178
  simplecov
177
179
 
178
180
  BUNDLED WITH
179
- 2.5.15
181
+ 2.5.23
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'proformaxml/helpers/export_helpers'
3
+ require 'active_support/core_ext/array/wrap'
4
4
 
5
5
  module ProformaXML
6
6
  class TransformTask < ServiceBase
@@ -23,26 +23,60 @@ module ProformaXML
23
23
  private
24
24
 
25
25
  def transform_from_2_0_to_2_1
26
- if @task.submission_restrictions.present?
27
- @task.submission_restrictions['submission-restrictions']['file-restriction'].each do |fr|
28
- fr['@use'] = fr.delete('@required') == 'true' ? 'required' : 'optional'
29
- end
30
- end
26
+ transform_submission_restrictions_from_2_0_to_2_1 unless @task.submission_restrictions.nil?
27
+ transform_external_resources_from_2_0_to_2_1 unless @task.external_resources.nil?
31
28
 
32
29
  @task.model_solutions.filter! {|model_solution| model_solution.id != 'ms-placeholder' }
33
30
  end
34
31
 
35
- def transform_from_2_1_to_2_0
36
- unless @task.submission_restrictions.nil?
37
- @task.submission_restrictions['submission-restrictions']['file-restriction'].each do |fr|
38
- fr['@required'] = (fr.delete('@use') == 'required').to_s
39
- end
40
- @task.submission_restrictions['submission-restrictions'].delete('description')
41
- @task.submission_restrictions['submission-restrictions'].delete('internal-description')
32
+ def transform_external_resources_from_2_0_to_2_1
33
+ ensure_array(@task.external_resources['external-resources']['external-resource']).each do |external_resource|
34
+ external_resource['@used-by-grader'] = external_resource['@used-by-grader'] || 'false'
35
+ external_resource['@visible'] = external_resource['@visible'] || 'no'
36
+ end
37
+ end
38
+
39
+ def transform_submission_restrictions_from_2_0_to_2_1
40
+ ensure_array(@task.submission_restrictions['submission-restrictions']['file-restriction']).each do |fr|
41
+ fr['@use'] = if fr['@required'].nil? || fr.delete('@required') == 'true'
42
+ 'required'
43
+ else
44
+ 'optional'
45
+ end
42
46
  end
47
+ end
48
+
49
+ def transform_from_2_1_to_2_0
50
+ transform_submission_restrictions_from_2_1_to_2_0 unless @task.submission_restrictions.nil?
51
+ transform_external_resources_from_2_1_to_2_0 unless @task.external_resources.nil?
43
52
  add_model_solution_placeholder
44
53
  end
45
54
 
55
+ def transform_external_resources_from_2_1_to_2_0
56
+ ensure_array(@task.external_resources['external-resources']['external-resource']).each do |external_resource|
57
+ external_resource.delete('@visible')
58
+ external_resource.delete('@usage-by-lms')
59
+ external_resource.delete('@used-by-grader')
60
+ end
61
+ end
62
+
63
+ def transform_submission_restrictions_from_2_1_to_2_0
64
+ transform_file_restrictions_from_2_1_to_2_0
65
+ @task.submission_restrictions['submission-restrictions'].delete('description')
66
+ @task.submission_restrictions['submission-restrictions'].delete('internal-description')
67
+ end
68
+
69
+ def transform_file_restrictions_from_2_1_to_2_0
70
+ ensure_array(@task.submission_restrictions['submission-restrictions']['file-restriction']).each do |file_restriction|
71
+ file_restriction['@required'] = (file_restriction['@use'].nil? || file_restriction.delete('@use') == 'required').to_s
72
+ end
73
+ end
74
+
75
+ # when only one field is present, dachsfisch does not create an array. This method ensure, that we can work with an array
76
+ def ensure_array(data)
77
+ Array.wrap(data)
78
+ end
79
+
46
80
  def add_model_solution_placeholder
47
81
  return if @task.model_solutions&.any?
48
82
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ProformaXML
4
- VERSION = '1.5.0'
4
+ VERSION = '1.5.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proformaxml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karol
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-22 00:00:00.000000000 Z
11
+ date: 2024-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 5.2.3
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 8.0.0
22
+ version: 9.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 5.2.3
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 8.0.0
32
+ version: 9.0.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: activesupport
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: 5.2.3
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: 8.0.0
42
+ version: 9.0.0
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: 5.2.3
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: 8.0.0
52
+ version: 9.0.0
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: dachsfisch
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -150,7 +150,6 @@ files:
150
150
  - lib/proformaxml/services/validator.rb
151
151
  - lib/proformaxml/services/version_and_namespace_extractor.rb
152
152
  - lib/proformaxml/version.rb
153
- - proformaxml.gemspec
154
153
  homepage: https://github.com/openHPI/proformaxml
155
154
  licenses:
156
155
  - MIT
@@ -171,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
170
  - !ruby/object:Gem::Version
172
171
  version: '0'
173
172
  requirements: []
174
- rubygems_version: 3.5.15
173
+ rubygems_version: 3.5.23
175
174
  signing_key:
176
175
  specification_version: 4
177
176
  summary: Implements parts of ProFormA-XML specification
data/proformaxml.gemspec DELETED
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'lib/proformaxml/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'proformaxml'
7
- spec.version = ProformaXML::VERSION
8
- spec.authors = ['Karol']
9
- spec.email = ['git@koehn.pro']
10
-
11
- spec.summary = 'Implements parts of ProFormA-XML specification'
12
- spec.description = 'Offers datastructure and (de)serializer according to ProFormA-XML specification.'
13
- spec.homepage = 'https://github.com/openHPI/proformaxml'
14
- spec.license = 'MIT'
15
-
16
- spec.required_ruby_version = '>= 3.3'
17
-
18
- # Specify which files should be added to the gem when it is released.
19
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
- spec.files = Dir.chdir(__dir__) do
21
- `git ls-files -z`.split("\x0").reject do |f|
22
- (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|circleci)|appveyor)})
23
- end
24
- end
25
-
26
- spec.bindir = 'exe'
27
- spec.executables = spec.files.grep(%r{\Aexe/}) {|f| File.basename(f) }
28
- spec.require_paths = ['lib']
29
-
30
- spec.add_dependency 'activemodel', '>= 5.2.3', '< 8.0.0'
31
- spec.add_dependency 'activesupport', '>= 5.2.3', '< 8.0.0'
32
- spec.add_dependency 'dachsfisch', '~> 1.0.0'
33
- spec.add_dependency 'nokogiri', '>= 1.10.2', '< 2.0.0'
34
- spec.add_dependency 'rubyzip', '>= 1.2.2', '< 3.0.0'
35
-
36
- spec.metadata['rubygems_mfa_required'] = 'true'
37
- end