mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
feature #661: Add unindent functionality
This commit is contained in:
parent
f9583e415b
commit
5eeb0a7541
@ -17,6 +17,17 @@
|
||||
require 'optparse'
|
||||
require 'pp'
|
||||
|
||||
class String
|
||||
def unindent(spaces=nil)
|
||||
unless spaces
|
||||
m = self.match(/^(\s*)/)
|
||||
spaces = m[1].size
|
||||
end
|
||||
|
||||
self.gsub!(/^ {#{spaces}}/, '')
|
||||
end
|
||||
end
|
||||
|
||||
module CommandParser
|
||||
OPTIONS = [
|
||||
VERBOSE={
|
||||
|
Loading…
x
Reference in New Issue
Block a user