Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Wrap strings to act like in 1.9
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
Gemfile
Gemfile.lock
Rakefile
Readme.md
VERSION
string19.gemspec

Readme.md

Stop thinking about differences between 1.9 and 1.8.

size / index / slice / slice! / chars / bytes / [] etc supported

Still some methods missing, fork & pull for what you need!

Install

sudo gem install string19

Usage

# on 1.8 AND 1.9
String19("Á§ÐÁ§Ð").size == 6

# to add a new wrapped method (result is a String19)
class String
  def foo
    'fäää'
  end
end

String19::Wrapped.wrap(:foo) if String19::IS_18
String19('').foo.size == 4

# to add a new delegated method (result is not modified)
class String
  def foo
    42
  end
end

String19::Wrapped.delegate(:foo) if String19::IS_18

String19('').foo == 42

Author

Michael Grosser
grosser.michael@gmail.com
Hereby placed under public domain, do what you want, just do not hold me accountable...

Something went wrong with that request. Please try again.