[前][次][番号順一覧][スレッド一覧]

ruby-changes:51253

From: nobu <ko1@a...>
Date: Fri, 18 May 2018 09:38:06 +0900 (JST)
Subject: [ruby-changes:51253] nobu:r63459 (trunk): tool: removed unused variables

nobu	2018-05-18 09:38:00 +0900 (Fri, 18 May 2018)

  New Revision: 63459

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63459

  Log:
    tool: removed unused variables

  Modified files:
    trunk/tool/enc-emoji-citrus-gen.rb
    trunk/tool/enc-unicode.rb
    trunk/tool/eval.rb
    trunk/tool/expand-config.rb
    trunk/tool/fake.rb
    trunk/tool/gen_ruby_tapset.rb
    trunk/tool/mkrunnable.rb
    trunk/tool/rbinstall.rb
    trunk/tool/redmine-backporter.rb
    trunk/tool/transcode-tblgen.rb
Index: tool/redmine-backporter.rb
===================================================================
--- tool/redmine-backporter.rb	(revision 63458)
+++ tool/redmine-backporter.rb	(revision 63459)
@@ -205,7 +205,7 @@ class << Readline https://github.com/ruby/ruby/blob/trunk/tool/redmine-backporter.rb#L205
   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) https://github.com/ruby/ruby/blob/trunk/tool/redmine-backporter.rb#L329
 end
 
 console = IO.console
-row, col = console.winsize
+row, = console.winsize
 @query['limit'] = row - 2
 puts "Backporter #{VERSION}".color(bold: true) + " for #{TARGET_VERSION}"
 
Index: tool/enc-unicode.rb
===================================================================
--- tool/enc-unicode.rb	(revision 63458)
+++ tool/enc-unicode.rb	(revision 63459)
@@ -229,7 +229,6 @@ def parse_GraphemeBreakProperty(data) https://github.com/ruby/ruby/blob/trunk/tool/enc-unicode.rb#L229
 end
 
 def parse_block(data)
-  current = nil
   cps = []
   blocks = []
   data_foreach('Blocks.txt') do |line|
Index: tool/gen_ruby_tapset.rb
===================================================================
--- tool/gen_ruby_tapset.rb	(revision 63458)
+++ tool/gen_ruby_tapset.rb	(revision 63459)
@@ -31,7 +31,7 @@ text.gsub!(/^\};/, "") https://github.com/ruby/ruby/blob/trunk/tool/gen_ruby_tapset.rb#L31
 # 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 (.+)\(([^,)]+)\);/) https://github.com/ruby/ruby/blob/trunk/tool/gen_ruby_tapset.rb#L43
   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 (.+)\(([^,)]+),([^,) https://github.com/ruby/ruby/blob/trunk/tool/gen_ruby_tapset.rb#L57
   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 (.+)\(([^,)]+),([^,) https://github.com/ruby/ruby/blob/trunk/tool/gen_ruby_tapset.rb#L73
   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 (.+)\(([^,)]+),([^,) https://github.com/ruby/ruby/blob/trunk/tool/gen_ruby_tapset.rb#L91
   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 (.+)\(([^,)]+),([^,) https://github.com/ruby/ruby/blob/trunk/tool/gen_ruby_tapset.rb#L103
 }
 
 print text
-
Index: tool/transcode-tblgen.rb
===================================================================
--- tool/transcode-tblgen.rb	(revision 63458)
+++ tool/transcode-tblgen.rb	(revision 63459)
@@ -63,7 +63,7 @@ class ArrayCode https://github.com/ruby/ruby/blob/trunk/tool/transcode-tblgen.rb#L63
   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 https://github.com/ruby/ruby/blob/trunk/tool/transcode-tblgen.rb#L235
     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 https://github.com/ruby/ruby/blob/trunk/tool/transcode-tblgen.rb#L244
     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 https://github.com/ruby/ruby/blob/trunk/tool/transcode-tblgen.rb#L273
     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 https://github.com/ruby/ruby/blob/trunk/tool/transcode-tblgen.rb#L293
     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 https://github.com/ruby/ruby/blob/trunk/tool/transcode-tblgen.rb#L906
 
 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
 
Index: tool/mkrunnable.rb
===================================================================
--- tool/mkrunnable.rb	(revision 63458)
+++ tool/mkrunnable.rb	(revision 63459)
@@ -95,7 +95,6 @@ config.each_value {|s| RbConfig.expand(s https://github.com/ruby/ruby/blob/trunk/tool/mkrunnable.rb#L95
 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"] https://github.com/ruby/ruby/blob/trunk/tool/mkrunnable.rb#L103
 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
Index: tool/fake.rb
===================================================================
--- tool/fake.rb	(revision 63458)
+++ tool/fake.rb	(revision 63459)
@@ -14,7 +14,6 @@ $:.unshift(builddir) https://github.com/ruby/ruby/blob/trunk/tool/fake.rb#L14
 posthook = proc do
   config = RbConfig::CONFIG
   mkconfig = RbConfig::MAKEFILE_CONFIG
-  extout = File.expand_path(mkconfig["EXTOUT"], builddir)
   [
     ["top_srcdir", $top_srcdir],
     ["topdir", $topdir],
Index: tool/expand-config.rb
===================================================================
--- tool/expand-config.rb	(revision 63458)
+++ tool/expand-config.rb	(revision 63459)
@@ -15,8 +15,6 @@ while /\A(\w+)=(.*)/ =~ ARGV[0] https://github.com/ruby/ruby/blob/trunk/tool/expand-config.rb#L15
   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
Index: tool/enc-emoji-citrus-gen.rb
===================================================================
--- tool/enc-emoji-citrus-gen.rb	(revision 63458)
+++ tool/enc-emoji-citrus-gen.rb	(revision 63459)
@@ -93,7 +93,7 @@ def generate_from_ucs(params, pairs) https://github.com/ruby/ruby/blob/trunk/tool/enc-emoji-citrus-gen.rb#L93
 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
Index: tool/eval.rb
===================================================================
--- tool/eval.rb	(revision 63458)
+++ tool/eval.rb	(revision 63459)
@@ -107,7 +107,6 @@ def calc_each data https://github.com/ruby/ruby/blob/trunk/tool/eval.rb#L107
 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 https://github.com/ruby/ruby/blob/trunk/tool/eval.rb#L133
   }
   # 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"
     }
Index: tool/rbinstall.rb
===================================================================
--- tool/rbinstall.rb	(revision 63458)
+++ tool/rbinstall.rb	(revision 63459)
@@ -333,7 +333,6 @@ vendorlibdir = CONFIG["vendorlibdir"] https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L333
 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-ge https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L822
       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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]