diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-11-24 10:35:49 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-11-24 10:35:49 +0000 |
commit | 8494003ebf71ef437dfccb9374366a51ecb5924c (patch) | |
tree | 88f105ebb3ebdd84b64b4b5cb5f00db5cacd9e2d /lib/ruby19.rb | |
parent | fbfebdbe1c5b13f86f92404c3397d6dcb75766ce (diff) | |
parent | b7075181100852ff2117d61b02881e84deaafa87 (diff) |
Merge remote-tracking branch 'jpmckinney/pre1.9' into develop
Conflicts:
spec/controllers/request_controller_spec.rb
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 |