umlaut 3.0.1 → 3.0.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.
- data/app/models/referent.rb +1 -1
- data/app/models/request.rb +1 -5
- data/lib/marc_helper.rb +12 -7
- data/lib/service_adaptors/worldcat_identities.rb +1 -2
- data/lib/umlaut/version.rb +1 -1
- metadata +4 -4
data/app/models/referent.rb
CHANGED
@@ -92,7 +92,7 @@ class Referent < ActiveRecord::Base
|
|
92
92
|
oclcnum_ids = co.referent.identifiers.find_all { |i| i =~ /^info:oclcnum/}
|
93
93
|
oclcnum_ids.each do |oclcnum_id|
|
94
94
|
# FIXME Does this regex need "ocn" as well?
|
95
|
-
if (oclcnum_id =~ /^info:oclcnum\/(ocm0*|ocn0*|\(OCoLC\)0*|ocl70*|0+)(.*)$/)
|
95
|
+
if (oclcnum_id =~ /^info:oclcnum\/(ocm0*|ocn0*|on0*|\(OCoLC\)0*|ocl70*|0+)(.*)$/)
|
96
96
|
# Delete the original, take out just the actual oclcnum, not
|
97
97
|
# those old prefixes. or preceding 0s.
|
98
98
|
co.referent.delete_identifier( oclcnum_id )
|
data/app/models/request.rb
CHANGED
@@ -293,11 +293,7 @@ class Request < ActiveRecord::Base
|
|
293
293
|
# lexis nexis, so we'll consider it article-level. Since it is!
|
294
294
|
return ( data['atitle'].blank? &&
|
295
295
|
data['volume'].blank? &&
|
296
|
-
data['issue'].blank? &&
|
297
|
-
# A date means we're not title-level only if
|
298
|
-
# we're not a book.
|
299
|
-
(data['date'].blank? ||
|
300
|
-
referent.format == "book") &&
|
296
|
+
data['issue'].blank? &&
|
301
297
|
# pmid or doi is considered article-level, because SFX can
|
302
298
|
# respond to those. Other identifiers may be useless.
|
303
299
|
(! referent.identifiers.find {|i| i =~ /^info\:(doi|pmid)/})
|
data/lib/marc_helper.rb
CHANGED
@@ -28,7 +28,8 @@ module MarcHelper
|
|
28
28
|
next if urls_seen.include?(url)
|
29
29
|
|
30
30
|
# Trying to avoid duplicates with SFX/link resolver.
|
31
|
-
|
31
|
+
skip = should_skip_856_link?(request, marc_xml, url)
|
32
|
+
next if skip
|
32
33
|
|
33
34
|
urls_seen.push(url)
|
34
35
|
|
@@ -120,13 +121,17 @@ module MarcHelper
|
|
120
121
|
# still include.
|
121
122
|
def should_skip_856_link?(request, marc_record, url)
|
122
123
|
is_journal = (marc_record.leader[7,1] == 's')
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
124
|
+
|
125
|
+
sfx_controlled = SfxUrl.sfx_controls_url?(url)
|
126
|
+
|
127
|
+
# Do NOT skip if it's a title-level citation with no
|
128
|
+
# existing full text entries.
|
129
|
+
not_title_level_empty = !( request.title_level_citation? &&
|
127
130
|
request.get_service_type("fulltext").length == 0
|
128
|
-
)
|
129
|
-
|
131
|
+
)
|
132
|
+
|
133
|
+
result = ( is_journal && sfx_controlled && not_title_level_empty )
|
134
|
+
return result
|
130
135
|
end
|
131
136
|
|
132
137
|
# Take a ruby Marc Field object representing an 856 field,
|
@@ -384,8 +384,7 @@ class WorldcatIdentities < Service
|
|
384
384
|
end
|
385
385
|
|
386
386
|
def clean_oclcnum(num)
|
387
|
-
|
388
|
-
if num =~ /(ocn0*|ocm0*|\(OCoLC\)|ocl70*|0+)(.*)$/
|
387
|
+
if num =~ /(ocn0*|ocm0*|on0*|\(OCoLC\)|ocl70*|0+)(.*)$/
|
389
388
|
num = $2
|
390
389
|
end
|
391
390
|
return num
|
data/lib/umlaut/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: umlaut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -575,7 +575,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
575
575
|
version: '0'
|
576
576
|
segments:
|
577
577
|
- 0
|
578
|
-
hash:
|
578
|
+
hash: 3369968520259252587
|
579
579
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
580
580
|
none: false
|
581
581
|
requirements:
|
@@ -584,7 +584,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
584
584
|
version: '0'
|
585
585
|
segments:
|
586
586
|
- 0
|
587
|
-
hash:
|
587
|
+
hash: 3369968520259252587
|
588
588
|
requirements: []
|
589
589
|
rubyforge_project:
|
590
590
|
rubygems_version: 1.8.24
|