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

ruby-changes:37768

From: nobu <ko1@a...>
Date: Thu, 5 Mar 2015 11:39:12 +0900 (JST)
Subject: [ruby-changes:37768] nobu:r49849 (trunk): driver.rb: suffix

nobu	2015-03-05 11:38:54 +0900 (Thu, 05 Mar 2015)

  New Revision: 49849

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

  Log:
    driver.rb: suffix
    
    * benchmark/driver.rb: add suffix to default output file name.

  Modified files:
    trunk/benchmark/driver.rb
Index: benchmark/driver.rb
===================================================================
--- benchmark/driver.rb	(revision 49848)
+++ benchmark/driver.rb	(revision 49849)
@@ -290,10 +290,14 @@ if __FILE__ == $0 https://github.com/ruby/ruby/blob/trunk/benchmark/driver.rb#L290
     :execs => [],
     :dir => File.dirname(__FILE__),
     :repeat => 1,
-    :output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}",
+    :output => nil,
     :raw_output => nil,
     :format => :tsv,
   }
+  formats = {
+    :tsv => ".tsv",
+    :markdown => ".md",
+  }
 
   parser = OptionParser.new{|o|
     o.on('-e', '--executables [EXECS]',
@@ -323,7 +327,7 @@ if __FILE__ == $0 https://github.com/ruby/ruby/blob/trunk/benchmark/driver.rb#L327
     o.on('--rawdata-output [FILE]', 'output rawdata'){|r|
       opt[:rawdata_output] = r
     }
-    o.on('-f', '--format={tsv,markdown}', 'output format', [:tsv, :markdown]){|r|
+    o.on('-f', "--format=FORMAT", "output format (#{formats.keys.join(",")})", formats.keys){|r|
       opt[:format] = r
     }
     o.on('-v', '--verbose'){|v|
@@ -336,6 +340,7 @@ if __FILE__ == $0 https://github.com/ruby/ruby/blob/trunk/benchmark/driver.rb#L340
   }
 
   parser.parse!(ARGV)
+  opt[:output] ||= "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}#{formats[opt[:format]]}"
   BenchmarkDriver.benchmark(opt)
 end
 

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

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