8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/cucumber/formatter/curl_option_parser.rb', line 8
def self.parse(options)
args = Shellwords.split(options)
url = nil
http_method = 'PUT'
= {}
until args.empty?
arg = args.shift
case arg
when '-X', '--request'
http_method = remove_arg_for(args, arg)
when '-H'
= remove_arg_for(args, arg)
= .merge(())
else
raise StandardError, "#{options} was not a valid curl command. Can't set url to #{arg} it is already set to #{url}" if url
url = arg
end
end
raise StandardError, "#{options} was not a valid curl command" unless url
[url, http_method, ]
end
|