cucumber-messages 22.0.0 → 24.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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.deserializers.rb +1 -0
- data/lib/cucumber/messages.dtos.rb +140 -358
- metadata +37 -42
- data/LICENSE +0 -21
- data/spec/capture_warnings.rb +0 -74
- data/spec/cucumber/messages/acceptance_spec.rb +0 -33
- data/spec/cucumber/messages/id_generator_spec.rb +0 -29
- data/spec/cucumber/messages/message/deserialization_spec.rb +0 -30
- data/spec/cucumber/messages/message/dummy_messages.rb +0 -38
- data/spec/cucumber/messages/message/serialization_spec.rb +0 -89
- data/spec/cucumber/messages/message/utils_spec.rb +0 -30
- data/spec/cucumber/messages/ndjson_serialization_spec.rb +0 -56
- data/spec/cucumber/messages/time_conversion_spec.rb +0 -41
- data/spec/cucumber/messages/version_spec.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b085c369dea71ce0fb539c4ee81dac76b95104259f831b61488b07c3cd85f97
|
4
|
+
data.tar.gz: 4c79d872aabd5da1fb5bd32865f0f7366d63ceebcfdf050b4102a2b3095d62fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0777da94145cac9e323e2977f8d673e3ec96560d9c9ceb58eec4dc3b420fee1c18d534dce2b7ae66ed58201f144c00187e2e46273c1708f45c889fa166c923d7
|
7
|
+
data.tar.gz: 2c1f0e69b5a66a6ce338d301a58350d11170777e27b94fd1ee22f9c77db68300f887f65dace19e7c4b4e55010978398faea442ffa1eaaef18ea3c7659f4d3d8d
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
24.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
|