Sha256: 2d580544776500d0c4d7939971eb23c118d623d04879a26add628fcc17192fd5

Contents?: true

Size: 606 Bytes

Versions: 7

Compression:

Stored size: 606 Bytes

Contents

Given(/^the following style:$/) do |string|
  @style = CSL::Style.parse!(string)
end

Given(/^the "(.*?)" style$/) do |style|
  @style = CSL::Style.load(style)
end

When(/^I (cite|reference) the following items as "(.*?)":$/) do |mode, format, items|
  processor = CiteProc::Processor.new :style => @style, format: format, locale: @locale
  mode = if mode == 'cite' then :citation else :bibliography end

  processor.import items.hashes.map.with_index { |data, idx|
    data[:id] = "ID-#{idx}"
    data
  }

  @results = processor.items.keys.map { |id|
    processor.render mode, :id => id
  }.flatten
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
citeproc-ruby-1.1.8 features/step_definitions/engine.rb
citeproc-ruby-1.1.7 features/step_definitions/engine.rb
citeproc-ruby-1.1.6 features/step_definitions/engine.rb
citeproc-ruby-1.1.5 features/step_definitions/engine.rb
citeproc-ruby-1.1.4 features/step_definitions/engine.rb
citeproc-ruby-1.1.3 features/step_definitions/engine.rb
citeproc-ruby-1.1.2 features/step_definitions/engine.rb