diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-16 02:16:43 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-16 02:16:43 +0000 |
| commit | 6c127c1ed870413eb3a16b46440fc243fbc3ccb3 (patch) | |
| tree | 67f852ccdc762e2d5ffcd595630b76afc361095d | |
| parent | 64fc5f4ef3dcc4442129ae7b97da296877ff60e1 (diff) | |
| download | ruby-6c127c1ed870413eb3a16b46440fc243fbc3ccb3.tar.gz ruby-6c127c1ed870413eb3a16b46440fc243fbc3ccb3.tar.xz ruby-6c127c1ed870413eb3a16b46440fc243fbc3ccb3.zip | |
* lib/yaml/rubytypes.rb (String#is_binary_data?): use Integer#fdiv.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | lib/yaml/rubytypes.rb | 2 | ||||
| -rw-r--r-- | version.h | 6 |
3 files changed, 8 insertions, 4 deletions
@@ -1,3 +1,7 @@ +Fri Nov 16 11:16:41 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * lib/yaml/rubytypes.rb (String#is_binary_data?): use Integer#fdiv. + Fri Nov 16 03:36:01 2007 why the lucky stiff <why@ruby-lang.org> * ext/syck/rubyext.c: Node#value defined twice. diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb index dc6bb3359..35b719196 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" ) / self.size > 0.3 || self.count( "\x00" ) > 0 ) unless empty? + ( self.count( "^ -~", "^\r\n" ).fdiv(self.size) > 0.3 || self.index( "\x00" ) ) unless empty? end def String.yaml_new( klass, tag, val ) val = val.unpack("m")[0] if tag == "tag:yaml.org,2002:binary" @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2007-11-15" +#define RUBY_RELEASE_DATE "2007-11-16" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20071115 +#define RUBY_RELEASE_CODE 20071116 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_MONTH 11 -#define RUBY_RELEASE_DAY 15 +#define RUBY_RELEASE_DAY 16 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; |
