Kouhei Sutou
null+****@clear*****
Mon Nov 25 23:38:53 JST 2013
Kouhei Sutou 2013-11-25 23:38:53 +0900 (Mon, 25 Nov 2013) New Revision: dbfcc54020cdfb1a032a5275b7064d5cd0beb66e https://github.com/droonga/drntest/commit/dbfcc54020cdfb1a032a5275b7064d5cd0beb66e Message: Use regexp reference instead of "pattern[1..-2]" Because is does the same thing twice. Regexp marks ("/") are found by regexp but it isn't used. Modified files: lib/drntest/tester.rb Modified: lib/drntest/tester.rb (+2 -2) =================================================================== --- lib/drntest/tester.rb 2013-11-25 23:35:09 +0900 (43d8632) +++ lib/drntest/tester.rb 2013-11-25 23:38:53 +0900 (1289614) @@ -71,8 +71,8 @@ module Drntest parser.on("--test=PATTERN", "Run only tests which have a name matched to the given PATTERN") do |pattern| - if /\A\/.+\/\z/ =~ pattern - pattern = Regexp.new(pattern[1..-2]) + if /\A\/(.+)\/\z/ =~ pattern + pattern = Regexp.new($1) end tester.pattern = pattern end -------------- next part -------------- HTML����������������������������... Télécharger