[MediaWiki-commits] [Gerrit] operations/puppet[production]: utils/expanderrb.rb: fix Style/SpecialGlobalVars

2018-01-09 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/359483 )

Change subject: utils/expanderrb.rb: fix Style/SpecialGlobalVars
..


utils/expanderrb.rb: fix Style/SpecialGlobalVars

Change-Id: I52960ceacad36e5f2d3ced92e7ec67ac3a9d9213
---
M .rubocop_todo.yml
M utils/expanderb.rb
2 files changed, 3 insertions(+), 6 deletions(-)

Approvals:
  Giuseppe Lavagetto: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index c39ac895..03bb06f 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -36,10 +36,6 @@
 Layout/SpaceInsideHashLiteralBraces:
   Enabled: false
 
-Style/SpecialGlobalVars:
-  Exclude:
-- 'utils/expanderb.rb'
-
 Style/StringLiterals:
   Enabled: false
 
diff --git a/utils/expanderb.rb b/utils/expanderb.rb
index 431c26a..cb2882f 100755
--- a/utils/expanderb.rb
+++ b/utils/expanderb.rb
@@ -12,6 +12,7 @@
 require 'optparse'
 require 'erb'
 require 'ostruct'
+require 'English'
 
 # Filename of the ERB template we are going to expand
 $filename = nil
@@ -41,7 +42,7 @@
   end
 rescue
   # Catch all
-  puts $!.to_s
+  puts $ERROR_INFO.to_s
   puts optparse
   exit
 end
@@ -65,5 +66,5 @@
   puts render_erb(File.read($filename), template_values)
 rescue
   p "Something went wrong, usually because you are missing a variable."
-  p $!.to_s
+  p $ERROR_INFO.to_s
 end

-- 
To view, visit https://gerrit.wikimedia.org/r/359483
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I52960ceacad36e5f2d3ced92e7ec67ac3a9d9213
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis 
Gerrit-Reviewer: Giuseppe Lavagetto 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: utils/expanderrb.rb: fix Style/SpecialGlobalVars

2017-06-16 Thread Faidon Liambotis (Code Review)
Faidon Liambotis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/359483 )

Change subject: utils/expanderrb.rb: fix Style/SpecialGlobalVars
..

utils/expanderrb.rb: fix Style/SpecialGlobalVars

Change-Id: I52960ceacad36e5f2d3ced92e7ec67ac3a9d9213
---
M .rubocop_todo.yml
M utils/expanderb.rb
2 files changed, 3 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/83/359483/1

diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 55ed8ad..9d968c5 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -40,10 +40,6 @@
 Layout/SpaceInsideHashLiteralBraces:
   Enabled: false
 
-Style/SpecialGlobalVars:
-  Exclude:
-- 'utils/expanderb.rb'
-
 Style/StringLiterals:
   Enabled: false
 
diff --git a/utils/expanderb.rb b/utils/expanderb.rb
index 431c26a..cb2882f 100755
--- a/utils/expanderb.rb
+++ b/utils/expanderb.rb
@@ -12,6 +12,7 @@
 require 'optparse'
 require 'erb'
 require 'ostruct'
+require 'English'
 
 # Filename of the ERB template we are going to expand
 $filename = nil
@@ -41,7 +42,7 @@
   end
 rescue
   # Catch all
-  puts $!.to_s
+  puts $ERROR_INFO.to_s
   puts optparse
   exit
 end
@@ -65,5 +66,5 @@
   puts render_erb(File.read($filename), template_values)
 rescue
   p "Something went wrong, usually because you are missing a variable."
-  p $!.to_s
+  p $ERROR_INFO.to_s
 end

-- 
To view, visit https://gerrit.wikimedia.org/r/359483
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I52960ceacad36e5f2d3ced92e7ec67ac3a9d9213
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits