api_recipes 2.10.2 → 2.10.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 901f6a4dff9765f9942e3da126a3f26329421514ae47ae13ed5c5e2849f24ade
4
- data.tar.gz: 0c1fa41443789ca366f27424b862aa46028648b2d914255d8454c159697ba7d7
3
+ metadata.gz: 8c8e887543d5b2571190093a25ee60ba47e7454244ec4b2a8f543934368ec34c
4
+ data.tar.gz: 5fa9d7866a4d52c064aaec98ef3402aef2ea2a3dcb6728a17d60c76e508e337e
5
5
  SHA512:
6
- metadata.gz: 353664249eab70f9ab15835a0ae4d460363f92fbfe53b11dc2371a96aedd04483b81c68d0b5a6b3dc52b954c3bff3410ed92b18a04f752958c7317772116d9d6
7
- data.tar.gz: 78630e64218cfc64f9e2217ad1e846f378e39c323553f04c8029c97ad6e19404574d2a3854bad619b2aece4d7d70087351e5968ccba954bb80c5fc1d137d0213
6
+ metadata.gz: 5edaaffcf15dfb67ec212b2efc5f50778169b05d8b011b6a3a20f5dc3fe59120db746274671d4da3ff889a7f0c633ade3f5b60d950a0f0ce30f4e4a4e4ab8648
7
+ data.tar.gz: 20294d6d13e34334692f8dba9056deb5d47653d3b80fe8eb7cfbcef753b27286be32f33d1b96d3b9189ff482266b6705230a281c8b28de5bb72d3d7d5e50ddfe
data/README.md CHANGED
@@ -28,7 +28,7 @@ Or install it yourself as:
28
28
 
29
29
  ## Compatibility
30
30
 
31
- Ruby 2.5.0 or higher.
31
+ Ruby 2.7.0 or higher.
32
32
 
33
33
  ## Usage
34
34
 
@@ -1,28 +1,7 @@
1
1
  class Hash
2
- # Returns a new hash with all keys converted using the block operation.
3
- #
4
- # hash = { name: 'Rob', age: '28' }
5
- #
6
- # hash.transform_keys{ |key| key.to_s.upcase }
7
- # # => {"NAME"=>"Rob", "AGE"=>"28"}
8
- def transform_keys
9
- return enum_for(:transform_keys) unless block_given?
10
- result = self.class.new
11
- each_key do |key|
12
- result[yield(key)] = self[key]
13
- end
14
- result
15
- end
16
-
17
- # Destructively convert all keys using the block operations.
18
- # Same as transform_keys but modifies +self+.
19
- def transform_keys!
20
- return enum_for(:transform_keys!) unless block_given?
21
- keys.each do |key|
22
- self[yield(key)] = delete(key)
23
- end
24
- self
25
- end
2
+ # Hash#transform_keys and #transform_keys! are Ruby's own (since 2.5): the helpers
3
+ # below build on them. Redefining them here broke Hash subclasses whose constructor
4
+ # needs arguments and dropped the hash argument added in Ruby 3.0.
26
5
 
27
6
  # Returns a new hash with all keys converted to strings.
28
7
  #
@@ -1,3 +1,3 @@
1
1
  module ApiRecipes
2
- VERSION = '2.10.2'.freeze
2
+ VERSION = '2.10.3'.freeze
3
3
  end
data/lib/api_recipes.rb CHANGED
@@ -152,11 +152,17 @@ module ApiRecipes
152
152
  end
153
153
  end
154
154
 
155
- # Monkey-patch URI so it can accept dashed hostnames like "web-service-1"
156
- module URI
157
- # Undef DEFAULT_PARSER
158
- URI.send(:remove_const, :DEFAULT_PARSER)
159
-
160
- # Redefine DEFAULT_PARSER
161
- DEFAULT_PARSER = Parser.new(HOSTNAME: "(?:(?:[a-zA-Z\\d](?:[-\\_a-zA-Z\\d]*[a-zA-Z\\d])?)\\.)*(?:[a-zA-Z](?:[-\\_a-zA-Z\\d]*[a-zA-Z\\d])?)\\.?")
155
+ # Monkey-patch URI so it can accept hostnames with underscores like "web_service_1"
156
+ # (e.g. docker-compose service names), which Route#build_uri validates through
157
+ # URI::DEFAULT_PARSER. Only the uri gem's RFC 2396 parser (uri < 1.0) rejects them.
158
+ # From uri 1.0 the default parser follows RFC 3986, which accepts them, and
159
+ # URI::Parser is that parser, whose constructor takes no arguments.
160
+ if defined?(URI::RFC2396_Parser) && URI::DEFAULT_PARSER.instance_of?(URI::RFC2396_Parser)
161
+ module URI
162
+ # Undef DEFAULT_PARSER
163
+ URI.send(:remove_const, :DEFAULT_PARSER)
164
+
165
+ # Redefine DEFAULT_PARSER
166
+ DEFAULT_PARSER = RFC2396_Parser.new(HOSTNAME: "(?:(?:[a-zA-Z\\d](?:[-\\_a-zA-Z\\d]*[a-zA-Z\\d])?)\\.)*(?:[a-zA-Z](?:[-\\_a-zA-Z\\d]*[a-zA-Z\\d])?)\\.?")
167
+ end
162
168
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_recipes
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.2
4
+ version: 2.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Verlato
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-06-12 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: http
@@ -17,9 +16,9 @@ dependencies:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
18
  version: '4.4'
20
- - - "<="
19
+ - - "<"
21
20
  - !ruby/object:Gem::Version
22
- version: '5.1'
21
+ version: '6'
23
22
  type: :runtime
24
23
  prerelease: false
25
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,10 +26,9 @@ dependencies:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
28
  version: '4.4'
30
- - - "<="
29
+ - - "<"
31
30
  - !ruby/object:Gem::Version
32
- version: '5.1'
33
- description:
31
+ version: '6'
34
32
  email:
35
33
  - averlato@gmail.com
36
34
  executables: []
@@ -53,7 +51,6 @@ homepage: https://github.com/madAle/api_recipes
53
51
  licenses:
54
52
  - MIT
55
53
  metadata: {}
56
- post_install_message:
57
54
  rdoc_options: []
58
55
  require_paths:
59
56
  - lib
@@ -68,8 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
65
  - !ruby/object:Gem::Version
69
66
  version: '0'
70
67
  requirements: []
71
- rubygems_version: 3.5.4
72
- signing_key:
68
+ rubygems_version: 4.0.17
73
69
  specification_version: 4
74
70
  summary: Consume HTTP APIs with style
75
71
  test_files: []