Class Array
In: lib/facets/standard/facets/shellwords.rb
lib/facets/standard/facets/random.rb
lib/facets/standard/facets/set.rb
Parent: Object

Methods

Included Modules

Random::ArrayExtensions

Public Instance methods

[Source]

# File lib/facets/standard/facets/set.rb, line 20
  def power_set
    if empty?
      [self]
    else
      subset  = dup
      value   = [ subset.pop ]
      subsubs = subset.power_set
      subsubs.concat( subsubs.map{ |subset| subset + value } )
    end
  end

[Source]

# File lib/facets/standard/facets/shellwords.rb, line 78
  def shelljoin
    Shellwords.shelljoin(shellwords)
  end

Convert an array into command line parameters. The array is accepted in the format of Ruby method arguments —ie. [arg1, arg2, …, hash]

[Source]

# File lib/facets/standard/facets/shellwords.rb, line 71
  def shellwords
    opts, args = *flatten.partition{ |e| Hash === e }
    opts = opts.inject({}){ |m,h| m.update(h); m }
    opts.shellwords + args
  end

[Validate]