From caadadd3b7f2735d95bb02f935346f6044e05049 Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 7 Dec 2012 11:45:36 -0800 Subject: ruby 1.9 compatibility --- lib/core_extensions.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lib/core_extensions.rb (limited to 'lib/core_extensions.rb') 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 -- cgit v1.2.3