[whimsy] branch master updated: s/product/project/

2016-09-19 Thread rubys
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  11517a6   s/product/project/
11517a6 is described below

commit 11517a6bccb5ed0ea859eb7fb272921db369b466
Author: Sam Ruby 
AuthorDate: Mon Sep 19 15:14:23 2016 -0400

s/product/project/
---
 www/secmail/views/actions/icla.json.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/secmail/views/actions/icla.json.rb 
b/www/secmail/views/actions/icla.json.rb
index 3a9c4bf..73f63be 100644
--- a/www/secmail/views/actions/icla.json.rb
+++ b/www/secmail/views/actions/icla.json.rb
@@ -114,7 +114,7 @@ task "email #@email" do
   # chose reply based on whether or not the project/userid info was provided
   if @user and not @user.empty?
 reply = 'icla-account-requested.erb'
-  elsif @product and not @project.empty?
+  elsif @project and not @project.empty?
 reply = 'icla-pmc-notified.erb'
   else
 reply = 'icla.erb'

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


[whimsy] branch master updated: check for empty

2016-09-19 Thread rubys
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  e8443d3   check for empty
e8443d3 is described below

commit e8443d3f3a1fa8f5ae26ab9c4d901e52697a01dd
Author: Sam Ruby 
AuthorDate: Mon Sep 19 14:49:26 2016 -0400

check for empty
---
 www/secmail/views/actions/icla.json.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/secmail/views/actions/icla.json.rb 
b/www/secmail/views/actions/icla.json.rb
index e5c643a..3a9c4bf 100644
--- a/www/secmail/views/actions/icla.json.rb
+++ b/www/secmail/views/actions/icla.json.rb
@@ -112,9 +112,9 @@ end
 # send confirmation email
 task "email #@email" do
   # chose reply based on whether or not the project/userid info was provided
-  if @user
+  if @user and not @user.empty?
 reply = 'icla-account-requested.erb'
-  elsif @product
+  elsif @product and not @project.empty?
 reply = 'icla-pmc-notified.erb'
   else
 reply = 'icla.erb'

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


[whimsy] branch master updated: Update ICLA filed messages

2016-09-19 Thread clr
This is an automated email from the ASF dual-hosted git repository.

clr 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  1535c95   Update ICLA filed messages
1535c95 is described below

commit 1535c9527671557337ecef0b0b0d71f47acad5c0
Author: Craig L Russell 
AuthorDate: Mon Sep 19 10:52:42 2016 -0700

Update ICLA filed messages
---
 www/secmail/templates/icla-account-requested.erb | 4 ++--
 www/secmail/templates/icla-pmc-notified.erb  | 6 ++
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/www/secmail/templates/icla-account-requested.erb 
b/www/secmail/templates/icla-account-requested.erb
index ef8d367..18e121f 100644
--- a/www/secmail/templates/icla-account-requested.erb
+++ b/www/secmail/templates/icla-account-requested.erb
@@ -2,9 +2,9 @@ Dear <%= @pubname %>,
 
 This message acknowledges receipt of your ICLA, which has been filed in the 
Apache Software Foundation records.
 
-If you have been invited as a committer, please advise the project PMC that 
your ICLA has been filed.
+Your account has been requested for you and you should receive email with next 
steps.
 
-If you have not been invited, please refer to 
http://www.apache.org/foundation/how-it-works.html#developers
+Please refer to http://www.apache.org/foundation/how-it-works.html#developers
 for more information about roles at Apache.
 
 Warm Regards,
diff --git a/www/secmail/templates/icla-pmc-notified.erb 
b/www/secmail/templates/icla-pmc-notified.erb
index ef8d367..badeca7 100644
--- a/www/secmail/templates/icla-pmc-notified.erb
+++ b/www/secmail/templates/icla-pmc-notified.erb
@@ -2,10 +2,8 @@ Dear <%= @pubname %>,
 
 This message acknowledges receipt of your ICLA, which has been filed in the 
Apache Software Foundation records.
 
-If you have been invited as a committer, please advise the project PMC that 
your ICLA has been filed.
-
-If you have not been invited, please refer to 
http://www.apache.org/foundation/how-it-works.html#developers
-for more information about roles at Apache.
+With this message, your PMC has been notified that your ICLA has been filed.
+Please contact them with any questions.
 
 Warm Regards,
 

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


[whimsy] branch master updated: prep for separate responses depending on icla info

2016-09-19 Thread rubys
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  4335548   prep for separate responses depending on icla info
4335548 is described below

commit 4335548b587178716d04d521ab0964b5fa5bfd89
Author: Sam Ruby 
AuthorDate: Mon Sep 19 13:45:31 2016 -0400

prep for separate responses depending on icla info
---
 www/secmail/templates/icla-account-requested.erb | 13 +
 www/secmail/templates/icla-pmc-notified.erb  | 13 +
 www/secmail/views/actions/icla.json.rb   | 11 ++-
 3 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/www/secmail/templates/icla-account-requested.erb 
b/www/secmail/templates/icla-account-requested.erb
new file mode 100644
index 000..ef8d367
--- /dev/null
+++ b/www/secmail/templates/icla-account-requested.erb
@@ -0,0 +1,13 @@
+Dear <%= @pubname %>,
+
+This message acknowledges receipt of your ICLA, which has been filed in the 
Apache Software Foundation records.
+
+If you have been invited as a committer, please advise the project PMC that 
your ICLA has been filed.
+
+If you have not been invited, please refer to 
http://www.apache.org/foundation/how-it-works.html#developers
+for more information about roles at Apache.
+
+Warm Regards,
+
+<%= @sig %>
+
diff --git a/www/secmail/templates/icla-pmc-notified.erb 
b/www/secmail/templates/icla-pmc-notified.erb
new file mode 100644
index 000..ef8d367
--- /dev/null
+++ b/www/secmail/templates/icla-pmc-notified.erb
@@ -0,0 +1,13 @@
+Dear <%= @pubname %>,
+
+This message acknowledges receipt of your ICLA, which has been filed in the 
Apache Software Foundation records.
+
+If you have been invited as a committer, please advise the project PMC that 
your ICLA has been filed.
+
+If you have not been invited, please refer to 
http://www.apache.org/foundation/how-it-works.html#developers
+for more information about roles at Apache.
+
+Warm Regards,
+
+<%= @sig %>
+
diff --git a/www/secmail/views/actions/icla.json.rb 
b/www/secmail/views/actions/icla.json.rb
index 844e2eb..e5c643a 100644
--- a/www/secmail/views/actions/icla.json.rb
+++ b/www/secmail/views/actions/icla.json.rb
@@ -111,6 +111,15 @@ end
 
 # send confirmation email
 task "email #@email" do
+  # chose reply based on whether or not the project/userid info was provided
+  if @user
+reply = 'icla-account-requested.erb'
+  elsif @product
+reply = 'icla-pmc-notified.erb'
+  else
+reply = 'icla.erb'
+  end
+
   # build mail from template
   mail = message.reply(
 from: @from,
@@ -120,7 +129,7 @@ task "email #@email" do
   ("private@#{pmc.mail_list}.apache.org" if pmc), # copy pmc
   (podling.private_mail_list if podling) # copy podling
 ],
-body: template('icla.erb')
+body: template(reply)
   )
 
   # echo email

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


[whimsy] branch master updated: make liberal email parser an class method

2016-09-19 Thread rubys
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  5c2edaf   make liberal email parser an class method
5c2edaf is described below

commit 5c2edafa1f040e5b76feeb63fb723ce524be1580
Author: Sam Ruby 
AuthorDate: Mon Sep 19 12:40:53 2016 -0400

make liberal email parser an class method
---
 www/secmail/models/message.rb | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/www/secmail/models/message.rb b/www/secmail/models/message.rb
index c04f083..5215c37 100644
--- a/www/secmail/models/message.rb
+++ b/www/secmail/models/message.rb
@@ -219,7 +219,7 @@ class Message
 # process 'to' addresses on method call
 if fields[:to]
   Array(fields[:to]).compact.each do |addr|
-addr = liberal_email_parser(addr) if addr.is_a? String
+addr = Message.liberal_email_parser(addr) if addr.is_a? String
 next if to.any? {|a| a.address = addr.address}
 to << addr
   end
@@ -245,7 +245,7 @@ class Message
 
 # process 'cc' addresses from original email
 self.cc.each do |addr|
-  addr = liberal_email_parser(addr) if addr.is_a? String
+  addr = Message.liberal_email_parser(addr) if addr.is_a? String
   next if to.any? {|a| a.address == addr.address}
   cc << addr
 end
@@ -253,7 +253,7 @@ class Message
 # process 'cc' addresses on method call
 if fields[:cc]
   Array(fields[:cc]).compact.each do |addr|
-addr = liberal_email_parser(addr) if addr.is_a? String
+addr = Message.liberal_email_parser(addr) if addr.is_a? String
 next if to.any? {|a| a.address == addr.address}
 next if cc.any? {|a| a.address == addr.address}
 cc << addr
@@ -263,7 +263,7 @@ class Message
 # process 'bcc' addresses on method call
 if fields[:bcc]
   Array(fields[:bcc]).compact.each do |addr|
-addr = liberal_email_parser(addr) if addr.is_a? String
+addr = Message.liberal_email_parser(addr) if addr.is_a? String
 next if to.any? {|a| a.address == addr.address}
 next if cc.any? {|a| a.address == addr.address}
 next if bcc.any? {|a| a.address == addr.address}
@@ -297,7 +297,7 @@ class Message
 begin
   from = liberal_email_parser(mail[:from].value).display_name
 rescue Exception
-  from = mail[:from].value
+  from = mail[:from].value.sub(/\s+<.*?>$/)
 end
 
 # determine who should be copied on any responses
@@ -367,10 +367,8 @@ class Message
 headers
   end
 
-private
-
   # see https://github.com/mikel/mail/issues/39
-  def liberal_email_parser(addr)
+  def self.liberal_email_parser(addr)
 addr = Mail::Address.new(addr)
   rescue Mail::Field::ParseError
 if addr =~ /^"([^"]*)" <(.*)>$/

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


[whimsy] branch master updated: bump wunderbar; add escape

2016-09-19 Thread rubys
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  55f8548   bump wunderbar; add escape
55f8548 is described below

commit 55f8548b2aa9a140ccac15a55ba416aa304decbd
Author: Sam Ruby 
AuthorDate: Mon Sep 19 11:25:50 2016 -0400

bump wunderbar; add escape
---
 www/secmail/Gemfile   | 3 ++-
 www/secmail/server.rb | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/www/secmail/Gemfile b/www/secmail/Gemfile
index 35b1b8f..ec4b3eb 100644
--- a/www/secmail/Gemfile
+++ b/www/secmail/Gemfile
@@ -16,10 +16,11 @@ gem 'rake'
 gem 'zip'
 gem 'sinatra', '~> 1.4'
 gem 'sanitize'
-gem 'wunderbar', '~> 1.0.26'
+gem 'wunderbar', '~> 1.0.27'
 gem 'ruby2js', '~> 2.0.12'
 gem 'execjs'
 gem 'listen', ('~> 3.0.7' if RUBY_VERSION =~ /^2\.[01]/)
+gem 'escape'
 
 group :demo do
   gem 'puma'
diff --git a/www/secmail/server.rb b/www/secmail/server.rb
index e1af792..03f9221 100644
--- a/www/secmail/server.rb
+++ b/www/secmail/server.rb
@@ -9,6 +9,7 @@ require 'ruby2js/filter/functions'
 require 'ruby2js/filter/require'
 require 'erb'
 require 'sanitize'
+require 'escape'
 
 require_relative 'personalize'
 require_relative 'helpers'

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


[whimsy] branch master updated: show name in index view

2016-09-19 Thread rubys
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  58a024e   show name in index view
58a024e is described below

commit 58a024ed42bf56d7ce270a226b16459f18267780
Author: Sam Ruby 
AuthorDate: Mon Sep 19 06:16:30 2016 -0400

show name in index view
---
 www/secmail/models/mailbox.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/secmail/models/mailbox.rb b/www/secmail/models/mailbox.rb
index aa3c595..8873651 100644
--- a/www/secmail/models/mailbox.rb
+++ b/www/secmail/models/mailbox.rb
@@ -164,7 +164,7 @@ class Mailbox
   {
 time: message[:time],
 href: "#{message[:source]}/#{id}/",
-from: message[:from],
+from: message[:name] || message[:from],
 subject: message['Subject'],
 status: message[:status]
   }

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


[whimsy] 01/02: unlock input if there was a parsing error

2016-09-19 Thread rubys
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

