Sha256: 952c14ed69c1e731da27104c098b874705f8a36b6eae8c8a0792fcb66f849e74

Contents?: true

Size: 414 Bytes

Versions: 164

Compression:

Stored size: 414 Bytes

Contents

# Provides code to work properly on 1.8 and 1.9

class String
  unless method_defined? :bytesize
    alias_method :bytesize, :size
  end

  unless method_defined? :byteslice
    if RUBY_VERSION < '1.9'
      alias_method :byteslice, :[]
    else
      def byteslice(*arg)
        enc = self.encoding
        self.dup.force_encoding(Encoding::ASCII_8BIT).slice(*arg).force_encoding(enc)
      end
    end
  end
end

Version data entries

164 entries across 161 versions & 18 rubygems

Version Path
logstash-output-scalyr-0.1.9 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-output-scalyr-0.1.8 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-output-scalyr-0.1.7 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-output-scalyr-0.1.6 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-output-newrelic-1.2.0 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-output-scalyr-0.1.5 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-output-scalyr-0.1.4 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-output-scalyr-0.1.3 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-output-scalyr-0.1.2 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-filter-device_detection-1.0.7-java vendor/bundle/jruby/1.9/gems/puma-2.16.0-java/lib/puma/compat.rb
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/puma-2.16.0-java/lib/puma/compat.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/puma-2.16.0-java/lib/puma/compat.rb