Faidon Liambotis has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/403697 )
Change subject: Remove utils/expanderb.rb
......................................................................
Remove utils/expanderb.rb
Doesn't seem to be functional, and that in turn doesn't seem to have
been detected by anyone, so we might just as well kill it.
Change-Id: I3a62f7d901e88527230922d4dc4ca92eb8fdc93a
---
D utils/expanderb.rb
1 file changed, 0 insertions(+), 70 deletions(-)
Approvals:
Faidon Liambotis: Looks good to me, approved
Hashar: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/utils/expanderb.rb b/utils/expanderb.rb
deleted file mode 100755
index 8fdfed2..0000000
--- a/utils/expanderb.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This script let you expand an ERB template from the command line
-# while optionally passing variables that will be expanded in the
-# template.
-#
-# Joint copyright:
-# Copyright 2012, Antoine "hashar" Musso
-# Copyright 2012, Wikimedia Foundation
-
-# Command line option parsing library
-require 'optparse'
-require 'erb'
-require 'ostruct'
-require 'English'
-
-# Filename of the ERB template we are going to expand
-filename = nil
-
-# Parsing the options
-optparse = OptionParser.new do |opts|
- opts.banner = "Usage: expanderb.rb -f FILENAME [key=val [key2=val]]"
-
- opts.on('-f', '--filename FILENAME', 'ERB filename to expand') do |f|
- filename = f
- end
-
- opts.on_tail('-h', '--help', 'Show this message') do
- puts opts
- exit
- end
-end
-
-# Parse command line options.
-begin
- # -f is mandatory
- optparse.parse!
- if filename.nil?
- puts "You must specify an ERB filename."
- puts optparse
- exit
- end
-rescue
- # Catch all
- puts $ERROR_INFO.to_s
- puts optparse
- exit
-end
-
-template_values = {}
-ARGV.each do |val|
- key, value = val.split('=')
- template_values[key] = value
-end
-p template_values
-
-def render_erb(template, locals)
- # Make sure we can render templates with -%> closing tags.
- # Note that this does not actually remove newlines after -%>, it just
- # avoids a syntax error.
- ERB.new(template, nil, '%<>-').result(OpenStruct.new(locals).instance_eval {
binding })
-end
-
-# Parse template
-begin
- puts render_erb(File.read(filename), template_values)
-rescue
- p "Something went wrong, usually because you are missing a variable."
- p $ERROR_INFO.to_s
-end
--
To view, visit https://gerrit.wikimedia.org/r/403697
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3a62f7d901e88527230922d4dc4ca92eb8fdc93a
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits