Sha256: 2b1ab8296ba29bf58a568276c58d6e83aeb5fc6a201e14e54ba30d048a3fd727

Contents?: true

Size: 947 Bytes

Versions: 2

Compression:

Stored size: 947 Bytes

Contents

begin
  require 'simplecov'
rescue LoadError
  # ignore
end

begin
  case
  when RUBY_PLATFORM < 'java'
    require 'debug'
    Debugger.start
  when defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
    require 'rubinius/debugger'
  else
    require 'debugger'
  end
rescue LoadError
  # ignore
end

require 'nokogiri'
require 'citeproc'
require 'citeproc/ruby'
require 'csl/styles'

module MimicksCiteProcJS
  def processor
    @processor ||= CiteProc::Processor.new :style => @style,
      :format => default_format, :locale => default_locale_path
  end

  def default_format
    unless @format
      @format = CiteProc::Ruby::Format.load('citeprocjs')
      @format.config[:bib_indent] = nil
    end

    @format
  end

  def default_locale_path
    File.expand_path('../../../spec/fixtures/locales/locales-en-US.xml', __FILE__)
  end

  def default_locale
    @locale ||= CSL::Locale.load default_locale_path
  end
end

World(MimicksCiteProcJS)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
citeproc-1.0.1 features/support/env.rb
citeproc-1.0.0 features/support/env.rb