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: df3a34e82938cc4b28ff52f9be97353251775365
4
- data.tar.gz: dcf13ae29e5533b1fd801c7cf083735f52f3ea4a
3
+ metadata.gz: 4c3fe1a107afccfae81595c74595bdb4dfd18352
4
+ data.tar.gz: d3fb4f250a454750a58edb0d34eaa4b2bdac1d67
5
5
  SHA512:
6
- metadata.gz: 90704c63d92a2624db091c79ab47c33150db2cc03c4615804f066aa07482a29c284a2006b0f5e30ef0286d49db9264800da02d2dedf4b7e0e1b712924581d88a
7
- data.tar.gz: 37f81f3c16fe2f2d9b9ec4871be36d967b9adce1d74c0c4a81f1bb17f3e5db12c655617d2e84371c69b3ee1f57ba13aa015d0ddf04187dad3496b4a6f8391f09
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
- params.merge!(default_params.to_h)
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)
@@ -1,3 +1,3 @@
1
1
  module ConsoleUtils
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton