ex_cite 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/ex_cite/export_citations_controller.rb +4 -4
- data/lib/ex_cite/version.rb +1 -1
- data/test/dummy/log/development.log +765 -0
- data/test/dummy/log/test.log +13456 -0
- data/test/dummy/tmp/cache/DE6/D00/5c66e1737c71a44c1c2c0c53aacfdbe21a47d22dto_csf +3 -0
- data/test/dummy/tmp/cache/DF8/F60/5c66e1737c71a44c1c2c0c53aacfdbe21a47d22dto_ris +4 -0
- data/test/dummy/tmp/cache/EC7/1D0/c40475adaf32bb892347f5266ebc36b75858888ato_easybib +1 -0
- data/test/dummy/tmp/cache/F28/D80/5c66e1737c71a44c1c2c0c53aacfdbe21a47d22dto_bibtex +2 -0
- data/test/dummy/tmp/cache/F89/890/5c66e1737c71a44c1c2c0c53aacfdbe21a47d22dto_easybib +1 -0
- data/test/dummy/tmp/cache/F9B/6B0/a20e01c7d752cb63afcbb4a90eb9cb3f999844a0to_easybib +1 -0
- data/test/dummy/tmp/cache/assets/C79/9D0/sprockets%2Fc2a0614840a581c50b353a995658e80d +0 -0
- data/test/dummy/tmp/cache/assets/D0B/BA0/sprockets%2Fd016bd5cefae1b4880de354541277663 +0 -0
- data/test/dummy/tmp/cache/assets/D0C/9F0/sprockets%2Fdf0f1db09e51aa085f171846b476465c +0 -0
- data/test/dummy/tmp/cache/assets/D0F/B70/sprockets%2F15259189162a4eda934bd73d60dd3ff2 +0 -0
- data/test/dummy/tmp/cache/assets/D79/B20/sprockets%2F9bd1c455c64db259bcc0f5ed557088f6 +0 -0
- data/test/functional/ex_cite/export_citations _controller_test.rb +25 -11
- metadata +26 -6
@@ -54,23 +54,23 @@ module ExCite
|
|
54
54
|
def format_citation
|
55
55
|
(params[:from_format].nil? || params[:data].nil?) ? [] :
|
56
56
|
params[:from_format].collect.with_index do |format, index|
|
57
|
-
# p ActsAsCitableClass.format_field
|
58
57
|
ExCite.acts_as_citable_class.new ExCite.acts_as_citable_class.data_field.to_sym => params[:data].to_a[index], ExCite.acts_as_citable_class.format_field.to_sym => (whitelist_formats :from, format)
|
59
58
|
end
|
60
59
|
end
|
61
60
|
|
62
61
|
# Returns a single citation object with data and format set as the url and openurl respectively
|
63
62
|
def open_url_citation
|
64
|
-
|
63
|
+
ExCite.acts_as_citable_class.new ExCite.acts_as_citable_class.data_field.to_sym => CGI::unescape(request.protocol+request.host_with_port+request.fullpath), ExCite.acts_as_citable_class.format_field.to_sym => (whitelist_formats :from, 'openurl')
|
65
64
|
end
|
66
65
|
|
67
66
|
# Maps the output and caches it, alternatively it fetches the already cached result. Seperates each output with two new lines.
|
68
67
|
# Raises an argument error if any error is caught in mapping (usually the formats are messed up)
|
69
68
|
def map
|
70
69
|
@output ||=
|
71
|
-
citations.collect { |citation| Rails.cache.fetch(citation.resource_key+to_format) { citation.send(to_format) } }.join "\n\n"
|
70
|
+
# citations.collect { |citation| Rails.cache.fetch(citation.resource_key+to_format) { citation.send(to_format) } }.join "\n\n"
|
71
|
+
citations.collect { |citation| citation.send(to_format) }.join "\n\n"
|
72
72
|
rescue Exception => exc
|
73
|
-
raise ArgumentError, "#{exc}\n Data or source format not provided and/or mismatched. [citations => #{citations}, to_format => #{@to_format}]"
|
73
|
+
raise ArgumentError, "#{exc}\n Data or source format not provided and/or mismatched. [citations => #{citations}, to_format => #{@to_format}] "
|
74
74
|
end
|
75
75
|
|
76
76
|
# Maps then decides wether its a push request or a download, catches all bad argument errors
|
data/lib/ex_cite/version.rb
CHANGED