Sha256: 825d3fa529ba68e5c1388ffa82927220a7f341e9c449d3eb6296eff8b34c070d

Contents?: true

Size: 399 Bytes

Versions: 6

Compression:

Stored size: 399 Bytes

Contents

# -*- coding: utf-8 -*-

require 'erb'
require 'rspec/core/formatters/snippet_extractor'

module TurnipFormatter
  class Template
    module StepSource
      def self.build(location)
        @snippet_extractor ||= ::RSpec::Core::Formatters::SnippetExtractor.new
        '<pre class="source"><code class="ruby">' + @snippet_extractor.snippet([location]) + '</code></pre>'
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
turnip_formatter-0.1.2 lib/turnip_formatter/template/step_source.rb
turnip_formatter-0.1.1 lib/turnip_formatter/template/step_source.rb
turnip_formatter-0.1.0 lib/turnip_formatter/template/step_source.rb
turnip_formatter-0.0.6 lib/turnip_formatter/template/step_source.rb
turnip_formatter-0.0.5 lib/turnip_formatter/template/step_source.rb
turnip_formatter-0.0.4 lib/turnip_formatter/template/step_source.rb