Sha256: 42d9565e835dd208b7ff4bec074f4fade13b09b17d9f1d8425073c516698b3c0

Contents?: true

Size: 748 Bytes

Versions: 7

Compression:

Stored size: 748 Bytes

Contents

# -*- coding: utf-8 -*-
#
#--
# Copyright (C) 2009-2013 Thomas Leitner <t_leitner@gmx.at>
#
# This file is part of kramdown which is licensed under the MIT.
#++
#
# All the code in this file is backported from Ruby 1.8.7 sothat kramdown works under 1.8.5
#
# :stopdoc:

if RUBY_VERSION <= '1.8.6'
  require 'rexml/parsers/baseparser'
  module REXML
    module Parsers
      class BaseParser
        UNAME_STR= "(?:#{NCNAME_STR}:)?#{NCNAME_STR}" unless const_defined?(:UNAME_STR)
      end
    end
  end

  if !String.instance_methods.include?("start_with?")

    class String
      def start_with?(str)
        self[0, str.length] == str
      end
      def end_with?(str)
        self[-str.length, str.length] == str
      end
    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
kramdown-1.3.1 lib/kramdown/compatibility.rb
kramdown-1.3.0 lib/kramdown/compatibility.rb
kramdown-1.2.0 lib/kramdown/compatibility.rb
kramdown-1.1.0 lib/kramdown/compatibility.rb
kramdown-1.0.2 lib/kramdown/compatibility.rb
kramdown-1.0.1 lib/kramdown/compatibility.rb
kramdown-1.0.0 lib/kramdown/compatibility.rb