Sha256: 3ebf4efb72d30c8078378a165596c84b6d6e5b13e3f931768313319b87695aee

Contents?: true

Size: 409 Bytes

Versions: 3

Compression:

Stored size: 409 Bytes

Contents

# encoding: utf-8

if RUBY_VERSION < "1.9"
  require "strscan"
  
  class String
    alias_method :lines, :to_a
    
    def each_char
      scanner, char = StringScanner.new(self), /./mu
      loop { yield(scanner.scan(char) || break) }
    end
  end 
  
  def ruby_18
    yield
  end
  
  def ruby_19
    false
  end
     
else  
 
  def ruby_18 
    false  
  end
  
  def ruby_19
    yield
  end 
  
end 

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
prawn-0.1.0 lib/prawn/compatibility.rb
prawn-0.1.2 lib/prawn/compatibility.rb
prawn-0.1.1 lib/prawn/compatibility.rb