summaryrefslogtreecommitdiff
path: root/lib/custodian/parser.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-03-09 13:08:33 +0000
committerSteve Kemp <steve@steve.org.uk>2015-03-09 13:08:33 +0000
commit3a96cc957dbd97c6ffeaea42f738e7c35b4acbc7 (patch)
tree1a709ddc989f52f065b681e0ee80265c31647ca4 /lib/custodian/parser.rb
parentd0f94ecdf76f1a3ff9e2d0e5c0f654c2089561cd (diff)
Avoid "Array.new" and "Hash.new"
Instead use {} + ().
Diffstat (limited to 'lib/custodian/parser.rb')
-rw-r--r--lib/custodian/parser.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/custodian/parser.rb b/lib/custodian/parser.rb
index e73001f..0bafd47 100644
--- a/lib/custodian/parser.rb
+++ b/lib/custodian/parser.rb
@@ -53,8 +53,8 @@ module Custodian
# Constructor
#
def initialize
- @MACROS = Hash.new()
- @jobs = Array.new()
+ @MACROS = {}
+ @jobs = []
end
@@ -119,7 +119,7 @@ module Custodian
#
def define_macro( line )
name = nil
- val = Array.new
+ val = []
#
# Get the name of the macro.
@@ -212,7 +212,7 @@ module Custodian
#
def expand_macro( input )
- r = Array.new()
+ r = []
if ( input =~ /^(\S+)\s+(.*)$/ )
macro=$1.dup
@@ -320,7 +320,7 @@ module Custodian
#
# The array of objects we will return to the caller.
#
- ret = Array.new()
+ ret = []
#
# For each host in our possibly-macro-expanded list: