lib/citeproc/abbreviate.rb in citeproc-1.0.0.pre12 vs lib/citeproc/abbreviate.rb in citeproc-1.0.0

- old
+ new

@@ -8,24 +8,25 @@ end def abbreviations=(abbreviations) @abbreviations = case abbreviations when ::String - MultiJson.decode(abbreviations, :symbolize_keys => true) + ::JSON.parse(abbreviations, :symbolize_names => true) when ::Hash - abbreviations.deep_copy + abbreviations.deep_copy.symbolize_keys else raise ArgumentError, "failed to set abbreviations from #{abbreviations.inspect}" end end # @overload abbreviate(namespace = :default, context, word) def abbreviate(*arguments) - raise ArgumentError, "wrong number of arguments (#{arguments.length} for 2..3)" unless (2..3).include?(arguments.length) + raise ArgumentError, "wrong number of arguments (#{arguments.length} for 2..3)" unless + (2..3).include?(arguments.length) + arguments.unshift(namespace || :default) if arguments.length < 3 @abbreviations.deep_fetch(*arguments) end - alias abbrev abbreviate end end