aboutsummaryrefslogtreecommitdiffstats
path: root/lib/yaml
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-26 03:22:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-26 03:22:09 +0000
commit8eee0060f563ebf3d35d91d560944d4dfe648eb0 (patch)
tree4a9c2d5a05f3bd651f27cd0f2c46cb275e60e148 /lib/yaml
parente0b7af69b461773c66ebfef29e2303f13b111d13 (diff)
downloadruby-8eee0060f563ebf3d35d91d560944d4dfe648eb0.tar.gz
* lib/yaml/rubytypes.rb (String#is_binary_data?): TAB would be
usually considered to be included in text data. * lib/rdoc/parser.rb (RDoc::Parser.binary?): blksize may be nil and is irrelevant to whether a file is binary. copied from above since TAB and newlines would be usually considered to be included in text data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml')
-rw-r--r--lib/yaml/rubytypes.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb
index b2745b4542..e8c0c89f2c 100644
--- a/lib/yaml/rubytypes.rb
+++ b/lib/yaml/rubytypes.rb
@@ -143,7 +143,7 @@ class String
to_yaml_style or not to_yaml_properties.empty? or self =~ /\n.+/
end
def is_binary_data?
- ( self.count( "^ -~", "^\r\n" ).fdiv(self.size) > 0.3 || self.index( "\x00" ) ) unless empty?
+ self.count("^ -~\t\r\n").fdiv(self.size) > 0.3 || self.index("\x00") unless self.empty?
end
def String.yaml_new( klass, tag, val )
val = val.unpack("m")[0] if tag == "tag:yaml.org,2002:binary"