aitch 2.1.1 → 2.1.2
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/.rubocop.yml +6 -0
- data/CHANGELOG.md +2 -0
- data/aitch.gemspec +1 -0
- data/lib/aitch/configuration.rb +2 -2
- data/lib/aitch/ext/to_query.rb +2 -2
- data/lib/aitch/response.rb +3 -3
- data/lib/aitch/version.rb +1 -1
- data/test/support/helpers.rb +2 -1
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0c80287abc64e0480e51451e5ccb5ea8ba563c057cbfba1d500e885768563dd9
|
|
4
|
+
data.tar.gz: 4e36a622401ce9715e319b1f5282906a57b9ef75e63bac7756cefd339fe86366
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 540989a8ae14bedd280da660a0497bde04cb58958c3ec7790ffa9f09867f7d886d01eda79e59ff1a1952254f4f503f6345a2a17f2220b0ec9df42e75cf88c821
|
|
7
|
+
data.tar.gz: 5b7d5d112dcb7e00831d771fe0a206bec1f407839bc01ed4950bba33ca92ff9ae6bfa0d81cc01c879ecb890b08174184c88df379598b0aa8545967cfac99fb0a
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/aitch.gemspec
CHANGED
data/lib/aitch/configuration.rb
CHANGED
|
@@ -55,8 +55,8 @@ module Aitch
|
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
def to_h
|
|
58
|
-
instance_variables.
|
|
59
|
-
|
|
58
|
+
instance_variables.to_h do |name|
|
|
59
|
+
[name.to_s.tr("@", "").to_sym, instance_variable_get(name)]
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
62
|
end
|
data/lib/aitch/ext/to_query.rb
CHANGED
|
@@ -56,8 +56,8 @@ module Aitch
|
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
refine Hash do
|
|
59
|
-
# Returns a string representation of the receiver suitable for use as a
|
|
60
|
-
# query string:
|
|
59
|
+
# Returns a string representation of the receiver suitable for use as a
|
|
60
|
+
# URL query string:
|
|
61
61
|
#
|
|
62
62
|
# {name: 'David', nationality: 'Danish'}.to_query
|
|
63
63
|
# # => "name=David&nationality=Danish"
|
data/lib/aitch/response.rb
CHANGED
|
@@ -43,16 +43,16 @@ module Aitch
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def success?
|
|
46
|
-
code
|
|
46
|
+
code.between?(200, 399)
|
|
47
47
|
end
|
|
48
48
|
alias ok? success?
|
|
49
49
|
|
|
50
50
|
def redirect?
|
|
51
|
-
code
|
|
51
|
+
code.between?(300, 399)
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def error?
|
|
55
|
-
code
|
|
55
|
+
code.between?(400, 599)
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
def error
|
data/lib/aitch/version.rb
CHANGED
data/test/support/helpers.rb
CHANGED
|
@@ -15,7 +15,8 @@ module Minitest
|
|
|
15
15
|
add_hash_entry(options, headers, :content_type, "Content-Type")
|
|
16
16
|
add_hash_entry(options, headers, :content_encoding, "Content-Encoding")
|
|
17
17
|
|
|
18
|
-
stub_request(http_method, url)
|
|
18
|
+
stub_request(http_method, url)
|
|
19
|
+
.to_return(status: status, body: body, headers: headers)
|
|
19
20
|
end
|
|
20
21
|
|
|
21
22
|
def last_request
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aitch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nando Vieira
|
|
@@ -23,6 +23,20 @@ dependencies:
|
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
25
|
version: '0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: cgi
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
26
40
|
- !ruby/object:Gem::Dependency
|
|
27
41
|
name: nokogiri
|
|
28
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -284,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
284
298
|
- !ruby/object:Gem::Version
|
|
285
299
|
version: '0'
|
|
286
300
|
requirements: []
|
|
287
|
-
rubygems_version:
|
|
301
|
+
rubygems_version: 4.0.6
|
|
288
302
|
specification_version: 4
|
|
289
303
|
summary: A simple HTTP client
|
|
290
304
|
test_files: []
|