Sha256: 85445f50b33f46122278f9188619bdaf2baf46f0794de781e1efbeb661a10c1b

Contents?: true

Size: 388 Bytes

Versions: 5

Compression:

Stored size: 388 Bytes

Contents

# coding: utf-8
#

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


Version data entries

5 entries across 5 versions & 1 rubygems

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