diff options
author | elijah <elijah@riseup.net> | 2012-12-07 11:45:36 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2012-12-07 11:45:36 -0800 |
commit | caadadd3b7f2735d95bb02f935346f6044e05049 (patch) | |
tree | a8f1e0840c3aaab81e38006a65657bbe49fa5068 /lib/core_extensions.rb | |
parent | efc52e7266d72fa043b0f2cdcd59657810789171 (diff) |
ruby 1.9 compatibility
Diffstat (limited to 'lib/core_extensions.rb')
-rw-r--r-- | lib/core_extensions.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/core_extensions.rb b/lib/core_extensions.rb new file mode 100644 index 0000000..07af8e5 --- /dev/null +++ b/lib/core_extensions.rb @@ -0,0 +1,14 @@ +# +# make ruby 1.9 act more like ruby 1.8 +# +unless String.method_defined?(:to_a) + class String + def to_a; [self]; end + end +end + +unless String.method_defined?(:any?) + class String + def any?; self.chars.any?; end + end +end |