aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/core_ext/string.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/leap_cli/core_ext/string.rb')
-rw-r--r--lib/leap_cli/core_ext/string.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/leap_cli/core_ext/string.rb b/lib/leap_cli/core_ext/string.rb
new file mode 100644
index 0000000..07af8e5
--- /dev/null
+++ b/lib/leap_cli/core_ext/string.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