ruby-changes:55925
From: Benoit <ko1@a...>
Date: Fri, 31 May 2019 05:11:47 +0900 (JST)
Subject: [ruby-changes:55925] Benoit Daloze: e935a3227d (trunk): Update to ruby/mspec@3cc36d0
https://git.ruby-lang.org/ruby.git/commit/?id=e935a3227d From e935a3227d1553539f65d1475f2c161082ba7148 Mon Sep 17 00:00:00 2001 From: Benoit Daloze <eregontp@g...> Date: Thu, 30 May 2019 22:11:22 +0200 Subject: Update to ruby/mspec@3cc36d0 diff --git a/spec/mspec/Gemfile.lock b/spec/mspec/Gemfile.lock index e977989..ce0aa98 100644 --- a/spec/mspec/Gemfile.lock +++ b/spec/mspec/Gemfile.lock @@ -19,6 +19,3 @@ PLATFORMS https://github.com/ruby/ruby/blob/trunk/spec/mspec/Gemfile.lock#L19 DEPENDENCIES rake (~> 10.0) rspec (~> 2.14.1) - -BUNDLED WITH - 1.16.1 diff --git a/spec/mspec/tool/sync/sync-rubyspec.rb b/spec/mspec/tool/sync/sync-rubyspec.rb index 0a6203e..2da7f8e 100644 --- a/spec/mspec/tool/sync/sync-rubyspec.rb +++ b/spec/mspec/tool/sync/sync-rubyspec.rb @@ -190,7 +190,7 @@ def verify_commits(impl) https://github.com/ruby/ruby/blob/trunk/spec/mspec/tool/sync/sync-rubyspec.rb#L190 puts "Manually check commit messages:" print "Press enter >" STDIN.gets - sh "git", "log", "master..." + system "git", "log", "master..." end end diff --git a/spec/mspec/tool/tag_from_output.rb b/spec/mspec/tool/tag_from_output.rb old mode 100644 new mode 100755 index 62764c3..1802aa9 --- a/spec/mspec/tool/tag_from_output.rb +++ b/spec/mspec/tool/tag_from_output.rb @@ -1,3 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/mspec/tool/tag_from_output.rb#L1 +#!/usr/bin/env ruby + # Adds tags based on error and failures output (e.g., from a CI log), # without running any spec code. @@ -8,14 +10,12 @@ tags_dir = %w[ https://github.com/ruby/ruby/blob/trunk/spec/mspec/tool/tag_from_output.rb#L10 abort 'Could not find tags directory' unless tags_dir output = ARGF.readlines -# Remove leading "[exec] " from JRuby logs -output = output.map { |line| line.sub(/^\[exec\] /, '') } NUMBER = /^\d+\)$/ ERROR_OR_FAILED = / (ERROR|FAILED)$/ SPEC_FILE = /^(\/.+_spec\.rb)\:\d+/ -failures = output.slice_before(NUMBER).select { |number, error_line, *rest| +output.slice_before(NUMBER).select { |number, error_line, *rest| number =~ NUMBER and error_line =~ ERROR_OR_FAILED }.each { |number, error_line, *rest| description = error_line.match(ERROR_OR_FAILED).pre_match @@ -31,9 +31,8 @@ failures = output.slice_before(NUMBER).select { |number, error_line, *rest| https://github.com/ruby/ruby/blob/trunk/spec/mspec/tool/tag_from_output.rb#L31 Dir.mkdir(dir) unless Dir.exist?(dir) tag_line = "fails:#{description}" - unless File.exist?(tags_file) and File.readlines(tags_file, chomp: true).include?(tag_line) - File.open(tags_file, 'a') do |f| - f.puts tag_line - end + lines = File.exist?(tags_file) ? File.readlines(tags_file, chomp: true) : [] + unless lines.include?(tag_line) + File.write(tags_file, (lines + [tag_line]).join("\n") + "\n") end } -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/