You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2020/11/21 23:39:48 UTC
[whimsy] branch master updated (2e6aa3a -> 9bd6462)
This is an automated email from the ASF dual-hosted git repository.
sebb pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git.
from 2e6aa3a More valid resolutions
new 9e46cb6 Style tidy
new 9bd6462 Combine loops
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
lib/whimsy/asf/agenda.rb | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
[whimsy] 01/02: Style tidy
Posted by se...@apache.org.
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
commit 9e46cb6b44168ecf8f11b968aeeedd66c85d1bd9
Author: Sebb <se...@apache.org>
AuthorDate: Sat Nov 21 23:38:14 2020 +0000
Style tidy
---
lib/whimsy/asf/agenda.rb | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/lib/whimsy/asf/agenda.rb b/lib/whimsy/asf/agenda.rb
index 1c50f6f..c473a64 100644
--- a/lib/whimsy/asf/agenda.rb
+++ b/lib/whimsy/asf/agenda.rb
@@ -38,7 +38,7 @@ class ASF::Board::Agenda
# add that block to the list of parsers.
def self.parse(file=nil, quick=false, &block)
@@parsers << block if block
- new.parse(file, quick) if file
+ new.parse(file, quick) if file
end
# start with an empty list of sections. Sections are added and returned by
@@ -52,7 +52,7 @@ class ASF::Board::Agenda
# if a match is found.
def scan(text, pattern, &block)
# convert tabs to spaces
- text.gsub!(/^(\t+)/) {|tabs| ' ' * (8*tabs.length)}
+ text.gsub!(/^(\t+)/) {|tabs| ' ' * (8 * tabs.length)}
text.scan(pattern).each do |matches|
hash = Hash[pattern.names.zip(matches)]
@@ -86,8 +86,8 @@ class ASF::Board::Agenda
@file = file
@quick = quick
- if not @file.valid_encoding?
- filter = Proc.new {|c| c.unpack('U').first rescue 0xFFFD}
+ unless @file.valid_encoding?
+ filter = proc {|c| c.unpack1('U') rescue 0xFFFD}
@file = @file.chars.map(&filter).pack('U*').force_encoding('utf-8')
end
@@ -116,16 +116,16 @@ class ASF::Board::Agenda
if text
text.sub!(/\A\s*\n/, '')
text.sub!(/\s+\Z/, '')
- unindent = text.sub(/s+\Z/,'').scan(/^ *\S/).map(&:length).min || 1
- text.gsub! /^ {#{unindent-1}}/, ''
+ unindent = text.sub(/s+\Z/, '').scan(/^ *\S/).map(&:length).min || 1
+ text.gsub!(/^ {#{unindent - 1}}/, '')
end
text = hash['comments']
if text
text.sub!(/\A\s*\n/, '')
text.sub!(/\s+\Z/, '')
- unindent = text.sub(/s+\Z/,'').scan(/^ *\S/).map(&:length).min || 1
- text.gsub! /^ {#{unindent-1}}/, ''
+ unindent = text.sub(/s+\Z/, '').scan(/^ *\S/).map(&:length).min || 1
+ text.gsub!(/^ {#{unindent - 1}}/, '')
end
# add flags
@@ -133,7 +133,7 @@ class ASF::Board::Agenda
hash['flagged_by'] = flags.split(', ') if flags
# mark president reports
- hash['to'] = 'president' if preports && preports.include?(section)
+ hash['to'] = 'president' if preports&.include?(section)
end
unless @quick
@@ -173,7 +173,7 @@ class ASF::Board::Agenda
# provide a link to the collated minutes for a given report
def minutes(title)
- "https://whimsy.apache.org/board/minutes/#{title.gsub(/\W/,'_')}"
+ "https://whimsy.apache.org/board/minutes/#{title.gsub(/\W/, '_')}"
end
# convert a PST/PDT time to UTC as a JavaScript integer
[whimsy] 02/02: Combine loops
Posted by se...@apache.org.
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
commit 9bd64629e4578859be9fd93f89c36386f50f3e61
Author: Sebb <se...@apache.org>
AuthorDate: Sat Nov 21 23:39:39 2020 +0000
Combine loops
---
lib/whimsy/asf/agenda.rb | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/lib/whimsy/asf/agenda.rb b/lib/whimsy/asf/agenda.rb
index c473a64..1b619cb 100644
--- a/lib/whimsy/asf/agenda.rb
+++ b/lib/whimsy/asf/agenda.rb
@@ -157,10 +157,8 @@ class ASF::Board::Agenda
# add attach to section
@sections.each do |section, hash|
hash[:attach] = section
- end
- # look for missing titles
- @sections.each do |_section, hash|
+ # look for missing titles
hash['title'] ||= "UNKNOWN"
if hash['title'] == "UNKNOWN"