Sha256: a0eb274d26f99226aedbcceec391110885fc6bc790248bff1174aff5d9175a84

Contents?: true

Size: 876 Bytes

Versions: 58

Compression:

Stored size: 876 Bytes

Contents

# Taken from ohm

unless "".respond_to?(:lines)
  # @private 1.8.6 compatibility only
  class String
    # @private
    # This version of String#lines is almost fully compatible with that
    # of Ruby 1.9. If a zero-length record separator is supplied in Ruby
    # 1.9, the string is split into paragraphs delimited by multiple
    # successive newlines. This replacement ignores that feature in
    # favor of code simplicity.
    def lines(separator = $/)
      result = split(separator).map { |part| "#{part}#{separator}" }
      result.each { |r| yield r } if block_given?
      result
    end
  end
end

unless respond_to?(:tap)
  # @private 1.8.6 compatibility only
  class Object
    # @private no need to explain. Standard ruby 1.9 stuff.
    # @see http://ruby-doc.org/ruby-1.9/classes/Object.html#M000239
    def tap
      yield(self)
      self
    end
  end
end

Version data entries

58 entries across 58 versions & 3 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.7.4 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.7.3 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.7.2 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.7.1 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.7.0 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.6.9 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.6.8 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.6.7 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.6.6 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.6.5 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.6.4 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.6.3 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.6.2 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.6.1 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.6.0 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.5.17 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.5.16 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.5.15 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb
classiccms-0.5.14 vendor/bundle/gems/sinatra-support-1.2.2/lib/sinatra/support/compat-1.8.6.rb