Permalink
Browse files

Suppress unused variable warnings for 1.9.3dev

  • Loading branch information...
1 parent d70638b commit ffad055f5aea480c3ca25d2ebbd682fa139ca4e2 @drbrain drbrain committed Jan 7, 2011
View
@@ -337,7 +337,7 @@ def standard_rake_options
rescue LoadError => ex
begin
rake_require value
- rescue LoadError => ex2
+ rescue LoadError
raise ex
end
end
@@ -25,7 +25,7 @@ def self.time
def initialize(path, entry)
@path = path
- @mode, line, @owner, @group, size, d1, d2, d3, @name = entry.split(' ')
+ @mode, _, @owner, @group, size, d1, d2, d3, @name = entry.split(' ')
@size = size.to_i
@time = determine_time(d1, d2, d3)
end
@@ -59,7 +59,6 @@ def parse_mode(m)
def determine_time(d1, d2, d3)
now = self.class.time.now
if /:/ =~ d3
- h, m = d3.split(':')
result = Time.parse("#{d1} #{d2} #{now.year} #{d3}")
if result > now
result = Time.parse("#{d1} #{d2} #{now.year-1} #{d3}")
View
@@ -49,7 +49,7 @@ def sh(*cmd, &block)
def create_shell_runner(cmd)
show_command = cmd.join(" ")
show_command = show_command[0,42] + "..." unless $trace
- block = lambda { |ok, status|
+ lambda { |ok, status|
ok or fail "Command failed with status (#{status.exitstatus}): [#{show_command}]"
}
end
@@ -91,7 +91,7 @@ def safe_ln(*args)
else
begin
ln(*args)
- rescue StandardError, NotImplementedError => ex
+ rescue StandardError, NotImplementedError
LN_SUPPORTED[0] = false
cp(*args)
end
View
@@ -15,7 +15,7 @@ def initialize
end
def create_rule(*args, &block)
- pattern, arg_names, deps = resolve_args(args)
+ pattern, _, deps = resolve_args(args)
pattern = Regexp.new(Regexp.quote(pattern) + '$') if String === pattern
@rules << [pattern, deps, block]
end
@@ -124,7 +124,7 @@ def enhance_with_matching_rule(task_name, level=0)
fail Rake::RuleRecursionOverflowError,
"Rule Recursion Too Deep" if level >= 16
@rules.each do |pattern, extensions, block|
- if md = pattern.match(task_name)
+ if pattern.match(task_name)
task = attempt_rule(task_name, extensions, block, level)
return task if task
end
@@ -2,7 +2,7 @@
begin
require 'rubygems'
-rescue LoadError => ex
+rescue LoadError
end
require 'test/unit'
require 'fileutils'
@@ -65,7 +65,6 @@ def test_display_tasks_with_task_name_wider_than_tty_display
in_environment('RAKE_COLUMNS' => '80') do
@app.options.show_tasks = :tasks
@app.options.show_task_pattern = //
- description = "something short"
task_name = "task name" * 80
@app.last_description = "something short"
@app.define_task(Rake::Task, task_name )
@@ -306,7 +305,7 @@ def test_run_with_bad_options
ARGV.clear
ARGV << '-f' << '-s' << '--xyzzy'
assert_exception(SystemExit) {
- err = capture_stderr { capture_stdout { @app.run } }
+ capture_stderr { capture_stdout { @app.run } }
}
ensure
ARGV.clear
@@ -635,7 +634,7 @@ def flags(*sets)
sets.each do |set|
ARGV.clear
@out = capture_stdout {
- @exit = catch(:system_exit) { opts = command_line(*set) }
+ @exit = catch(:system_exit) { command_line(*set) }
}
yield(@app.options) if block_given?
end
@@ -6,7 +6,6 @@
class TestEarlyTime < Test::Unit::TestCase
def test_create
early = Rake::EarlyTime.instance
- time = Time.mktime(1970, 1, 1, 0, 0, 0)
assert early <= Time.now
assert early < Time.now
assert early != Time.now
@@ -325,7 +325,6 @@ def test_gsub!
def test_egrep_returns_0_if_no_matches
files = FileList['test/lib/*_test.rb'].exclude("test/lib/filelist_test.rb")
- the_line_number = __LINE__ + 1
assert_equal 0, files.egrep(/XYZZY/) { }
end
@@ -43,7 +43,7 @@ def test_create
def test_missing_version
assert_exception(RuntimeError) {
- pkg = Rake::PackageTask.new("pkgr") { |p| }
+ Rake::PackageTask.new("pkgr") { |p| }
}
end
View
@@ -88,7 +88,7 @@ def test_percent_percent_returns_percent
end
def test_undefined_percent_causes_error
- ex = assert_exception(ArgumentError) {
+ assert_exception(ArgumentError) {
"dir/abc.rb".pathmap("%z")
}
end
@@ -46,7 +46,7 @@ def test_tasks_creation_with_custom_name_hash
end
def test_tasks_creation_with_custom_name_hash_will_use_default_if_an_option_isnt_given
- rd = Rake::RDocTask.new(:clobber_rdoc => "rdoc:clean")
+ Rake::RDocTask.new(:clobber_rdoc => "rdoc:clean")
assert Task[:rdoc]
assert Task[:"rdoc:clean"]
assert Task[:rerdoc]
View
@@ -278,7 +278,6 @@ def test_second_rule_doest_run_if_first_triggers_with_reversed_rules
end
def test_rule_with_proc_dependent_will_trigger
- ran = false
mkdir_p("testdata/src/jw")
create_file("testdata/src/jw/X.java")
rule %r(classes/.*\.class) => [
@@ -72,7 +72,7 @@ def test_name_lookup_with_implicit_file_tasks
def test_name_lookup_with_nonexistent_task
assert_exception(RuntimeError) {
- t = @tm["DOES NOT EXIST"]
+ @tm["DOES NOT EXIST"]
}
end
View
@@ -1,7 +1,6 @@
begin
require 'rubygems'
-rescue LoadError => ex
- # No rubygems available
+rescue LoadError
end
require 'test/unit'
require 'flexmock/test_unit'

0 comments on commit ffad055

Please sign in to comment.