gh 0.17.0 → 0.18.0

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: f8a1b32f6b0b712cec230706a3948ccd79fd1dd2
4
- data.tar.gz: 7353b2fbd8c71586f0a1d3dd75df921d750681fd
3
+ metadata.gz: 16d87ecc5b3c30bf97a8a4bb031f92f5f0f6158f
4
+ data.tar.gz: 1faf61eced641abc7cc16f078713406ddac90a8f
5
5
  SHA512:
6
- metadata.gz: 1319063155020881887605d5a32251f5b1a00a112d3ff70bf0ba4f5e2d7bc586b7c567db793220c0423f4b95ffe16c1797ea7ce51addd4b7c7c34b517e4c7370
7
- data.tar.gz: 6b474c2a615f8c8cebb8182a439a64f067d9816a801f7cbb1180f04d2a3bb2dbef021b8e774262af096061ea7e234f726dc8d771fc68934bc7aaf7bdab096ff3
6
+ metadata.gz: 4d950b13a2578b2d3224501075e7a4700464e207919d7d2f208cc54ce4eb16bb5216daae061d3834d6e79cc1295a7753b16d1ab3766b231b8eb779de014a1a33
7
+ data.tar.gz: bd2f9066b1f1be9060d10a9a246d60959d4e6f7e2597a3652594c6155db8fb9b72aa8ef553fd4287c33634bed4b08ad51da1f725ea71fe8c45ad75531cb3bfef
data/lib/gh.rb CHANGED
@@ -16,6 +16,7 @@ module GH
16
16
  autoload :Parallel, 'gh/parallel'
17
17
  autoload :Remote, 'gh/remote'
18
18
  autoload :Response, 'gh/response'
19
+ autoload :ResponseXHeaderFormatter, 'gh/response_x_header_formatter'
19
20
  autoload :ResponseWrapper, 'gh/response_wrapper'
20
21
  autoload :Stack, 'gh/stack'
21
22
  autoload :TokenCheck, 'gh/token_check'
@@ -1,5 +1,6 @@
1
1
  require 'gh'
2
2
  require 'faraday'
3
+ require 'active_support/core_ext/string'
3
4
 
4
5
  module GH
5
6
  # Public: This class deals with HTTP requests to Github. It is the base Wrapper you always want to use.
@@ -50,6 +51,7 @@ module GH
50
51
  if defined? FaradayMiddleware::Instrumentation
51
52
  builder.use :instrumentation
52
53
  end
54
+ builder.response(:logger, nil, formatter: GH.const_get(options[:formatter].camelize)) if options[:formatter]
53
55
  builder.adapter(:net_http)
54
56
  end
55
57
  end
@@ -0,0 +1,12 @@
1
+ require 'faraday/logging/formatter'
2
+
3
+ module GH
4
+ class ResponseXHeaderFormatter < Faraday::Logging::Formatter
5
+ def request(env)
6
+ end
7
+
8
+ def response(env)
9
+ info('Response') { env.response_headers.select {|k,v| k =~ /^x-/}.sort.to_h }
10
+ end
11
+ end
12
+ end
@@ -1,4 +1,4 @@
1
1
  module GH
2
2
  # Public: Library version.
3
- VERSION = '0.17.0'
3
+ VERSION = '0.18.0'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-14 00:00:00.000000000 Z
11
+ date: 2020-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -160,6 +160,7 @@ files:
160
160
  - lib/gh/remote.rb
161
161
  - lib/gh/response.rb
162
162
  - lib/gh/response_wrapper.rb
163
+ - lib/gh/response_x_header_formatter.rb
163
164
  - lib/gh/stack.rb
164
165
  - lib/gh/token_check.rb
165
166
  - lib/gh/version.rb