mods_display 1.6.2 → 1.7.0
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/app/components/mods_display/field_component.rb +1 -1
- data/app/components/mods_display/record_component.rb +1 -1
- data/app/components/mods_display/row_field_component.rb +1 -1
- 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/fields/title.rb +5 -2
- data/lib/mods_display/version.rb +1 -1
- data/mods_display.gemspec +1 -1
- metadata +5 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e868af7e44bc4f527becc8d13606b0ff234bfcccd53b0691894b162b8fcd7f65
|
4
|
+
data.tar.gz: 7e2cebdcc63f8a0acf1a41a8b71a2df62a98fc194c493d82cb939d72818f1353
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5805de4d23405f4d0b3d128f566580409b295cfe18ca3ef868068266414d18f93c92f89a3d46effc00292ba7903bc12ea32ff1c2ccf2a4f5eb797a0c3d4b29b
|
7
|
+
data.tar.gz: 35c6e5b038d55932a99a800f34a69089a2937e575a6dcd375629c98fea3ecd7475f232436d27a35286b21b0eb78b487aa8e294d333e47139d278c5f07ea4d9a3
|
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)
|
@@ -63,7 +63,7 @@ module ModsDisplay
|
|
63
63
|
' : '
|
64
64
|
elsif child.name == 'partName' && previous_element.name == 'partNumber'
|
65
65
|
', '
|
66
|
-
elsif
|
66
|
+
elsif %w[partNumber partName].include?(child.name)
|
67
67
|
'. '
|
68
68
|
else
|
69
69
|
' '
|
@@ -80,7 +80,10 @@ module ModsDisplay
|
|
80
80
|
names = element.xpath("//m:name[@nameTitleGroup=\"#{element['nameTitleGroup']}\"]", **Mods::Record::NS_HASH)
|
81
81
|
names = element.xpath("//name[@nameTitleGroup=\"#{element['nameTitleGroup']}\"]") if names.empty?
|
82
82
|
|
83
|
-
ModsDisplay::Name.new(names).fields.first
|
83
|
+
field = ModsDisplay::Name.new(names).fields.first
|
84
|
+
return unless field
|
85
|
+
|
86
|
+
field.values.first.to_s
|
84
87
|
end
|
85
88
|
|
86
89
|
def title_parts
|
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,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mods_display
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jessie Keck
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: stanford-mods
|
@@ -148,14 +147,14 @@ dependencies:
|
|
148
147
|
requirements:
|
149
148
|
- - "~>"
|
150
149
|
- !ruby/object:Gem::Version
|
151
|
-
version: '
|
150
|
+
version: '7.0'
|
152
151
|
type: :development
|
153
152
|
prerelease: false
|
154
153
|
version_requirements: !ruby/object:Gem::Requirement
|
155
154
|
requirements:
|
156
155
|
- - "~>"
|
157
156
|
- !ruby/object:Gem::Version
|
158
|
-
version: '
|
157
|
+
version: '7.0'
|
159
158
|
- !ruby/object:Gem::Dependency
|
160
159
|
name: combustion
|
161
160
|
requirement: !ruby/object:Gem::Requirement
|
@@ -247,7 +246,6 @@ files:
|
|
247
246
|
homepage: https://github.com/sul-dlss/mods_display
|
248
247
|
licenses: []
|
249
248
|
metadata: {}
|
250
|
-
post_install_message:
|
251
249
|
rdoc_options: []
|
252
250
|
require_paths:
|
253
251
|
- lib
|
@@ -262,8 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
262
260
|
- !ruby/object:Gem::Version
|
263
261
|
version: '0'
|
264
262
|
requirements: []
|
265
|
-
rubygems_version: 3.
|
266
|
-
signing_key:
|
263
|
+
rubygems_version: 3.6.9
|
267
264
|
specification_version: 4
|
268
265
|
summary: The MODS Display gem allows implementers to configure a customized display
|
269
266
|
of MODS metadata. This display implements the specifications defined at Stanford
|