ex_cite 1.0.0 → 1.0.1

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.
@@ -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
- 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')
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
@@ -1,3 +1,3 @@
1
1
  module ExCite
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end