mods_display 1.6.2 → 1.6.3
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 +4 -4
- data/.rubocop.yml +11 -7
- data/.rubocop_todo.yml +26 -26
- data/Gemfile +2 -0
- data/lib/mods_display/fields/abstract.rb +1 -1
- data/lib/mods_display/fields/audience.rb +1 -1
- data/lib/mods_display/fields/cartographics.rb +1 -1
- data/lib/mods_display/fields/contents.rb +1 -1
- data/lib/mods_display/fields/date_other.rb +2 -1
- data/lib/mods_display/fields/genre.rb +1 -1
- data/lib/mods_display/fields/name.rb +1 -1
- data/lib/mods_display/fields/reference_title.rb +1 -1
- data/lib/mods_display/fields/resource_type.rb +1 -1
- data/lib/mods_display/fields/subject.rb +6 -8
- data/lib/mods_display/version.rb +1 -1
- data/mods_display.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb30184d2c6b81caa114445a1dbb6f06ef18c413c35c2b6737d02cf383c5aa76
|
4
|
+
data.tar.gz: 9c3414483586142a98cd9a350e7a4300959c4cd7c9a2f00e42e43f93362c335a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c259bff4aae3d28754646b78b24fa2e3a2fd94039fb9184767a9a644fec3e013a6400129263424887e77752244465ee0502f65c7a960e74fb0b4223d0df8d224
|
7
|
+
data.tar.gz: 9661658df503d9dbe555de30a3a72d081add769a0c11ca6e7908ff2df47f30e8911bc8ffeb75abb41a58f7d8f2c3c10ead31b2de7335dd989a453aa1f151c17e
|
data/.rubocop.yml
CHANGED
@@ -1,16 +1,20 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
2
|
|
3
|
-
require:
|
3
|
+
require:
|
4
|
+
- rubocop-rspec
|
5
|
+
- rubocop-rspec_rails
|
6
|
+
- rubocop-capybara
|
4
7
|
|
5
8
|
AllCops:
|
6
9
|
Exclude:
|
7
|
-
-
|
8
|
-
-
|
9
|
-
-
|
10
|
-
-
|
11
|
-
-
|
10
|
+
- "*.gemspec"
|
11
|
+
- "bin/**/*"
|
12
|
+
- "db/**/*"
|
13
|
+
- "spec/fixtures/**/*"
|
14
|
+
- "vendor/**/*"
|
12
15
|
TargetRubyVersion: 2.7
|
13
16
|
NewCops: enable
|
17
|
+
SuggestExtensions: false
|
14
18
|
|
15
19
|
# Use single-quoted strings where possible
|
16
20
|
Style/StringLiterals:
|
@@ -35,4 +39,4 @@ Naming/MethodName:
|
|
35
39
|
Enabled: false
|
36
40
|
|
37
41
|
Naming/VariableName:
|
38
|
-
Enabled: false
|
42
|
+
Enabled: false
|
data/.rubocop_todo.yml
CHANGED
@@ -9,18 +9,18 @@
|
|
9
9
|
# Offense count: 2
|
10
10
|
Capybara/SpecificMatcher:
|
11
11
|
Exclude:
|
12
|
-
-
|
12
|
+
- "spec/helpers/record_helper_spec.rb"
|
13
13
|
|
14
14
|
# Offense count: 2
|
15
15
|
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
|
16
16
|
Lint/DuplicateBranch:
|
17
17
|
Exclude:
|
18
|
-
-
|
18
|
+
- "lib/mods_display/fields/title.rb"
|
19
19
|
|
20
20
|
# Offense count: 1
|
21
21
|
Lint/ShadowingOuterLocalVariable:
|
22
22
|
Exclude:
|
23
|
-
-
|
23
|
+
- "spec/helpers/record_helper_spec.rb"
|
24
24
|
|
25
25
|
# Offense count: 15
|
26
26
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
@@ -36,7 +36,7 @@ Metrics/ClassLength:
|
|
36
36
|
# Configuration parameters: LengthThreshold.
|
37
37
|
Metrics/CollectionLiteralLength:
|
38
38
|
Exclude:
|
39
|
-
-
|
39
|
+
- "lib/mods_display/relator_codes.rb"
|
40
40
|
|
41
41
|
# Offense count: 9
|
42
42
|
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
@@ -62,31 +62,31 @@ RSpec/BeforeAfterAll:
|
|
62
62
|
# Prefixes: when, with, without
|
63
63
|
RSpec/ContextWording:
|
64
64
|
Exclude:
|
65
|
-
-
|
66
|
-
-
|
65
|
+
- "spec/fields/contents_spec.rb"
|
66
|
+
- "spec/fields/form_spec.rb"
|
67
67
|
|
68
68
|
# Offense count: 1
|
69
69
|
# Configuration parameters: IgnoredMetadata.
|
70
70
|
RSpec/DescribeClass:
|
71
71
|
Exclude:
|
72
|
-
-
|
73
|
-
-
|
74
|
-
-
|
75
|
-
-
|
76
|
-
-
|
77
|
-
-
|
72
|
+
- "**/spec/features/**/*"
|
73
|
+
- "**/spec/requests/**/*"
|
74
|
+
- "**/spec/routing/**/*"
|
75
|
+
- "**/spec/system/**/*"
|
76
|
+
- "**/spec/views/**/*"
|
77
|
+
- "spec/integration/html_spec.rb"
|
78
78
|
|
79
79
|
# Offense count: 1
|
80
80
|
# This cop supports safe autocorrection (--autocorrect).
|
81
81
|
RSpec/ExpectActual:
|
82
82
|
Exclude:
|
83
|
-
-
|
84
|
-
-
|
83
|
+
- "**/spec/routing/**/*"
|
84
|
+
- "spec/fields/name_spec.rb"
|
85
85
|
|
86
86
|
# Offense count: 39
|
87
87
|
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
|
88
88
|
# Include: **/*_spec*rb*, **/spec/**/*
|
89
|
-
RSpec/
|
89
|
+
RSpec/SpecFilePathSuffix:
|
90
90
|
Enabled: false
|
91
91
|
|
92
92
|
# Offense count: 96
|
@@ -97,8 +97,8 @@ RSpec/InstanceVariable:
|
|
97
97
|
# Offense count: 2
|
98
98
|
RSpec/IteratedExpectation:
|
99
99
|
Exclude:
|
100
|
-
-
|
101
|
-
-
|
100
|
+
- "spec/helpers/record_helper_spec.rb"
|
101
|
+
- "spec/integration/html_spec.rb"
|
102
102
|
|
103
103
|
# Offense count: 4
|
104
104
|
# Configuration parameters: .
|
@@ -119,9 +119,9 @@ RSpec/NestedGroups:
|
|
119
119
|
# Offense count: 1
|
120
120
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
121
121
|
# Configuration parameters: Inferences.
|
122
|
-
|
122
|
+
RSpecRails/InferredSpecType:
|
123
123
|
Exclude:
|
124
|
-
-
|
124
|
+
- "spec/helpers/record_helper_spec.rb"
|
125
125
|
|
126
126
|
# Offense count: 39
|
127
127
|
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
|
@@ -133,7 +133,7 @@ RSpec/SpecFilePathFormat:
|
|
133
133
|
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
134
134
|
RSpec/VerifiedDoubles:
|
135
135
|
Exclude:
|
136
|
-
-
|
136
|
+
- "spec/helpers/record_helper_spec.rb"
|
137
137
|
|
138
138
|
# Offense count: 50
|
139
139
|
# Configuration parameters: AllowedConstants.
|
@@ -143,20 +143,20 @@ Style/Documentation:
|
|
143
143
|
# Offense count: 4
|
144
144
|
Style/MixinUsage:
|
145
145
|
Exclude:
|
146
|
-
-
|
147
|
-
-
|
148
|
-
-
|
149
|
-
-
|
146
|
+
- "spec/fields/cartographics_spec.rb"
|
147
|
+
- "spec/fields/imprint_spec.rb"
|
148
|
+
- "spec/fields/name_spec.rb"
|
149
|
+
- "spec/fields/subject_spec.rb"
|
150
150
|
|
151
151
|
# Offense count: 1
|
152
152
|
Style/MultilineBlockChain:
|
153
153
|
Exclude:
|
154
|
-
-
|
154
|
+
- "lib/mods_display/fields/imprint.rb"
|
155
155
|
|
156
156
|
# Offense count: 13
|
157
157
|
Style/OpenStructUse:
|
158
158
|
Exclude:
|
159
|
-
-
|
159
|
+
- "spec/helpers/record_helper_spec.rb"
|
160
160
|
|
161
161
|
# Offense count: 46
|
162
162
|
# This cop supports safe autocorrection (--autocorrect).
|
data/Gemfile
CHANGED
@@ -10,7 +10,7 @@ module ModsDisplay
|
|
10
10
|
next unless subject_element.respond_to?(:cartographics)
|
11
11
|
|
12
12
|
subject_element.cartographics.each do |field|
|
13
|
-
scale = field.scale.empty? ?
|
13
|
+
scale = field.scale.empty? ? nil : element_text(field.scale)
|
14
14
|
projection = field.projection.empty? ? nil : element_text(field.projection)
|
15
15
|
coordinates = field.coordinates.empty? ? nil : element_text(field.coordinates)
|
16
16
|
post_scale = [projection, coordinates].compact.join(' ') if [projection, coordinates].compact.length.positive?
|
@@ -17,7 +17,8 @@ module ModsDisplay
|
|
17
17
|
|
18
18
|
def type_attribute_value(date)
|
19
19
|
if date.is_a?(Stanford::Mods::Imprint::DateRange)
|
20
|
-
|
20
|
+
# Note that a range can be only single ended.
|
21
|
+
date.start&.value&.type || date.stop&.value&.type
|
21
22
|
else
|
22
23
|
date.value.type
|
23
24
|
end
|
@@ -20,7 +20,7 @@ module ModsDisplay
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def to_html(view_context = ApplicationController.renderer)
|
23
|
-
component = ModsDisplay::FieldComponent.with_collection(fields, value_transformer:
|
23
|
+
component = ModsDisplay::FieldComponent.with_collection(fields, value_transformer: lambda(&:to_s))
|
24
24
|
|
25
25
|
view_context.render component, layout: false
|
26
26
|
end
|
@@ -52,15 +52,13 @@ module ModsDisplay
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def values_from_subjects(element)
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
end
|
55
|
+
selected_subjects(element).map do |child|
|
56
|
+
if element_text(child).include?('--')
|
57
|
+
element_text(child).split('--').map(&:strip)
|
58
|
+
else
|
59
|
+
element_text(child)
|
60
|
+
end
|
62
61
|
end
|
63
|
-
return_values
|
64
62
|
end
|
65
63
|
|
66
64
|
def selected_subjects(element = @value)
|
data/lib/mods_display/version.rb
CHANGED
data/mods_display.gemspec
CHANGED
@@ -31,6 +31,6 @@ Gem::Specification.new do |gem|
|
|
31
31
|
gem.add_development_dependency 'rspec-rails'
|
32
32
|
gem.add_development_dependency 'rubocop'
|
33
33
|
gem.add_development_dependency 'capybara'
|
34
|
-
gem.add_development_dependency 'rails', ENV['RAILS_VERSION'] || '~>
|
34
|
+
gem.add_development_dependency 'rails', ENV['RAILS_VERSION'] || '~> 7.0'
|
35
35
|
gem.add_development_dependency 'combustion', '~> 1.3'
|
36
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mods_display
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jessie Keck
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: stanford-mods
|
@@ -148,14 +148,14 @@ dependencies:
|
|
148
148
|
requirements:
|
149
149
|
- - "~>"
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version: '
|
151
|
+
version: '7.0'
|
152
152
|
type: :development
|
153
153
|
prerelease: false
|
154
154
|
version_requirements: !ruby/object:Gem::Requirement
|
155
155
|
requirements:
|
156
156
|
- - "~>"
|
157
157
|
- !ruby/object:Gem::Version
|
158
|
-
version: '
|
158
|
+
version: '7.0'
|
159
159
|
- !ruby/object:Gem::Dependency
|
160
160
|
name: combustion
|
161
161
|
requirement: !ruby/object:Gem::Requirement
|
@@ -262,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
262
262
|
- !ruby/object:Gem::Version
|
263
263
|
version: '0'
|
264
264
|
requirements: []
|
265
|
-
rubygems_version: 3.
|
265
|
+
rubygems_version: 3.5.15
|
266
266
|
signing_key:
|
267
267
|
specification_version: 4
|
268
268
|
summary: The MODS Display gem allows implementers to configure a customized display
|