From 1ee1533ab28c06d530f756c3134a58255f5bedbb Mon Sep 17 00:00:00 2001 From: Johan Holmberg Date: Sat, 8 Aug 2015 23:42:14 +0200 Subject: [PATCH] fix "ruby -w" warnings --- lib/cmdtest/argumentparser.rb | 4 ++-- lib/cmdtest/fssnapshot.rb | 1 - lib/cmdtest/testcase.rb | 2 +- lib/cmdtest/workdir.rb | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/cmdtest/argumentparser.rb b/lib/cmdtest/argumentparser.rb index a943f93..9edfe7e 100644 --- a/lib/cmdtest/argumentparser.rb +++ b/lib/cmdtest/argumentparser.rb @@ -246,7 +246,7 @@ module Cmdtest end # --foo - elsif _arg() =~ /^(--\w[-_\w_]*)$/ + elsif _arg() =~ /^(--\w[-\w]*)$/ option = _find_option($1) if option._with_arg() option._set(_arg(1), @opts) @@ -257,7 +257,7 @@ module Cmdtest end # --foo=... - elsif _arg() =~ /^(--\w[-_\w]*)=(.*)$/ + elsif _arg() =~ /^(--\w[-\w]*)=(.*)$/ option = _find_option($1) if option._with_arg() option._set($2, @opts) diff --git a/lib/cmdtest/fssnapshot.rb b/lib/cmdtest/fssnapshot.rb index 7619628..e220327 100644 --- a/lib/cmdtest/fssnapshot.rb +++ b/lib/cmdtest/fssnapshot.rb @@ -45,7 +45,6 @@ module Cmdtest @dir = dir @ignored_files = ignored_files @fileinfo_by_path = {} - dir_prefix = @dir + "/" relative_find(@dir) do |path| next if path == "." file_info = FileInfo.new(path, @dir) diff --git a/lib/cmdtest/testcase.rb b/lib/cmdtest/testcase.rb index 61045f0..a530aed 100644 --- a/lib/cmdtest/testcase.rb +++ b/lib/cmdtest/testcase.rb @@ -63,7 +63,7 @@ module Cmdtest ORIG_CWD = Dir.pwd - attr_reader :_work_dir, :_cwd, :_env + attr_reader :_work_dir, :_env def initialize(test_method, clog, runner) @_test_method = test_method diff --git a/lib/cmdtest/workdir.rb b/lib/cmdtest/workdir.rb index 214b96b..6a5a71e 100644 --- a/lib/cmdtest/workdir.rb +++ b/lib/cmdtest/workdir.rb @@ -159,7 +159,7 @@ module Cmdtest _quote(_tmp_redirect_sh), ] before = _take_snapshot - ok = system(str) + system(str) # TODO: really ignore exit status !? after = _take_snapshot CmdEffects.new($?, File.read(_tmp_stdout_log),