aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ruby19.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-05 10:26:01 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-05 10:26:01 +0000
commit6a93d027e744bfc4ab2f8f7808ee99c770003481 (patch)
treeb8bfe4e93e2314c8c7c9b95e99a861d8fad6b05f /lib/ruby19.rb
parent48bbe41b36402a22b808ec860c1a84673b74527f (diff)
parentb06195a428b5cb6c3e95b07c631e2f18febf05f0 (diff)
Merge branch 'release/0.5' into wdtk
Conflicts: .gitignore
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