Sha256: b7a501cfc719a53bf0ffa039ba0cb30d45d5c0fad120f4e380011e4ed3d35f3a

Contents?: true

Size: 262 Bytes

Versions: 6

Compression:

Stored size: 262 Bytes

Contents

module PivotalToPdf
  class SimpleTextFormatter
    attr_reader :string
    private :string
    def initialize(string)
      @string = string.to_s
    end

    def output
      string.gsub( /\*(.*)\*/,"<b>\\1</b>").gsub(/_(.*)_/, "<i>\\1</i>")
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pivotal_to_pdf-1.3.1 lib/pivotal_to_pdf/simple_text_formatter.rb
pivotal_to_pdf-1.3.0 lib/pivotal_to_pdf/simple_text_formatter.rb
pivotal_to_pdf-1.2.0 lib/pivotal_to_pdf/simple_text_formatter.rb
pivotal_to_pdf-1.1.0 lib/pivotal_to_pdf/simple_text_formatter.rb
pivotal_to_pdf-1.0.0 lib/pivotal_to_pdf/simple_text_formatter.rb
pivotal_to_pdf-0.9.1 lib/pivotal_to_pdf/simple_text_formatter.rb