diff options
author | Robin Houston <robin.houston@gmail.com> | 2011-12-04 22:53:43 +0000 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2011-12-04 22:53:43 +0000 |
commit | 40f0d929727694eba21c934cb3732574cf84f6b6 (patch) | |
tree | f4995e43c897bda5a5d878dbdc6df3fb65eddf97 /lib/ruby19.rb | |
parent | fe6d2c7a1609d9088c136762d7d89f7dc01a21ea (diff) | |
parent | 00caf911d7b60cbd3dea0ec070321b5b6aa6a79d (diff) |
Merge branch 'develop' of github.com:sebbacon/alaveteli into develop
Diffstat (limited to 'lib/ruby19.rb')
-rw-r--r-- | lib/ruby19.rb | 8 |
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 |