console_utils 0.4.0 → 0.4.1.1

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: 22a211280b416bdaf805b0230552de96331ce71e
4
- data.tar.gz: 83669052246d74df2a926a254f08104e7fca8da6
3
+ metadata.gz: f1380c26eef04f62bc9906a37c1474345e76288c
4
+ data.tar.gz: daf25af3f2816e5e09085792acf9f45c9cfca548
5
5
  SHA512:
6
- metadata.gz: 893930c9027842760bc57f49a85078cee0ed60cc7aa6818379afa3d4026c2e11d61be17df10e308216bf07d24cc9b4f0d96803d1f61ca0300ee48689fc49b195
7
- data.tar.gz: 0e20c16c9eee9d4608ec3b6a9f829d195d32abf85a9455a29910de9b152d5648288ed30ebeb6bb6ffbba634c3617151cf98d5bacbe17e5ceebc165ab839ec4b6
6
+ metadata.gz: c584be72495886bdb5d1cccbfaf6746e2e5d032c905fde9979b75189f9aced1cab4a1c51bb2ea606482bd4605b5d9608f83d463c7313fe63ce22234d1c46e328
7
+ data.tar.gz: 0b33ba83c797b0ccd130d51e60f92787d7ba85d2f50d4fabd5cccb33eeb729bba5829aef97a477c4a04b013b88404a69915de165e54f584f532ac47ac8ab9df2
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
  /pkg/
10
10
  /spec/reports/
11
11
  /tmp/
12
+ /.envrc
13
+ /.ruby-*
@@ -125,6 +125,11 @@ module ConsoleUtils
125
125
  # (default: <tt>true</tt>)
126
126
  mattr_accessor(:request_auto_auth) { true }
127
127
 
128
+ # :attr:
129
+ # Request methods to delegate with requester
130
+ # (default: <tt>[:get, :post, :put, :delete, :patch, :head]</tt>)
131
+ mattr_accessor(:request_methods) { %i(get post put delete patch head) }
132
+
128
133
  # :attr:
129
134
  # Specifies a callable object, which will hook requests with
130
135
  # credentials. There are two built-in implementations: the default
@@ -4,7 +4,7 @@ module ConsoleUtils::RequestUtils #:nodoc:
4
4
  class Exap < Requester
5
5
  INSPECT_FORMAT = "<Local: %s (%s)>".freeze
6
6
 
7
- REQUEST_METHODS.each do |reqm|
7
+ ConsoleUtils.request_methods.each do |reqm|
8
8
  define_method(reqm) { |*args| resp_wrap(reqm, *args) }
9
9
  end
10
10
 
@@ -9,7 +9,7 @@ module ConsoleUtils::RequestUtils #:nodoc:
9
9
 
10
10
  attr_reader :request_method
11
11
 
12
- REQUEST_METHODS.each do |reqm|
12
+ ConsoleUtils.request_methods.each do |reqm|
13
13
  define_method(reqm) do |url, *args|
14
14
  @_args = args
15
15
  @url = urlify(url, *normalize_args)
@@ -3,7 +3,6 @@ require 'active_support/core_ext/numeric'
3
3
 
4
4
  module ConsoleUtils::RequestUtils #:nodoc:
5
5
  class Requester < SimpleDelegator
6
- REQUEST_METHODS = %i(get post put delete patch).freeze
7
6
  INFO_HASH_FIELDS = %i(url size time human_size human_time).freeze
8
7
  INFO_FORMAT = "%#-.50{url} | %#10{human_size} | %#10{human_time}\n".freeze
9
8
  NO_RESPONSE = Term::ANSIColor.red(" \u27A7 Empty response's body.").freeze
@@ -80,7 +79,7 @@ module ConsoleUtils::RequestUtils #:nodoc:
80
79
  @_size = nil
81
80
  end
82
81
 
83
- private_constant :REQUEST_METHODS, :PBCOPY_MESSAGE,
82
+ private_constant :PBCOPY_MESSAGE,
84
83
  :NO_RESPONSE, :COMPLETE_IN, :TRANSFERED,
85
84
  :INFO_FORMAT
86
85
  end
@@ -1,3 +1,3 @@
1
1
  module ConsoleUtils
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-08 00:00:00.000000000 Z
11
+ date: 2015-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport