Sha256: b0c78bf4a8367de8d34ff4c0b9c7913c279959642d95c581d7e44857d11b4e3a

Contents?: true

Size: 357 Bytes

Versions: 6

Compression:

Stored size: 357 Bytes

Contents

class Array 
  
  ##
  # Split +string+ into an array. 
  #
  # === Highline example:
  #  
  #   # ask invokes Array#parse
  #   list = ask 'Favorite cookies:', Array
  #
  
  def self.parse string
    string.split
  end
  
  ##
  # Delete switches such as -h or --help.
  
  def delete_switches
    self.dup.delete_if { |v| v.to_s =~ /^-/ } 
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
visionmedia-commander-2.4.2 lib/commander/core_ext/array.rb
visionmedia-commander-2.4.3 lib/commander/core_ext/array.rb
visionmedia-commander-2.4.4 lib/commander/core_ext/array.rb
visionmedia-commander-2.4.6 lib/commander/core_ext/array.rb
visionmedia-commander-2.5.6 lib/commander/core_ext/array.rb
visionmedia-commander-2.5.7 lib/commander/core_ext/array.rb