You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2018/05/23 17:03:22 UTC

[whimsy] branch master updated (2fdca47 -> 56ea35d)

This is an automated email from the ASF dual-hosted git repository.

rubys pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git.


    from 2fdca47  templatize rejected reports and resolutions
     new 6610ded  rename prefixNumber to ordinalize
     new 56ea35d  conditionally define new method

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:
 www/board/agenda/views/committers_report.text.rb | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
rubys@apache.org.

[whimsy] 02/02: conditionally define new method

Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git

commit 56ea35d6e8ca085632cb3c39c4068a3e7a174cbd
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Wed May 23 13:02:39 2018 -0400

    conditionally define new method
---
 www/board/agenda/views/committers_report.text.rb | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/www/board/agenda/views/committers_report.text.rb b/www/board/agenda/views/committers_report.text.rb
index 341828d..e9e3064 100644
--- a/www/board/agenda/views/committers_report.text.rb
+++ b/www/board/agenda/views/committers_report.text.rb
@@ -3,14 +3,16 @@ require 'chronic'
 ## This is a script to generate an email for committers@apache.org
 
 # Add the right prefix to a number
-class Integer
-  def ordinalize
-    if self % 10 == 1
-      self.to_s + "st"
-    elsif self % 10 == 2
-      self.to_s + "nd"
-    else
-      self.to_s + "th"
+unless Integer.public_method_defined? :ordinalize
+  class Integer
+    def ordinalize
+      if self % 10 == 1
+	self.to_s + "st"
+      elsif self % 10 == 2
+	self.to_s + "nd"
+      else
+	self.to_s + "th"
+      end
     end
   end
 end

-- 
To stop receiving notification emails like this one, please contact
rubys@apache.org.

[whimsy] 01/02: rename prefixNumber to ordinalize

Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git

commit 6610dedccb4f4bed431c0ac5d4fe96bf8bad9223
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Wed May 23 12:24:19 2018 -0400

    rename prefixNumber to ordinalize
---
 www/board/agenda/views/committers_report.text.rb | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/www/board/agenda/views/committers_report.text.rb b/www/board/agenda/views/committers_report.text.rb
index 930d472..341828d 100644
--- a/www/board/agenda/views/committers_report.text.rb
+++ b/www/board/agenda/views/committers_report.text.rb
@@ -3,13 +3,15 @@ require 'chronic'
 ## This is a script to generate an email for committers@apache.org
 
 # Add the right prefix to a number
-def prefixNumber(number) 
-  if number % 10 == 1
-    number.to_s + "st"
-  elsif number % 10 == 2
-    number.to_s + "nd"
-  else
-    number.to_s + "th"
+class Integer
+  def ordinalize
+    if self % 10 == 1
+      self.to_s + "st"
+    elsif self % 10 == 2
+      self.to_s + "nd"
+    else
+      self.to_s + "th"
+    end
   end
 end
 
@@ -82,7 +84,7 @@ end
 ##### 7: Find out the date of the next board report
 
 next_meeting = ASF::Board.nextMeeting
-@next_meeting = prefixNumber(next_meeting.day) + " of " + 
+@next_meeting = next_meeting.day.ordinalize + " of " + 
   next_meeting.strftime('%B')
 
 if !approved_minutes.empty?
@@ -103,7 +105,7 @@ To: committers@apache.org
 Reply-To: board@apache.org
 Subject: ASF Board Meeting Summary - #{@date.strftime('%B %d, %Y')}
 
-The #{@date.strftime('%B')} board meeting took place on the #{prefixNumber(@date.day)}.
+The #{@date.strftime('%B')} board meeting took place on the #{@date.day.ordinalize}.
 
 <%#
 

-- 
To stop receiving notification emails like this one, please contact
rubys@apache.org.