Sha256: 0c477568b309ad92ee3291deb1a2e4a6c5a4ad1769353526e2e5ff1299a2ca8b

Contents?: true

Size: 320 Bytes

Versions: 5

Compression:

Stored size: 320 Bytes

Contents

# coding: utf-8
#

module Githelp
  def args(argv=ARGV)
    a = []
    argv.each { |arg|
      if arg =~ /^(\d+)([^\d]+)?$/ then
        a << $1
        a << $2 if $2.to_s != ''
      else
        a << arg.sub(/^['"]/,'').sub(/['"]$/,'').sub('「','').sub('」','')
      end
    }
    a.length > 0 ? a : ['']
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
githelp-0.1.4 lib/githelp/args.rb
githelp-0.1.3 lib/githelp/args.rb
githelp-0.1.2 lib/githelp/args.rb
githelp-0.1.1 lib/githelp/args.rb
githelp-0.1.0 lib/githelp/args.rb