Sha256: 930b340e49539af550956d19c6f96b359566abc81859e9f0411599a31ed8a45e

Contents?: true

Size: 557 Bytes

Versions: 15

Compression:

Stored size: 557 Bytes

Contents

if defined?(Encoding) && Encoding.respond_to?("default_external")
  Encoding.default_external = "UTF-8"
end

unless String.method_defined?(:lines)
  # Ruby 1.8
  class String
    alias_method :lines, :to_a
  end
end

if String.method_defined?(:bytesize)
  # Ruby 1.9
  class String
    alias_method :charsize, :size
  end
else
  # Ruby 1.8
  class String
    alias_method :bytesize, :size

    def charsize
      split(//).size
    end
  end
end

unless String.method_defined?(:each)
  # Ruby 1.9
  class String
    alias_method :each, :each_line
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
review-1.7.2 lib/review/extentions/string.rb
review-1.7.1 lib/review/extentions/string.rb
review-peg-0.2.2 lib/review/extentions/string.rb
review-peg-0.2.1 lib/review/extentions/string.rb
review-peg-0.2.0 lib/review/extentions/string.rb
review-peg-0.1.3 lib/review/extentions/string.rb
review-peg-0.1.2 lib/review/extentions/string.rb
review-peg-0.1.1 lib/review/extentions/string.rb
review-peg-0.1.0 lib/review/extentions/string.rb
review-1.7.0 lib/review/extentions/string.rb
review-1.6.0 lib/review/extentions/string.rb
review-2.0.0.beta1 lib/review/extentions/string.rb
review-1.5.0 lib/review/extentions/string.rb
review-1.4.0 lib/review/extentions/string.rb
review-1.3.0 lib/review/extentions/string.rb