console_utils 0.3.1 → 0.3.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c3fe1a107afccfae81595c74595bdb4dfd18352
|
4
|
+
data.tar.gz: d3fb4f250a454750a58edb0d34eaa4b2bdac1d67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f053b200ef2551b711a80aa1259810e80c4394dc364c00a4e6310ac7a090ea3e5d91241898c7062783f052b51c584212b1f9e5e094cad932eb2ca82ecc591f00
|
7
|
+
data.tar.gz: 00f07b42ef8d7007d56c094166ea0d1816d05e037927b8954acb0211d767bf1f9c5fe349afa77ef25977b3680a821afec99c30ce1687d38d98119ff40e40323e
|
@@ -29,7 +29,14 @@ module ConsoleUtils::RequestUtils
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def with_default(default_params = nil)
|
32
|
-
|
32
|
+
default_headers = default_params.delete(:headers) if default_params.is_a?(Hash)
|
33
|
+
|
34
|
+
if params.is_a?(Hash)
|
35
|
+
params.merge!(default_params.to_h)
|
36
|
+
else
|
37
|
+
headers.merge!(default_headers.to_h)
|
38
|
+
end
|
39
|
+
|
33
40
|
to_a
|
34
41
|
end
|
35
42
|
|
@@ -11,7 +11,7 @@ module ConsoleUtils::RequestUtils #:nodoc:
|
|
11
11
|
COMPLETE_IN = Term::ANSIColor.green("Complete in %s").freeze
|
12
12
|
TRANSFERED = Term::ANSIColor.cyan("Transfered: %s").freeze
|
13
13
|
|
14
|
-
class_attribute :default_params
|
14
|
+
class_attribute :default_params, instance_writer: false
|
15
15
|
attr_reader :url
|
16
16
|
|
17
17
|
def preview(mth = nil)
|