Project

string19

0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby string that behaves like 1.9 and runs on 1.8
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

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...