protocol-http 0.47.0 → 0.47.1

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: f53b02520f9b41a2cf01a8e2637c7331dbfbd330ad13487036c2af363e948c2d
4
- data.tar.gz: 803588a8a92cc588e027dd285c8d76705d4fb137e2a5fa9566b2897d1473be38
3
+ metadata.gz: d8281f44eb94360f117cba9ef4770386d57b72049ec2200e45041f7b93193147
4
+ data.tar.gz: 0e93ed313a1a91971568b575b58db52857f15da6a92fe8764294f2b6ef2335c6
5
5
  SHA512:
6
- metadata.gz: a6cb23fc1e47567145ad6d30ab12b4157e3f5962de8a32c38702bdb979c5f9c9388f6b480104655a77dd83c42c5e3230b471efe683acda76e0a2576f0fd654e4
7
- data.tar.gz: e61af805d44b682ad9da0de0753b6009a96ace3b68799a597523ac6d74d847923d810e2cc20ded2df569a57505c7a2abb768714153f47a46586df6ce9e9dd086
6
+ metadata.gz: 4f5765e41ef7706b20f8c82812099dc5e79fa6f5c9036332688e5dde9ea0a41a52d44a2442aa33d3514f977939f70c32b40fa858179d4bada70df5b70227e7ab
7
+ data.tar.gz: 8835f1c4351794d80db3c917b374648a2090c89619b9bd9deb556955a86eb230118814930d2b8d363838b49f0d2a75d7cee0f8f91bbc2393146cc8cecc9c4f68
checksums.yaml.gz.sig CHANGED
Binary file
@@ -29,13 +29,15 @@ module Protocol
29
29
  # The default urgency level if not specified.
30
30
  DEFAULT_URGENCY = 3
31
31
 
32
- # Returns the urgency level if specified. 0 is the highest priority, and 7 is the lowest.
32
+ # The urgency level, if specified using `u=`. 0 is the highest priority, and 7 is the lowest.
33
+ #
34
+ # Note that when duplicate Dictionary keys are encountered, all but the last instance are ignored.
33
35
  #
34
36
  # @returns [Integer | Nil] the urgency level if specified, or `nil` if not present.
35
37
  def urgency(default = DEFAULT_URGENCY)
36
- if value = self.find { |value| value.start_with?("u=") }
38
+ if value = self.reverse_find{|value| value.start_with?("u=")}
37
39
  _, level = value.split("=", 2)
38
- return level.to_i
40
+ return Integer(level)
39
41
  end
40
42
 
41
43
  return default
@@ -39,6 +39,16 @@ module Protocol
39
39
  def to_s
40
40
  join(",")
41
41
  end
42
+
43
+ protected
44
+
45
+ def reverse_find(&block)
46
+ reverse_each do |value|
47
+ return value if block.call(value)
48
+ end
49
+
50
+ return nil
51
+ end
42
52
  end
43
53
  end
44
54
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module HTTP
8
- VERSION = "0.47.0"
8
+ VERSION = "0.47.1"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.47.0
4
+ version: 0.47.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -47,7 +47,7 @@ cert_chain:
47
47
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
48
48
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
49
49
  -----END CERTIFICATE-----
50
- date: 2024-11-28 00:00:00.000000000 Z
50
+ date: 2024-12-04 00:00:00.000000000 Z
51
51
  dependencies: []
52
52
  description:
53
53
  email:
metadata.gz.sig CHANGED
Binary file