lib/beaker/options/parser.rb
# Normalizes argument into an Array.  Argument can either be converted into an array of a single value,
# or can become an array of multiple values by splitting arg over ','.  If argument is already an
# array that array is returned untouched.
# @example
#   split_arg([1, 2, 3]) == [1, 2, 3]
#   split_arg(1) == [1]
#   split_arg("1,2") == ["1", "2"]
#   split_arg(nil) == []
# @param [Array, String] arg Either an array or a string to be split into an array
# @return [Array] An array of the form arg, [arg], or arg.split(',')
Normalizes argument into an Array.  Argument can either be converted into an array of a single value,
or can become an array of multiple values by splitting arg over ','.  If argument is already an
array that array is returned untouched.
Normalizes argument into an Array . Argument can either be converted into an array of a single value or can become an array of multiple values by splitting arg over ' ' . If argument is already an array that array is returned untouched .
def split_arg arg
        arry = []
        if arg.is_a?(Array)
          arry += arg
        elsif arg =~ /,/
          arry += arg.split(',')
        else
          arry << arg
        end
        arry
      end
def split_arg arg arry = [ ] if arg . is_a? ( Array ) arry += arg elsif arg =~ / , / arry += arg . split ( ',' ) else arry << arg end arry end
Normalizes argument into an Array.
Normalizes argument into an Array .
An array of the form arg, [arg], or arg.split(',')
An array of the form arg [ arg ] or arg . split ( ' ' )
Array
arg
<not_specific>
<not_specific>
arg Either an array or a string to be split into an array
arg Either an array or a string to be split into an array
example
None