From 36bc8c0b283f494d1a7aade390fe391f7894821f Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 18 May 2018 00:38:00 +0000 Subject: [PATCH] tool: removed unused variables git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/enc-emoji-citrus-gen.rb | 2 +- tool/enc-unicode.rb | 1 - tool/eval.rb | 4 +--- tool/expand-config.rb | 2 -- tool/fake.rb | 1 - tool/gen_ruby_tapset.rb | 11 +++++------ tool/mkrunnable.rb | 2 -- tool/rbinstall.rb | 3 +-- tool/redmine-backporter.rb | 4 ++-- tool/transcode-tblgen.rb | 12 ++++++------ 10 files changed, 16 insertions(+), 26 deletions(-) diff --git a/tool/enc-emoji-citrus-gen.rb b/tool/enc-emoji-citrus-gen.rb index 5037cbde1e..94864e5fa0 100644 --- a/tool/enc-emoji-citrus-gen.rb +++ b/tool/enc-emoji-citrus-gen.rb @@ -93,7 +93,7 @@ def generate_from_ucs(params, pairs) end def make_pairs(code_map) - pairs = code_map.inject([]) {|acc, (range, ch)| + code_map.inject([]) {|acc, (range, ch)| acc += range.map{|uni| pair = [uni, Integer(ch)]; ch = ch.succ; next pair } } end diff --git a/tool/enc-unicode.rb b/tool/enc-unicode.rb index 2ba0b73606..d953014952 100755 --- a/tool/enc-unicode.rb +++ b/tool/enc-unicode.rb @@ -229,7 +229,6 @@ def parse_GraphemeBreakProperty(data) end def parse_block(data) - current = nil cps = [] blocks = [] data_foreach('Blocks.txt') do |line| diff --git a/tool/eval.rb b/tool/eval.rb index 981f72733b..9153573e6e 100644 --- a/tool/eval.rb +++ b/tool/eval.rb @@ -107,7 +107,6 @@ def calc_each data end def calc_stat stats - stat = [] stats[0].each_with_index{|e, idx| bm = e[0] vals = stats.map{|st| @@ -134,8 +133,7 @@ def stat } # pp total total[0].each_with_index{|e, idx| - bm = e[0] - # print "#{bm}\t" + # print "#{e[0]}\t" total.each{|st| print st[idx][1], "\t" } diff --git a/tool/expand-config.rb b/tool/expand-config.rb index d34f29f586..81ffa6cb98 100755 --- a/tool/expand-config.rb +++ b/tool/expand-config.rb @@ -15,8 +15,6 @@ while /\A(\w+)=(.*)/ =~ ARGV[0] ARGV.shift end -re = /@(#{config.keys.map {|k| Regexp.quote(k)}.join('|')})@/ - if $output output = open($output, "wb", $mode &&= $mode.oct) output.chmod($mode) if $mode diff --git a/tool/fake.rb b/tool/fake.rb index 7b29e55f61..dc8cf83e69 100644 --- a/tool/fake.rb +++ b/tool/fake.rb @@ -14,7 +14,6 @@ $:.unshift(builddir) posthook = proc do config = RbConfig::CONFIG mkconfig = RbConfig::MAKEFILE_CONFIG - extout = File.expand_path(mkconfig["EXTOUT"], builddir) [ ["top_srcdir", $top_srcdir], ["topdir", $topdir], diff --git a/tool/gen_ruby_tapset.rb b/tool/gen_ruby_tapset.rb index ec8650204f..ae3c1eccd2 100755 --- a/tool/gen_ruby_tapset.rb +++ b/tool/gen_ruby_tapset.rb @@ -31,7 +31,7 @@ text.gsub!(/^\};/, "") # probename() text.gsub!(/probe (.+)\( *\);/) { probe_name = $1 - probe = <<-End + <<-End probe #{probe_name} = process("ruby").provider("ruby").mark("#{probe_name}") { } @@ -43,7 +43,7 @@ text.gsub!(/ *probe (.+)\(([^,)]+)\);/) { probe_name = $1 arg1 = $2 - probe = <<-End + <<-End probe #{probe_name} = process("ruby").provider("ruby").mark("#{probe_name}") { #{set_argument(arg1, 1)} @@ -57,7 +57,7 @@ text.gsub!(/ *probe (.+)\(([^,)]+),([^,)]+)\);/) { arg1 = $2 arg2 = $3 - probe = <<-End + <<-End probe #{probe_name} = process("#{ruby_path}").provider("ruby").mark("#{probe_name}") { #{set_argument(arg1, 1)} @@ -73,7 +73,7 @@ text.gsub!(/ *probe (.+)\(([^,)]+),([^,)]+),([^,)]+)\);/) { arg2 = $3 arg3 = $4 - probe = <<-End + <<-End probe #{probe_name} = process("#{ruby_path}").provider("ruby").mark("#{probe_name}") { #{set_argument(arg1, 1)} @@ -91,7 +91,7 @@ text.gsub!(/ *probe (.+)\(([^,)]+),([^,)]+),([^,)]+),([^,)]+)\);/) { arg3 = $4 arg4 = $5 - probe = <<-End + <<-End probe #{probe_name} = process("#{ruby_path}").provider("ruby").mark("#{probe_name}") { #{set_argument(arg1, 1)} @@ -103,4 +103,3 @@ text.gsub!(/ *probe (.+)\(([^,)]+),([^,)]+),([^,)]+),([^,)]+)\);/) { } print text - diff --git a/tool/mkrunnable.rb b/tool/mkrunnable.rb index e43c4329e7..01756a3529 100755 --- a/tool/mkrunnable.rb +++ b/tool/mkrunnable.rb @@ -95,7 +95,6 @@ config.each_value {|s| RbConfig.expand(s, config)} srcdir = config["srcdir"] ||= File.dirname(__FILE__) top_srcdir = config["top_srcdir"] ||= File.dirname(srcdir) extout = ARGV[0] || config["EXTOUT"] -version = config["ruby_version"] arch = config["arch"] bindir = config["bindir"] libdirname = config["libdirname"] @@ -104,7 +103,6 @@ vendordir = config["vendordir"] rubylibdir = config["rubylibdir"] rubyarchdir = config["rubyarchdir"] archdir = "#{extout}/#{arch}" -rubylibs = [vendordir, rubylibdir, rubyarchdir] [bindir, libdir, archdir].uniq.each do |dir| File.directory?(dir) or mkdir_p(dir) end diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index c648a4ad57..9e935bdb47 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -333,7 +333,6 @@ vendorlibdir = CONFIG["vendorlibdir"] vendorarchlibdir = CONFIG["vendorarchdir"] mandir = CONFIG["mandir", true] docdir = CONFIG["docdir", true] -configure_args = Shellwords.shellwords(CONFIG["configure_args"]) enable_shared = CONFIG["ENABLE_SHARED"] == 'yes' dll = CONFIG["LIBRUBY_SO", enable_shared] lib = CONFIG["LIBRUBY", true] @@ -823,7 +822,7 @@ install?(:ext, :comm, :gem, :'bundled-gems') do inst.spec.extension_dir = with_destdir(inst.spec.extension_dir) begin Gem::DefaultUserInteraction.use_ui(silent) {inst.install} - rescue Gem::InstallError => e + rescue Gem::InstallError next end gemname = File.basename(gem) diff --git a/tool/redmine-backporter.rb b/tool/redmine-backporter.rb index 8299872d2f..bbe23edae8 100755 --- a/tool/redmine-backporter.rb +++ b/tool/redmine-backporter.rb @@ -205,7 +205,7 @@ class << Readline def readline(prompt = '') console = IO.console console.binmode - ly, lx = console.winsize + _, lx = console.winsize if /mswin|mingw/ =~ RUBY_PLATFORM or /^(?:vt\d\d\d|xterm)/i =~ ENV["TERM"] cls = "\r\e[2K" else @@ -329,7 +329,7 @@ def status_char(obj) end console = IO.console -row, col = console.winsize +row, = console.winsize @query['limit'] = row - 2 puts "Backporter #{VERSION}".color(bold: true) + " for #{TARGET_VERSION}" diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb index c9867f95fa..5134a49b43 100644 --- a/tool/transcode-tblgen.rb +++ b/tool/transcode-tblgen.rb @@ -63,7 +63,7 @@ class ArrayCode end def insert_at_last(num, str) - newnum = self.length + num + # newnum = self.length + num @content << str @len += num end @@ -235,7 +235,7 @@ class ActionMap all_rects = [] rects1.each {|rect| - min, max, action = rect + _, _, action = rect rect[2] = actions.length actions << action all_rects << rect @@ -244,7 +244,7 @@ class ActionMap boundary = actions.length rects2.each {|rect| - min, max, action = rect + _, _, action = rect rect[2] = actions.length actions << action all_rects << rect @@ -273,7 +273,7 @@ class ActionMap singleton_rects = [] region_rects = [] rects.each {|rect| - min, max, action = rect + min, max, = rect if min == max singleton_rects << rect else @@ -293,7 +293,7 @@ class ActionMap if region_rects.empty? ? s_rect[0].length == prefix.length : region_rects[0][0].empty? h = TMPHASH while (s_rect = @singleton_rects.last) && s_rect[0].start_with?(prefix) - min, max, action = @singleton_rects.pop + min, _, action = @singleton_rects.pop raise ArgumentError, "ambiguous pattern: #{prefix}" if min.length != prefix.length h[action] = true end @@ -906,7 +906,7 @@ end def transcode_generate_node(am, name_hint=nil) STDERR.puts "converter for #{name_hint}" if VERBOSE_MODE - name = am.gennode(TRANSCODE_GENERATED_BYTES_CODE, TRANSCODE_GENERATED_WORDS_CODE, name_hint) + am.gennode(TRANSCODE_GENERATED_BYTES_CODE, TRANSCODE_GENERATED_WORDS_CODE, name_hint) '' end