ruby-changes:28121
From: kazu <ko1@a...>
Date: Sun, 7 Apr 2013 14:11:36 +0900 (JST)
Subject: [ruby-changes:28121] kazu:r40173 (trunk): Regexp.escape(RUBY_PLATFORM)
kazu 2013-04-07 14:11:24 +0900 (Sun, 07 Apr 2013) New Revision: 40173 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40173 Log: Regexp.escape(RUBY_PLATFORM) * test/ruby/test_require.rb (TestRequire#test_require_nonascii_path): RUBY_PLATFORM should escape as Regexp, because RUBY_PLATFORM may contain '.'. Modified files: trunk/ChangeLog trunk/test/ruby/test_require.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 40172) +++ ChangeLog (revision 40173) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Apr 7 13:56:16 2013 Kazuhiro NISHIYAMA <zn@m...> + + * test/ruby/test_require.rb (TestRequire#test_require_nonascii_path): + RUBY_PLATFORM should escape as Regexp, + because RUBY_PLATFORM may contain '.'. + Sun Apr 7 10:44:01 2013 Tanaka Akira <akr@f...> * include/ruby/defines.h: Simplify the logic to include sys/select.h. Index: test/ruby/test_require.rb =================================================================== --- test/ruby/test_require.rb (revision 40172) +++ test/ruby/test_require.rb (revision 40173) @@ -74,7 +74,7 @@ class TestRequire < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_require.rb#L74 assert_in_out_err([], <<-INPUT, %w(:ok), [], bug8165) # coding: #{encoding} # leave paths for require encoding objects - enc_path = Regexp.new(RUBY_PLATFORM) + enc_path = Regexp.new(Regexp.escape(RUBY_PLATFORM)) $:.replace([IO::NULL] + $:.reject {|path| enc_path !~ path}) p :ok if require '#{require_path}' p :ng if require '#{require_path}' -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/