exlibris-primo 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/exlibris/primo/link.rb +7 -0
- data/lib/exlibris/primo/version.rb +1 -1
- data/test/link_test.rb +10 -0
- metadata +4 -4
data/lib/exlibris/primo/link.rb
CHANGED
@@ -12,6 +12,13 @@ module Exlibris
|
|
12
12
|
|
13
13
|
attr_accessor :institution, :record_id, :original_id,
|
14
14
|
:url, :display, :notes, :subfields
|
15
|
+
|
16
|
+
def initialize *args
|
17
|
+
# URLs may have XML escaped ampersands
|
18
|
+
# so we need to account for that.
|
19
|
+
args.last[:url].gsub!("&", "&") unless args.last.nil?
|
20
|
+
super(*args)
|
21
|
+
end
|
15
22
|
end
|
16
23
|
|
17
24
|
#
|
data/test/link_test.rb
CHANGED
@@ -43,4 +43,14 @@ class LinkTest < Test::Unit::TestCase
|
|
43
43
|
assert_equal "http://example.com", link.url
|
44
44
|
assert_equal "Related Link Instance", link.display
|
45
45
|
end
|
46
|
+
|
47
|
+
def test_escaped_ampersands
|
48
|
+
link = Exlibris::Primo::Fulltext.new :institution => @institution, :record_id => @record_id,
|
49
|
+
:original_id => @record_id, :url => "#{@url}?key1=value1&key2=value2&key3=value3", :display => "Fulltext Instance"
|
50
|
+
assert_equal "INSTITUTION", link.institution
|
51
|
+
assert_equal "aleph002895625", link.record_id
|
52
|
+
assert_equal "aleph002895625", link.original_id
|
53
|
+
assert_equal "http://example.com?key1=value1&key2=value2&key3=value3", link.url
|
54
|
+
assert_equal "Fulltext Instance", link.display
|
55
|
+
end
|
46
56
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exlibris-primo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.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: 2013-
|
12
|
+
date: 2013-11-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: require_all
|
@@ -425,7 +425,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
425
425
|
version: '0'
|
426
426
|
segments:
|
427
427
|
- 0
|
428
|
-
hash:
|
428
|
+
hash: -4257247638652406024
|
429
429
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
430
430
|
none: false
|
431
431
|
requirements:
|
@@ -434,7 +434,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
434
434
|
version: '0'
|
435
435
|
segments:
|
436
436
|
- 0
|
437
|
-
hash:
|
437
|
+
hash: -4257247638652406024
|
438
438
|
requirements: []
|
439
439
|
rubyforge_project:
|
440
440
|
rubygems_version: 1.8.25
|