aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ruby19.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-11-24 12:46:48 +0000
committerSeb Bacon <seb.bacon@gmail.com>2011-11-24 12:46:48 +0000
commit76168e23fd78d276a197cc992bb6ef5a065f6f3f (patch)
treef15093086b2ff767968e6bbd1b816c66f35bd5dd /lib/ruby19.rb
parentfb2b20037bb176533de4e7fa86701248473f8ee3 (diff)
parent589d9b8c1e14bb7086a6b7baf0fa7e3b9aaeabf0 (diff)
Merge branch 'develop' into xapian-dcabo
Conflicts: spec/models/xapian_spec.rb
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