This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 49624af Simplify: keys.each => each_key
49624af is described below
commit 49624af4d07031e792b283f12e3f6eaf948d024c
Author: Sebb <[email protected]>
AuthorDate: Tue Sep 22 19:27:36 2020 +0100
Simplify: keys.each => each_key
---
lib/whimsy/logparser.rb | 2 +-
lib/whimsy/sitewebsite.rb | 6 +++---
tools/pubsub2rake.rb | 2 +-
tools/site-scan.rb | 2 +-
www/apmail/mods.cgi | 2 +-
www/board/agenda/daemon/channel.rb | 2 +-
www/board/agenda/views/actions/todos.json.rb | 2 +-
www/events/talks.cgi | 2 +-
www/members/board-attend.cgi | 2 +-
www/test/secretary/workbench/email.rb | 2 +-
10 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/lib/whimsy/logparser.rb b/lib/whimsy/logparser.rb
index 3c9cc62..515adee 100755
--- a/lib/whimsy/logparser.rb
+++ b/lib/whimsy/logparser.rb
@@ -95,7 +95,7 @@ module LogParser
def collate_whimsy_access(logs, apphash = WHIMSY_APPS)
remainder = logs
apps = {}
- apphash.keys.each do |a|
+ apphash.each_key do |a|
apps[a] = Hash.new{|h,k| h[k] = [] }
apps[a][RUSER] = Hash.new{|h,k| h[k] = 0 }
apps[a][REFERER] = Hash.new{|h,k| h[k] = 0 }
diff --git a/lib/whimsy/sitewebsite.rb b/lib/whimsy/sitewebsite.rb
index 110b0b1..b8e4a5f 100644
--- a/lib/whimsy/sitewebsite.rb
+++ b/lib/whimsy/sitewebsite.rb
@@ -38,7 +38,7 @@ def display_project(project, links, analysis, checks, tlp =
true)
end
end
_tbody do
- checks.keys.each do |col|
+ checks.each_key do |col|
cls = SiteStandards.label(analysis, links, col, project)
_tr do
_td do
@@ -163,7 +163,7 @@ def display_overview(sites, analysis, checks, tlp = true)
_thead do
_tr do
_th! "#{tlp ? 'Project' : 'Podling'}", data_sort: 'string-ins'
- checks.keys.each do |col|
+ checks.each_key do |col|
_th! data_sort: 'string' do
_a col.capitalize, href: "check/#{col}"
_br
@@ -186,7 +186,7 @@ def display_overview(sites, analysis, checks, tlp = true)
_td do
_a "#{links['display_name']}", href: "project/#{n}"
end
- checks.keys.each do |c|
+ checks.each_key do |c|
cls = SiteStandards.label(analysis, links, c, n)
_td '', class: cls, data_sort_value: sort_order[cls]
end
diff --git a/tools/pubsub2rake.rb b/tools/pubsub2rake.rb
index d914922..e167f71 100755
--- a/tools/pubsub2rake.rb
+++ b/tools/pubsub2rake.rb
@@ -125,7 +125,7 @@ if $0 == __FILE__
watching = WATCH[path]
watching.each do |svn_prefix, svn_alias, files|
changed = event['commit']['changed']
- changed.keys.each do |ck|
+ changed.each_key do |ck|
if ck.start_with? svn_prefix # file matches target path
if files && files.size > 0 # but does it match exactly?
files.each do |file|
diff --git a/tools/site-scan.rb b/tools/site-scan.rb
index 4d5e84d..3d02123 100755
--- a/tools/site-scan.rb
+++ b/tools/site-scan.rb
@@ -43,7 +43,7 @@ end
# @see SiteStandards for definitions of what we should scan for (in general)
def parse(id, site, name)
data = {}
- SiteStandards::COMMON_CHECKS.keys.each do |k|
+ SiteStandards::COMMON_CHECKS.each_key do |k|
data[k.to_sym] = nil
end
data[:display_name] = name
diff --git a/www/apmail/mods.cgi b/www/apmail/mods.cgi
index 3dadb60..7b1e88e 100755
--- a/www/apmail/mods.cgi
+++ b/www/apmail/mods.cgi
@@ -100,7 +100,7 @@ _html do
_h2_ "Mailing Lists - #{$1}"
_ul do
- mods[$1].keys.each do |list|
+ mods[$1].each_key do |list|
_li! { _a list, href: "#{list}/" }
end
end
diff --git a/www/board/agenda/daemon/channel.rb
b/www/board/agenda/daemon/channel.rb
index 6dbd294..52712d2 100644
--- a/www/board/agenda/daemon/channel.rb
+++ b/www/board/agenda/daemon/channel.rb
@@ -87,7 +87,7 @@ class Channel
# close all open sockets
def self.close_all
- @@sockets.keys.each do |client|
+ @@sockets.each_key do |client|
client.close
end
end
diff --git a/www/board/agenda/views/actions/todos.json.rb
b/www/board/agenda/views/actions/todos.json.rb
index b948c70..98e236d 100644
--- a/www/board/agenda/views/actions/todos.json.rb
+++ b/www/board/agenda/views/actions/todos.json.rb
@@ -235,7 +235,7 @@ parsed_agenda.each do |item|
next unless item[:attach] =~ /^7\w$/
if item['title'] =~ /^Change (.*?) Chair$/ and item['people']
pmc = ASF::Committee.find($1).id
- item['people'].keys.each do |person|
+ item['people'].each_key do |person|
transitioning[ASF::Person.find(person)] = item['title']
end
next if Array(minutes[:todos][:changed]).include? pmc
diff --git a/www/events/talks.cgi b/www/events/talks.cgi
index 05f79c2..c85688a 100755
--- a/www/events/talks.cgi
+++ b/www/events/talks.cgi
@@ -123,7 +123,7 @@ _html do
alltalks = talks.group_by { |t| t[1]['topics'][0]}
_p do
_ 'All talks by topics: '
- alltalks.keys.each do | topic |
+ alltalks.each_key do | topic |
_a "#{topic}", href: "##{topic}"
_ ' | ' unless topic == alltalks.keys.last
end
diff --git a/www/members/board-attend.cgi b/www/members/board-attend.cgi
index 47d6edb..74ad4e3 100755
--- a/www/members/board-attend.cgi
+++ b/www/members/board-attend.cgi
@@ -88,7 +88,7 @@ _html do
datums = JSON.parse(File.read(File.join(BOARD, 'scripts',
'board-attend.json')))
months = Set.new()
datums.each do |id, data|
- data.keys.each do |m|
+ data.each_key do |m|
months << m
end
end
diff --git a/www/test/secretary/workbench/email.rb
b/www/test/secretary/workbench/email.rb
index 8b8dacb..2304580 100644
--- a/www/test/secretary/workbench/email.rb
+++ b/www/test/secretary/workbench/email.rb
@@ -22,7 +22,7 @@ class EmailTest < Test::Unit::TestCase
def make_pending(*requests)
# convert symbols into strings in each request
requests.each do |vars|
- vars.keys.each {|key| vars[key.to_s] = vars.delete(key) if Symbol ===
key}
+ vars.each_key {|key| vars[key.to_s] = vars.delete(key) if Symbol === key}
end
# output pending