cucumber-messages 21.0.1 → 23.0.0

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: 8d775ee31d595dd6b7c67a8d6c98a84d18d6815c433b96aff25594c3cdcdd9f3
4
- data.tar.gz: 79b5a45328fd019745e0d1fa5ce87c6df334956d5b9e8eb24a93e2ef7c0661a2
3
+ metadata.gz: f3e34f0e901f03d378d86cfde3105013175abb51fae73ae3e8f35ee7289a2630
4
+ data.tar.gz: 2c6aa8f4cc28c3efe0de69adc5968327a3018042150b57a37b07acec4f798877
5
5
  SHA512:
6
- metadata.gz: d1ec82690ee4b3ada7e575f5ff2dd0fb2923e95647fdb3c1960666daaac919252d4fb796a01814f1fee8250a1654d057e5ab220b9483b4d2cc398723cc648b80
7
- data.tar.gz: 2843fa5bf6ecb13b8ec138076e563ee34bb619c2bf8fd02704357ecf37346ed38c4deb8b8fe78748d739a6dacb10dc1772356fe78a691020ac2733177cbea0d1
6
+ metadata.gz: 93211c9531aa658053848dd09d2f444b008c20b7d3ca8fd50b12e326739d50e9d695df81659c34fe5bb7bbb5848a5de7d2f36cde2133bef3a9b5343a9a58b467
7
+ data.tar.gz: 6134322a493e06050b0080abf3236d8a49665e34d83eda3a9ed8ca40ef0001339e5f34811d6f57a1dec70906a29bc39f0cefd0cba7a0ebd002788dd6593d2450
data/README.md CHANGED
@@ -1,2 +1,3 @@
1
1
  # Cucumber Messages for Ruby (JSON schema)
2
2
 
3
+ See main [README](../README.md)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 21.0.1
1
+ 23.0.0
@@ -12,7 +12,6 @@ module Cucumber
12
12
  end
13
13
 
14
14
  module ClassMethods
15
-
16
15
  ##
17
16
  # Returns a new Message - or messages into an array - deserialized from the given json document.
18
17
  # CamelCased keys are properly converted to snake_cased attributes in the process
@@ -27,8 +26,7 @@ module Cucumber
27
26
  #
28
27
  # json_string = { uri: 'file:///...', comments: [{text: 'text comment'}, {text: 'another comment'}]}.to_json
29
28
  # Cucumber::Messages::GherkinDocument.from_json(json_string) # => #<Cucumber::Messages::GherkinDocument:0x00007efda11e6a90 ... @comments=[#<Cucumber::Messages::Comment:0x00007efda11e6e50 ..., #<Cucumber::Messages::Comment:0x00007efda11e6b58 ...>]>
30
- #
31
-
29
+ ##
32
30
  def from_json(json_string)
33
31
  from_h(JSON.parse(json_string, { symbolize_names: true }))
34
32
  end
@@ -36,4 +34,4 @@ module Cucumber
36
34
  end
37
35
  end
38
36
  end
39
- end
37
+ end
@@ -7,7 +7,6 @@ module Cucumber
7
7
  include Cucumber::Messages::Message::Utils
8
8
 
9
9
  module Serialization
10
-
11
10
  ##
12
11
  # Returns a new Hash formed from the message attributes
13
12
  # If +camelize:+ keyword parameter is set to true, then keys will be camelized
@@ -21,8 +20,7 @@ module Cucumber
21
20
  #
22
21
  # location = Cucumber::Messages::Location.new(line: 2)
23
22
  # Cucumber::Messages::Comment.new(location: location, text: 'comment').to_h # => { location: { line: 2, :column: nil }, text: "comment" }
24
- #
25
-
23
+ ##
26
24
  def to_h(camelize: false, reject_nil_values: false)
27
25
  resulting_hash = self.instance_variables.map do |variable_name|
28
26
  h_key = variable_name[1..-1]
@@ -53,8 +51,7 @@ module Cucumber
53
51
  #
54
52
  # location = Cucumber::Messages::Location.new(line: 2)
55
53
  # Cucumber::Messages::Comment.new(location: location, text: 'comment').to_json # => '{"location":{"line":2,"column":null},"text":"comment"}'
56
- #
57
-
54
+ ##
58
55
  def to_json
59
56
  to_h(camelize: true, reject_nil_values: true).to_json
60
57
  end
@@ -7,7 +7,6 @@ module Cucumber
7
7
  end
8
8
 
9
9
  module ClassMethods
10
-
11
10
  ##
12
11
  # Makes an underscored, lowercase form from the expression in the string.
13
12
  #
@@ -15,7 +14,7 @@ module Cucumber
15
14
  #
16
15
  # This is a simplified version of the Ruby on Rails implementation
17
16
  # https://github.com/rails/rails/blob/v6.1.3.2/activesupport/lib/active_support/inflector/methods.rb#L92
18
-
17
+ ##
19
18
  def underscore(term)
20
19
  return term unless /[A-Z-]/.match?(term)
21
20
 
@@ -33,7 +32,7 @@ module Cucumber
33
32
  #
34
33
  # This is a simplified version of the Ruby on Rails implementation
35
34
  # https://github.com/rails/rails/blob/v6.1.3.2/activesupport/lib/active_support/inflector/methods.rb#L69
36
-
35
+ ##
37
36
  def camelize(term)
38
37
  camelized = term.to_s
39
38
  camelized.gsub!(/(?:_|(\/))([a-z\d]*)/i) { "#{$1}#{$2.capitalize}" }
@@ -43,4 +42,4 @@ module Cucumber
43
42
  end
44
43
  end
45
44
  end
46
- end
45
+ end
@@ -8,4 +8,4 @@ module Cucumber
8
8
  include Cucumber::Messages::Message::Serialization
9
9
  end
10
10
  end
11
- end
11
+ end
@@ -594,6 +594,7 @@ module Cucumber
594
594
  prefer_for_regular_expression_match: hash[:preferForRegularExpressionMatch],
595
595
  use_for_snippets: hash[:useForSnippets],
596
596
  id: hash[:id],
597
+ source_reference: SourceReference.from_h(hash[:sourceReference]),
597
598
  )
598
599
  end
599
600
  end