cucumber-messages 22.0.0 → 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: 3bc766d1b3813a86b29e6616ac619ef081524af03bc0b0ca13ee43030a7f58b8
4
- data.tar.gz: 8c59570b04a951846405534ad80f8ff06d93db4bb00ae719d005446e13724fc2
3
+ metadata.gz: f3e34f0e901f03d378d86cfde3105013175abb51fae73ae3e8f35ee7289a2630
4
+ data.tar.gz: 2c6aa8f4cc28c3efe0de69adc5968327a3018042150b57a37b07acec4f798877
5
5
  SHA512:
6
- metadata.gz: 6e65adff9ca721a531a29d11a82ddd7a229fb67aca4aec3defa97e08265bd8f64798b8c989c570e8bed2be8a79db51864fbc4040216681879d70b7915ce0e0b5
7
- data.tar.gz: 3a052b3971dbc65aadad22cb7d9a6a903ab9b8fbe2558722e9cbefd558ed5761d23c8859df15dac0219a13dd6ed205c5f1fdd061273c6adf8b93e0157cb55529
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
- 22.0.0
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