gh 0.17.0 → 0.18.0
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/lib/gh.rb +1 -0
- data/lib/gh/remote.rb +2 -0
- data/lib/gh/response_x_header_formatter.rb +12 -0
- data/lib/gh/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16d87ecc5b3c30bf97a8a4bb031f92f5f0f6158f
|
4
|
+
data.tar.gz: 1faf61eced641abc7cc16f078713406ddac90a8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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'
|
data/lib/gh/remote.rb
CHANGED
@@ -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
|
data/lib/gh/version.rb
CHANGED
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.
|
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-
|
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
|