lib/relaton/db.rb in relaton-0.2.2 vs lib/relaton/db.rb in relaton-0.2.3
- old
+ new
@@ -3,11 +3,11 @@
module Relaton
class RelatonError < StandardError; end
class Db
- SUPPORTED_GEMS = %w[isobib ietfbib gbbib].freeze
+ SUPPORTED_GEMS = %w[isobib ietfbib gbbib iecbib].freeze
# @param global_cache [String] filename of global DB
# @param local_cache [String] filename of local DB
def initialize(global_cache, local_cache)
register_gems
@@ -29,12 +29,12 @@
end
end
end
# The class of reference requested is determined by the prefix of the code:
- # GB Standard for gbbib, IETF for ietfbib, ISO or IEC or IEV for isobib
- # @param code [String] the ISO standard Code to look up (e..g "ISO 9000")
+ # GB Standard for gbbib, IETF for ietfbib, ISO for isobib, IEC or IEV for iecbib,
+ # @param code [String] the ISO standard Code to look up (e.g. "ISO 9000")
# @param year [String] the year the standard was published (optional)
# @param opts [Hash] options; restricted to :all_parts if all-parts reference is required
# @return [String] Relaton XML serialisation of reference
def fetch(code, year = nil, opts = {})
stdclass = standard_class(code) or return nil
@@ -82,10 +82,10 @@
private
def standard_class(code)
@registry.processors.each do |name, processor|
- return name if /#{processor.prefix}/.match(code) ||
+ return name if /^#{processor.prefix}/.match(code) ||
processor.defaultprefix.match(code)
end
allowed = @registry.processors.reduce([]) do |m, (_k, v)|
m << v.prefix
end