commit 0e0683e23c6e6d2663728e0594a4ded6e4d27426
Author: Sam Ruby 
AuthorDate: Mon Sep 19 05:57:31 2016 -0400

unlock input if there was a parsing error
---
 www/secmail/views/tasklist.html.rb | 4 
 1 file changed, 4 insertions(+)

diff --git a/www/secmail/views/tasklist.html.rb 
b/www/secmail/views/tasklist.html.rb
index a2eba2b..89e0227 100644
--- a/www/secmail/views/tasklist.html.rb
+++ b/www/secmail/views/tasklist.html.rb
@@ -6,6 +6,10 @@ _html do
 _h2.bg_danger @dryrun['exception']
 _pre @dryrun['backtrace'].join("\n")
 
+_script %{
+  var message = {status: 'warning'}
+  window.parent.frames[0].postMessage(message, '*')
+}
   else
 
 _h1.bg_warning 'Operations to be performed'

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


[whimsy] 02/02: add liberal email parser

2016-09-19 Thread rubys
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

commit 4097b184adec9e865c39a6e912a1dad4b916cc03
Author: Sam Ruby 
AuthorDate: Mon Sep 19 06:03:29 2016 -0400

add liberal email parser
---
 www/secmail/models/message.rb | 33 +++--
 1 file changed, 27 insertions(+), 6 deletions(-)

diff --git a/www/secmail/models/message.rb b/www/secmail/models/message.rb
index 14a7958..c04f083 100644
--- a/www/secmail/models/message.rb
+++ b/www/secmail/models/message.rb
@@ -219,7 +219,7 @@ class Message
 # process 'to' addresses on method call
 if fields[:to]
   Array(fields[:to]).compact.each do |addr|
-addr = Mail::Address.new(addr) if addr.is_a? String
+addr = liberal_email_parser(addr) if addr.is_a? String
 next if to.any? {|a| a.address = addr.address}
 to << addr
   end
@@ -245,7 +245,7 @@ class Message
 
 # process 'cc' addresses from original email
 self.cc.each do |addr|
-  addr = Mail::Address.new(addr) if addr.is_a? String
+  addr = liberal_email_parser(addr) if addr.is_a? String
   next if to.any? {|a| a.address == addr.address}
   cc << addr
 end
@@ -253,7 +253,7 @@ class Message
 # process 'cc' addresses on method call
 if fields[:cc]
   Array(fields[:cc]).compact.each do |addr|
-addr = Mail::Address.new(addr) if addr.is_a? String
+addr = liberal_email_parser(addr) if addr.is_a? String
 next if to.any? {|a| a.address == addr.address}
 next if cc.any? {|a| a.address == addr.address}
 cc << addr
@@ -263,7 +263,7 @@ class Message
 # process 'bcc' addresses on method call
 if fields[:bcc]
   Array(fields[:bcc]).compact.each do |addr|
-addr = Mail::Address.new(addr) if addr.is_a? String
+addr = liberal_email_parser(addr) if addr.is_a? String
 next if to.any? {|a| a.address == addr.address}
 next if cc.any? {|a| a.address == addr.address}
 next if bcc.any? {|a| a.address == addr.address}
@@ -295,7 +295,7 @@ class Message
 
 # parse from address
 begin
-  from = Mail::Address.new(mail[:from].value).display_name
+  from = liberal_email_parser(mail[:from].value).display_name
 rescue Exception
   from = mail[:from].value
 end
@@ -314,7 +314,7 @@ class Message
 # remove secretary and anybody on the to field from the cc list
 cc.reject! do |email|
   begin
-address = Mail::Address.new(email).address
+address = liberal_email_parser(email).address
 next true if address == 'secret...@apache.org'
 next true if mail.from_addrs.include? address
   rescue Exception
@@ -366,4 +366,25 @@ class Message
 
 headers
   end
+
+private
+
+  # see https://github.com/mikel/mail/issues/39
+  def liberal_email_parser(addr)
+addr = Mail::Address.new(addr)
+  rescue Mail::Field::ParseError
+if addr =~ /^"([^"]*)" <(.*)>$/
+  addr = Mail::Address.new
+  addr.address = $2
+  addr.display_name = $1
+elsif addr =~ /^([^"]*) <(.*)>$/
+  addr = Mail::Address.new
+  addr.address = $2
+  addr.display_name = $1
+else
+  raise
+end
+
+return addr
+  end
 end

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