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
commit22b40326730fb7a4a8e2f5cb8d877f6a84494d02 (patch)
treec08f5ade5267c79cf3929bccc75dd4b704717500 /lib/custodian/parser.rb
parent5cc24f3a9a25a4214f1ee85a24960cce9f4f9516 (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: