Sha256: 29a0c66e2d457b1507d7b436ea2091a56855e213435351e676b9116b7e35588c

Contents?: true

Size: 638 Bytes

Versions: 7

Compression:

Stored size: 638 Bytes

Contents

module PrePush
	class ArgsParser
		class << self
			attr_accessor :args_props
			ArgsParser.args_props = {
				'r' => [:runner, :str], 
				'td' => [:test_dlls, :array], 
				'msb' => [:msbuild, :str]
			}
		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

7 entries across 7 versions & 1 rubygems

Version Path
pre_push-1.1.2.1 lib/args_parser.rb
pre_push-1.1.2 lib/args_parser.rb
pre_push-1.1.1 lib/args_parser.rb
pre_push-1.1.0 lib/args_parser.rb
pre_push-1.0.1 lib/args_parser.rb
pre_push-1.0.0 lib/args_parser.rb
pre_push-0.0.7 lib/args_parser.rb