[前][次][番号順一覧][スレッド一覧]

ruby-changes:51677

From: k0kubun <ko1@a...>
Date: Mon, 9 Jul 2018 00:05:23 +0900 (JST)
Subject: [ruby-changes:51677] k0kubun:r63889 (trunk): benchmark/driver.rb: fix wrong multiline regexp

k0kubun	2018-07-09 00:05:18 +0900 (Mon, 09 Jul 2018)

  New Revision: 63889

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63889

  Log:
    benchmark/driver.rb: fix wrong multiline regexp

  Modified files:
    trunk/benchmark/driver.rb
Index: benchmark/driver.rb
===================================================================
--- benchmark/driver.rb	(revision 63888)
+++ benchmark/driver.rb	(revision 63889)
@@ -50,7 +50,7 @@ class BenchmarkDriver https://github.com/ruby/ruby/blob/trunk/benchmark/driver.rb#L50
   def build_yaml(file)
     magic_comment = '# prelude' # bm_so_nsieve_bits hangs without magic comment
     name = File.basename(file).sub(/\Abm_/, '').sub(/\.rb\z/, '')
-    script = File.read(file).sub(/^__END__\n(.+\n)*/m, '').sub(/\A(^#.+\n)+/m) do |comment|
+    script = File.read(file).sub(/^__END__\n(.+\n)*/m, '').sub(/\A(^#[^\n]+\n)+/m) do |comment|
       magic_comment = comment
       ''
     end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]