ruby-changes:18739
From: tenderlove <ko1@a...>
Date: Thu, 3 Feb 2011 07:22:40 +0900 (JST)
Subject: [ruby-changes:18739] Ruby:r30766 (trunk): * ext/psych/lib/psych/visitors/to_ruby.rb: use Regexp::NOENCODING
tenderlove 2011-02-03 07:22:26 +0900 (Thu, 03 Feb 2011) New Revision: 30766 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30766 Log: * ext/psych/lib/psych/visitors/to_ruby.rb: use Regexp::NOENCODING rather than magic number. * ext/syck/lib/syck/rubytypes.rb: ditto Modified files: trunk/ChangeLog trunk/ext/psych/lib/psych/visitors/to_ruby.rb trunk/ext/syck/lib/syck/rubytypes.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 30765) +++ ChangeLog (revision 30766) @@ -1,3 +1,10 @@ +Thu Feb 3 07:20:46 2011 Aaron Patterson <aaron@t...> + + * ext/psych/lib/psych/visitors/to_ruby.rb: use Regexp::NOENCODING + rather than magic number. + + * ext/syck/lib/syck/rubytypes.rb: ditto + Thu Feb 3 07:16:11 2011 Aaron Patterson <aaron@t...> * re.c (Init_Regexp): added a constant for ARG_ENCODING_NONE Index: ext/psych/lib/psych/visitors/to_ruby.rb =================================================================== --- ext/psych/lib/psych/visitors/to_ruby.rb (revision 30765) +++ ext/psych/lib/psych/visitors/to_ruby.rb (revision 30766) @@ -69,9 +69,7 @@ when 'x' then options |= Regexp::EXTENDED when 'i' then options |= Regexp::IGNORECASE when 'm' then options |= Regexp::MULTILINE - - # FIXME: there is no constant for ARG_ENCODING_NONE - when 'n' then options |= 32 + when 'n' then options |= Regexp::NOENCODING else lang = option end end Index: ext/syck/lib/syck/rubytypes.rb =================================================================== --- ext/syck/lib/syck/rubytypes.rb (revision 30765) +++ ext/syck/lib/syck/rubytypes.rb (revision 30766) @@ -271,7 +271,7 @@ mods |= Regexp::EXTENDED if val['mods'].include?( 'x' ) mods |= Regexp::IGNORECASE if val['mods'].include?( 'i' ) mods |= Regexp::MULTILINE if val['mods'].include?( 'm' ) - mods |= 32 if val['mods'].include?( 'n' ) + mods |= Regexp::NOENCODING if val['mods'].include?( 'n' ) end val.delete( 'mods' ) r = YAML::object_maker( klass, {} ) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/