citero 1.0.0.alpha2 → 1.0.0.alpha3
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/lib/citero/outputs/openurl.rb +6 -5
- data/lib/citero/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e54a3640492296be572723e10beace6fb58c5a5
|
4
|
+
data.tar.gz: c75278bd837dc993e10fd3e520484b05a57e956e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 256b138ced12783a53893969c08b8993d1cb7d39f1d2ba277f9e64e2747f5dd87b66e6cf673183cd115bf2ac21b67f3a354e84f7e48d5b48436497ebf0b3bbde
|
7
|
+
data.tar.gz: 29faa241c33c6afbe2a0b2d49d990214592b5ce2f29a01ca2a0e1b53a49b9c9997b999380b1e945634c3182046a8a54ebefed0a7eaa22a6e5465d79f21be5b34
|
@@ -20,16 +20,17 @@ module Citero
|
|
20
20
|
|
21
21
|
def openurl_param(key,value, with_prefix = true, encoded = true)
|
22
22
|
output = ""
|
23
|
-
return output if value.nil?
|
23
|
+
return output if value.nil? || key.nil?
|
24
24
|
key = "rft.#{key}" if with_prefix
|
25
|
+
key = "#{key}=" unless key.include?('=')
|
25
26
|
if value.is_a?(Array)
|
26
27
|
value.each do |val|
|
27
28
|
val = CGI::escape(val) if encoded
|
28
|
-
output += "#{key}
|
29
|
+
output += "#{key}#{val}&"
|
29
30
|
end
|
30
31
|
else
|
31
32
|
value = CGI::escape(value) if encoded
|
32
|
-
output += "#{key}
|
33
|
+
output += "#{key}#{value}&"
|
33
34
|
end
|
34
35
|
output
|
35
36
|
end
|
@@ -46,11 +47,11 @@ module Citero
|
|
46
47
|
end
|
47
48
|
|
48
49
|
def output_doi
|
49
|
-
openurl_param('rft_id=info:doi/', @csf['doi'])
|
50
|
+
openurl_param('rft_id=info:doi/', @csf['doi'], false)
|
50
51
|
end
|
51
52
|
|
52
53
|
def output_isbn
|
53
|
-
openurl_param('rft_id=info:isbn
|
54
|
+
openurl_param('rft_id=info:isbn:', @csf['isbn'], false) + openurl_param('isbn', @csf['isbn'])
|
54
55
|
end
|
55
56
|
|
56
57
|
def output_type
|
data/lib/citero/version.rb
CHANGED