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 +4 -4
- data/README.md +1 -1
- data/lib/api_recipes/utils.rb +3 -24
- data/lib/api_recipes/version.rb +1 -1
- data/lib/api_recipes.rb +13 -7
- metadata +7 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8c8e887543d5b2571190093a25ee60ba47e7454244ec4b2a8f543934368ec34c
|
|
4
|
+
data.tar.gz: 5fa9d7866a4d52c064aaec98ef3402aef2ea2a3dcb6728a17d60c76e508e337e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5edaaffcf15dfb67ec212b2efc5f50778169b05d8b011b6a3a20f5dc3fe59120db746274671d4da3ff889a7f0c633ade3f5b60d950a0f0ce30f4e4a4e4ab8648
|
|
7
|
+
data.tar.gz: 20294d6d13e34334692f8dba9056deb5d47653d3b80fe8eb7cfbcef753b27286be32f33d1b96d3b9189ff482266b6705230a281c8b28de5bb72d3d7d5e50ddfe
|
data/README.md
CHANGED
data/lib/api_recipes/utils.rb
CHANGED
|
@@ -1,28 +1,7 @@
|
|
|
1
1
|
class Hash
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
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
|
#
|
data/lib/api_recipes/version.rb
CHANGED
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
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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.
|
|
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:
|
|
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: '
|
|
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: '
|
|
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:
|
|
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: []
|