aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ruby19.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-12-21 16:46:29 +0000
committerSeb Bacon <seb.bacon@gmail.com>2011-12-21 16:46:29 +0000
commit7ed887f0989425d9e412890800df05637b08c025 (patch)
tree6f1d3fb4d215f069995634907f2bb32e9220ac22 /lib/ruby19.rb
parent21f1855560daa7992b058403938655ad229e0f71 (diff)
parent37b2fb482d31f77865bb889c049450d72876df92 (diff)
Merge branch 'cache-foi-attachments-seb'
Diffstat (limited to 'lib/ruby19.rb')
-rw-r--r--lib/ruby19.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ruby19.rb b/lib/ruby19.rb
new file mode 100644
index 000000000..39f48d74e
--- /dev/null
+++ b/lib/ruby19.rb
@@ -0,0 +1,8 @@
+if RUBY_VERSION.to_f == 1.9
+ class String
+ # @see syck/lib/syck/rubytypes.rb
+ def is_binary_data?
+ self.count("\x00-\x7F", "^ -~\t\r\n").fdiv(self.size) > 0.3 || self.index("\x00") unless self.empty?
+ end
+ end
+end \ No newline at end of file