Sha256: a2b94c0bde0c830bd7e19d87dc7919f4b68339a43f2aeb296e58ae3549fbb7ea

Contents?: true

Size: 428 Bytes

Versions: 26

Compression:

Stored size: 428 Bytes

Contents

unless ("abc".upto("def", true){} rescue false)
  require 'backports/tools'
  require 'enumerator'

  class String
    def upto_with_exclusive(to, excl=false)
      return upto_without_exclusive(to){|s| yield s} if block_given? && !excl
      r = Range.new(self, to, excl)
      return r.to_enum unless block_given?
      r.each{|s| yield s}
      self
    end
    Backports.alias_method_chain self, :upto, :exclusive
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
scout_realtime-1.0.5 lib/vendor/backports-3.3.5/lib/backports/1.8.7/string/upto.rb
scout_realtime-1.0.4 lib/vendor/backports-3.3.5/lib/backports/1.8.7/string/upto.rb
scout_realtime-1.0.3 lib/vendor/backports-3.3.5/lib/backports/1.8.7/string/upto.rb
scout_realtime-1.0.3.pre lib/vendor/backports-3.3.5/lib/backports/1.8.7/string/upto.rb
scout_realtime-1.0.2 lib/vendor/backports-3.3.5/lib/backports/1.8.7/string/upto.rb
scout_realtime-1.0.1 lib/vendor/backports-3.3.5/lib/backports/1.8.7/string/upto.rb
scout_realtime-1.0.0 lib/vendor/backports-3.3.5/lib/backports/1.8.7/string/upto.rb
scout_realtime-0.5.5 lib/vendor/backports-3.3.5/lib/backports/1.8.7/string/upto.rb
scout_realtime-0.5.5.pre lib/vendor/backports-3.3.5/lib/backports/1.8.7/string/upto.rb
scout_realtime-0.5.4 lib/vendor/backports-3.3.5/lib/backports/1.8.7/string/upto.rb
backports-3.6.0 lib/backports/1.8.7/string/upto.rb
backports-3.5.0 lib/backports/1.8.7/string/upto.rb
backports-3.4.1 lib/backports/1.8.7/string/upto.rb
scout_realtime-0.5.3 lib/vendor/backports-3.3.5/lib/backports/1.8.7/string/upto.rb
scout_realtime-0.5.2 lib/vendor/backports-3.3.5/lib/backports/1.8.7/string/upto.rb
scout_realtime-0.5.1 lib/vendor/backports-3.3.5/lib/backports/1.8.7/string/upto.rb
backports-3.4.0 lib/backports/1.8.7/string/upto.rb
backports-3.3.5 lib/backports/1.8.7/string/upto.rb
backports-3.3.4 lib/backports/1.8.7/string/upto.rb
backports-3.3.3 lib/backports/1.8.7/string/upto.rb