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 2018/07/06 09:45:31 UTC
[whimsy] branch master updated: No need to use global variable here
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 8f602e9 No need to use global variable here
8f602e9 is described below
commit 8f602e9e70ed135914d431795116959017ad9bd9
Author: Sebb <se...@apache.org>
AuthorDate: Fri Jul 6 10:45:30 2018 +0100
No need to use global variable here
---
www/project/icla/views/actions/update.json.rb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/www/project/icla/views/actions/update.json.rb b/www/project/icla/views/actions/update.json.rb
index 8345859..50c6d32 100644
--- a/www/project/icla/views/actions/update.json.rb
+++ b/www/project/icla/views/actions/update.json.rb
@@ -201,11 +201,11 @@ end
if __FILE__ == $0 # Allow independent testing
require 'whimsy/asf'
require 'mail'
- $ret = {}
+ ret = {}
# method_missing caused some errors to be overlooked
%w{backtrace body_text error contents rewrite}.each do |n|
define_method("_#{n}") do |a|
- $ret[n] = a
+ ret[n] = a
end
end
data = Hash[*ARGV] # cannot combine this with next line as hash doesn't yet exist
@@ -214,10 +214,10 @@ if __FILE__ == $0 # Allow independent testing
if data['action'] == 'sendTally' # special for testing stand-alone
contents = JSON.parse(File.read("/srv/icla/#{data['token']}.json"))
sendTally(data, contents)
- puts $ret['body_text']
+ puts ret['body_text']
else
main(data)
- puts JSON.pretty_generate($ret) # output the return data
+ puts JSON.pretty_generate(ret) # output the return data
end
else
embed # Sinatra sets params