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 2016/06/03 19:11:13 UTC

[whimsy] branch master updated: Ruby 2.3 compatibility

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

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

The following commit(s) were added to refs/heads/master by this push:
       new  8e390c6   Ruby 2.3 compatibility
8e390c6 is described below

commit 8e390c663e814292b0eec1411429063b93fdc56f
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Fri Jun 3 15:10:54 2016 -0400

    Ruby 2.3 compatibility
---
 www/secretary/workbench/file.cgi | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/www/secretary/workbench/file.cgi b/www/secretary/workbench/file.cgi
index 912cf68..557f314 100755
--- a/www/secretary/workbench/file.cgi
+++ b/www/secretary/workbench/file.cgi
@@ -204,7 +204,7 @@ def svn_info(source)
   info
 end
 
-def email(target, message)
+def send_email(target, message)
   pending = YAML.load(open(PENDING_YML))
 
   require MAIL if defined?(MAIL)
@@ -214,9 +214,9 @@ def email(target, message)
   pending.each do |pending_hash|
     next unless pending_hash['email'] == target
 
-    vars = OpenStruct.new(pending_hash.map {|k,v| 
+    vars = OpenStruct.new(Hash[pending_hash.map {|k,v| 
       [k.gsub(/\W/,'_'), v.dup.untaint]
-    })
+    }])
     vars.commit_message = message
 
     # collapse pmc and podling variable names
@@ -238,10 +238,10 @@ def email(target, message)
       end
 
       # expand template
-      def vars.get_binding
-        binding
+      def vars.render(template)
+        ERB.new(template).result(binding)
       end
-      message = ERB.new(open(template).read.untaint).result(vars.get_binding)
+      message = vars.render(open(template).read.untaint)
       headers = message.slice!(/\A(\w+: .*\r?\n)*(\r?\n)*/)
 
       mail = Mail.new do
@@ -354,7 +354,7 @@ _json do
   elsif @cmd == 'icla.txt issues'
     _html check
   elsif @cmd =~ /email (.*)/
-    _html email $1, @message
+    _html send_email $1, @message
   elsif @cmd =~ /svn (update|revert -R|cleanup)/ and committable.include? @file
     op, file = $1.split(' '), @file
     _html html_fragment {

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].