Sha256: 6fe5e5d4a1d6a92be15c58cbfad9d37c2fbc9e183897617701e292ed2311fa39

Contents?: true

Size: 1.42 KB

Versions: 1

Compression:

Stored size: 1.42 KB

Contents

require 'date'
require 'forwardable'
require 'observer'
require 'open-uri'

require 'json'
require 'namae'

require 'citeproc/version'

#
# CiteProc processes bibliographic data and formats it according to a style
# defined in CSL (Citation Style Language).
#
module CiteProc

  module Converters
  end

  module Utilities
  end

end

require 'citeproc/compatibility'
require 'citeproc/extensions'

require 'citeproc/errors'

require 'citeproc/abbreviate'
require 'citeproc/attributes'

require 'citeproc/variable'
require 'citeproc/number'
require 'citeproc/date'
require 'citeproc/names'

CiteProc::Variable.class_eval do
  @factories = Hash.new { |h,k| h.fetch(k.to_s.intern, CiteProc::Variable) }.merge(
    Hash[*@types.map { |n,k|
      [n, CiteProc.const_get(k.to_s.capitalize)]
    }.flatten]
  ).freeze
end

require 'citeproc/item'
require 'citeproc/citation_data'
require 'citeproc/selector'
require 'citeproc/bibliography'
require 'citeproc/assets'

require 'citeproc/engine'
require 'citeproc/processor'
require 'citeproc/utilities'

CiteProc.extend CiteProc::Utilities


CiteProc::Converters.class_eval do

  # Define all converters (all classes have been loaded at this point)
  CiteProc.constants.each do |name|
    klass = CiteProc.const_get(name)

    if klass.instance_of?(Class) && klass.respond_to?(:create)

      define_method(name) do |obj|
        obj.instance_of?(klass) ? obj : klass.create(obj)
      end

    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
citeproc-1.0.0 lib/citeproc.rb