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.
@@ -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
  #
@@ -1,5 +1,5 @@
1
1
  module Exlibris
2
2
  module Primo
3
- VERSION = "1.1.1"
3
+ VERSION = "1.1.2"
4
4
  end
5
5
  end
@@ -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&amp;key2=value2&amp;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.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-09-27 00:00:00.000000000 Z
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: 927842014174414092
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: 927842014174414092
437
+ hash: -4257247638652406024
438
438
  requirements: []
439
439
  rubyforge_project:
440
440
  rubygems_version: 1.8.25