cucumber 5.1.2 → 5.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 598a3fa7056ad50b328b396a020ed24474ff407d94b32a5114802172c3c843cf
4
- data.tar.gz: d878d4b8b001459334db9c986a8baf8e81eb9fce3df3e40940f7ebaca6623e11
3
+ metadata.gz: 3e1477c70b949106c7f0a7f30f5b387cfa8a86ed41180d791d3bed792dde0c38
4
+ data.tar.gz: d0aa04c7c51cd100d2419684f4b7e8c4d245a68567588fe6cf5e1e4c2a301ac6
5
5
  SHA512:
6
- metadata.gz: b68a1ed62878cb122ed3acb8cae0eee8c582392e7e8ed1c5ef4bf5fd10e5785a7c87da57f1fc447c035e3015e7d8f09e70142c2260706715d46b67d7f7603cfc
7
- data.tar.gz: a3e74329a7f23150cbaaae08c17fc339e86065447fc861ef7826725c98bf447e5e6144143cc4954d2ceb2835f0a41edd09d3ec44929d70101235084a065d9d9e
6
+ metadata.gz: 4d32e30dca15261c3f1aca9e0393c7a75ef2d044cae7bd209861a0d32580dc3ba59fc334269a6fe66fd29c792041552806c2fb3670670586c3cf27bf969795aa
7
+ data.tar.gz: a17f70e4b4731c13b700be8e2ff3a9c8e97e8075531938a351d9a9df711fbbd1a1911f88903953e9c387079767b3efb9cfe647a0e3c658aca7be3ac9a70b444d
@@ -10,7 +10,7 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
10
10
 
11
11
  ----
12
12
 
13
- ## [In GIT](https://github.com/cucumber/cucumber-ruby/compare/v5.1.2...master)
13
+ ## [In GIT](https://github.com/cucumber/cucumber-ruby/compare/v5.1.3...master)
14
14
 
15
15
  ### Added
16
16
 
@@ -24,6 +24,12 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
24
24
 
25
25
  ### Security fixes
26
26
 
27
+ ## [In GIT](https://github.com/cucumber/cucumber-ruby/compare/v5.1.2...v5.1.3)
28
+
29
+ ### Fixed
30
+
31
+ * The `CUCUMBER_PUBLISH_TOKEN` now sets the correct HTTP header, following a fix in the curl option parser.
32
+
27
33
  ## [5.1.2](https://github.com/cucumber/cucumber-ruby/compare/v5.1.1...v5.1.2)
28
34
 
29
35
  ### Fixed
@@ -1,5 +1,6 @@
1
1
  require 'net/http'
2
2
  require 'tempfile'
3
+ require 'shellwords'
3
4
 
4
5
  module Cucumber
5
6
  module Formatter
@@ -18,48 +19,43 @@ module Cucumber
18
19
 
19
20
  class CurlOptionParser
20
21
  def self.parse(options)
21
- chunks = options.split(/\s/).compact
22
- http_method = 'PUT'
23
- url = chunks[0]
24
- headers = ''
25
-
26
- last_flag = nil
27
- chunks.each do |chunk|
28
- if ['-X', '--request'].include?(chunk)
29
- last_flag = '-X'
30
- next
31
- end
22
+ args = Shellwords.split(options)
32
23
 
33
- if chunk == '-H'
34
- last_flag = '-H'
35
- next
36
- end
37
-
38
- if last_flag == '-X'
39
- http_method = chunk
40
- last_flag = nil
24
+ url = nil
25
+ http_method = 'PUT'
26
+ headers = {}
27
+
28
+ until args.empty?
29
+ arg = args.shift
30
+ case arg
31
+ when '-X', '--request'
32
+ http_method = remove_arg_for(args, arg)
33
+ when '-H'
34
+ header_arg = remove_arg_for(args, arg)
35
+ headers = headers.merge(parse_header(header_arg))
36
+ else
37
+ raise StandardError, "#{options} was not a valid curl command. Can't set url to #{arg} it is already set to #{url}" if url
38
+ url = arg
41
39
  end
42
-
43
- headers += chunk if last_flag == '-H'
44
40
  end
41
+ raise StandardError, "#{options} was not a valid curl command" unless url
45
42
 
46
43
  [
47
44
  url,
48
45
  http_method,
49
- make_headers(headers)
46
+ headers
50
47
  ]
51
48
  end
52
49
 
53
- def self.make_headers(headers)
54
- hash_headers = {}
55
- str_scanner = /("(?<key>[^":]+)\s*:\s*(?<value>[^":]+)")|('(?<key1>[^':]+)\s*:\s*(?<value1>[^':]+)')/
56
-
57
- headers.scan(str_scanner) do |header|
58
- header = header.compact!
59
- hash_headers[header[0]] = header[1]&.strip
60
- end
50
+ def self.remove_arg_for(args, arg)
51
+ return args.shift unless args.empty?
52
+ raise StandardError, "Missing argument for #{arg}"
53
+ end
61
54
 
62
- hash_headers
55
+ def self.parse_header(header_arg)
56
+ parts = header_arg.split(':', 2)
57
+ raise StandardError, "#{header_arg} was not a valid header" unless parts.length == 2
58
+ { parts[0].strip => parts[1].strip }
63
59
  end
64
60
  end
65
61
 
@@ -137,4 +137,4 @@ module Cucumber
137
137
  end
138
138
 
139
139
  # TODO: can we avoid adding methods to the global namespace (Kernel)
140
- extend(Cucumber::Glue::Dsl) # rubocop:disable Style/MixinUsage
140
+ extend(Cucumber::Glue::Dsl)
@@ -1 +1 @@
1
- 5.1.2
1
+ 5.1.3
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.2
4
+ version: 5.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aslak Hellesøy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-09-18 00:00:00.000000000 Z
13
+ date: 2020-10-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: builder
@@ -381,7 +381,7 @@ dependencies:
381
381
  version: '1.6'
382
382
  - - ">="
383
383
  - !ruby/object:Gem::Version
384
- version: 1.6.0
384
+ version: 1.6.1
385
385
  type: :development
386
386
  prerelease: false
387
387
  version_requirements: !ruby/object:Gem::Requirement
@@ -391,7 +391,7 @@ dependencies:
391
391
  version: '1.6'
392
392
  - - ">="
393
393
  - !ruby/object:Gem::Version
394
- version: 1.6.0
394
+ version: 1.6.1
395
395
  - !ruby/object:Gem::Dependency
396
396
  name: octokit
397
397
  requirement: !ruby/object:Gem::Requirement
@@ -642,5 +642,5 @@ requirements: []
642
642
  rubygems_version: 3.1.2
643
643
  signing_key:
644
644
  specification_version: 4
645
- summary: cucumber-5.1.2
645
+ summary: cucumber-5.1.3
646
646
  test_files: []