Sha256: 2c6c830f3d85836ff556f45f359bd669b7484882b3e66b1e4dc54bf2d3835332
Contents?: true
Size: 588 Bytes
Versions: 2
Compression:
Stored size: 588 Bytes
Contents
module PrePush class ArgsParser class << self attr_accessor :args_props ArgsParser.args_props = {'r' => [:runner, :str], 'td' => [:test_dlls, :array]} end def self.execute args result = {:runner => 'nunit262'} return result if args == nil args_props.each_pair do |arg, prop| current_parsed_arg = args.find {|a| a.start_with?("/#{arg}=")} if current_parsed_arg != nil value = current_parsed_arg.sub("/#{arg}=", "") value = value.split(',') if prop[1] == :array result[prop[0]] = value end end result end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
pre_push-0.0.6 | lib/args_parser.rb |
pre_push-0.0.5 | lib/args_parser.rb |