lib/trac-wiki/env.rb in trac-wiki-0.3.31 vs lib/trac-wiki/env.rb in trac-wiki-0.3.32
- old
+ new
@@ -99,12 +99,12 @@
def arg_count
@env[:cmd_args].size
end
- def arg(idx)
- @env[:cmd_args][idx] || ''
+ def arg(idx, default = nil)
+ @env[:cmd_args][idx] || default || ''
end
def prepare_y
#print "prepare_y\n"
return if @env.key? 'y'
@@ -263,11 +263,11 @@
return ''
"UVAR(#{var_name}|#{@env['arg']})"
end
# template expand
- def expand_arg(idx)
- expand(arg(idx))
+ def expand_arg(idx, default = nil)
+ expand(arg(idx, default))
end
def pp_env
pp(@env)
end