cucumber-messages 22.0.0 → 23.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/VERSION +1 -1
- data/lib/cucumber/messages/message/deserialization.rb +2 -4
- data/lib/cucumber/messages/message/serialization.rb +2 -5
- data/lib/cucumber/messages/message/utils.rb +3 -4
- data/lib/cucumber/messages/message.rb +1 -1
- data/lib/cucumber/messages.dtos.rb +132 -357
- metadata +36 -22
- data/spec/capture_warnings.rb +0 -74
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3e34f0e901f03d378d86cfde3105013175abb51fae73ae3e8f35ee7289a2630
|
4
|
+
data.tar.gz: 2c6aa8f4cc28c3efe0de69adc5968327a3018042150b57a37b07acec4f798877
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93211c9531aa658053848dd09d2f444b008c20b7d3ca8fd50b12e326739d50e9d695df81659c34fe5bb7bbb5848a5de7d2f36cde2133bef3a9b5343a9a58b467
|
7
|
+
data.tar.gz: 6134322a493e06050b0080abf3236d8a49665e34d83eda3a9ed8ca40ef0001339e5f34811d6f57a1dec70906a29bc39f0cefd0cba7a0ebd002788dd6593d2450
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
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
|