Sha256: b4b9f4a55a29990d51c31bb0156674d3a09532807ab8192ec37e4b4f55a7c37b

Contents?: true

Size: 679 Bytes

Versions: 1

Compression:

Stored size: 679 Bytes

Contents

module Quarry

  class Markup #:nodoc:

    # = Header
    #
    class Header

      attr :spec
      attr :text
      attr :lineno

      def initialize(spec, text, lineno)
        @parent = spec
        @text   = text.strip
        @lineno = lineno
      end

      alias_method :parent, :spec
      alias_method :description, :text

      # "run" comment.
      def run(runner, spec, context, output)
        output.report_header(self)
      end

      #
      def to_s
        text.to_s
      end

      # As would appear in stand-alone script.
      def to_script
        text.to_s.gsub(/^/m, '# ')
      end

    end #class Header

  end #class Markup

end #module Quarry

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quarry-0.5.2 lib/quarry/markup/header.rb