faraday-detailed_logger 2.3.0 → 2.5.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
  SHA256:
3
- metadata.gz: c4378077fee8fec3312c19c6403d9ca683a8b3fdbbcdbb745ff97d83fe3ac559
4
- data.tar.gz: 8b84ddc0a1864211a52b587fc4b5cf0342906739029b9a28dc7552afbf81937b
3
+ metadata.gz: 743670ebe4c7a46ecd82eaa2adc20d41ebc5dae3adb4786402105d9fcf92ce4e
4
+ data.tar.gz: 986b9fcef32c461f74a85a2e70b6989ebe265d58aed99b6b1acfb100c6ab8b27
5
5
  SHA512:
6
- metadata.gz: d11f3f3bb40a8becd7611f92ea059dfc549d84e29a2a21a1d8d0a115054c750632f6e2392251e9f115b4c3586434b94cbb0fcd60d61e07e8e7e6cf668d7c60d7
7
- data.tar.gz: 355b30061f026ddc62c660d6d9925effe9378b2c7da3cc67d627ceb3e340db7a4ffba5a1eec9a49e71f023cd0a2b1cbdf5871589690502101951e69816814e5d
6
+ metadata.gz: 036174605b88b0cb52f138e94b239a2c62ecd577ca91dc19f9e729bd674fe0eb73f4a92d0f32b992a677a7ef83021deaf359522072898b5c501381252591a473
7
+ data.tar.gz: ccd1cde9ad73aadb412d357bc52e24ad41c20dc091954f91364ad8610cf3919c20e685bce8f82bc8a2963e9326c8e031f7fc6826277f7a2aa88192f5a5590b46
data/.rspec CHANGED
@@ -1,3 +1,4 @@
1
1
  --color
2
- --warnings
2
+ --no-profile
3
3
  --require spec_helper
4
+ --warnings
data/.rubocop.yml CHANGED
@@ -20,9 +20,6 @@ Layout/EmptyLinesAroundAccessModifier:
20
20
  Layout/EndOfLine:
21
21
  EnforcedStyle: "lf"
22
22
 
23
- Layout/HeredocIndentation:
24
- EnforcedStyle: "squiggly"
25
-
26
23
  Layout/IndentationConsistency:
27
24
  EnforcedStyle: "normal"
28
25
 
data/Appraisals CHANGED
@@ -1,17 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- appraise 'faraday-0.8' do
4
- gem 'faraday', '~> 0.8.0'
3
+ appraise 'faraday-0.16.x' do
4
+ gem 'faraday', '~> 0.16.0'
5
5
  end
6
6
 
7
7
  appraise 'faraday-0.x' do
8
- gem 'faraday', '~> 0.15'
8
+ gem 'faraday', '~> 0.16'
9
9
  end
10
10
 
11
11
  appraise 'faraday-1.x' do
12
12
  gem 'faraday', '~> 1.0'
13
13
  end
14
14
 
15
+ appraise 'faraday-2.x' do
16
+ gem 'faraday', '~> 2.0'
17
+ end
18
+
15
19
  appraise 'faraday-latest' do
16
20
  gem 'faraday'
17
21
  end
data/CHANGELOG.md CHANGED
@@ -1,15 +1,36 @@
1
1
  # Faraday::DetailedLogger changelog
2
2
 
3
- [![Gem Version](https://img.shields.io/gem/v/faraday-detailed_logger.svg)](https://rubygems.org/gems/faraday-detailed_logger)
4
- [![Build Status](https://img.shields.io/travis/envylabs/faraday-detailed_logger/master.svg)](https://travis-ci.org/envylabs/faraday-detailed_logger)
5
- [![Maintainability](https://api.codeclimate.com/v1/badges/4d352482c536f5cee0c8/maintainability)](https://codeclimate.com/github/envylabs/faraday-detailed_logger/maintainability)
6
- [![Coverage Status](https://img.shields.io/coveralls/envylabs/faraday-detailed_logger.svg)](https://coveralls.io/r/envylabs/faraday-detailed_logger)
7
- [![Inline docs](https://inch-ci.org/github/envylabs/faraday-detailed_logger.svg?branch=master)](https://inch-ci.org/github/envylabs/faraday-detailed_logger)
3
+ [![Gem Version](https://badge.fury.io/rb/faraday-detailed_logger.svg)](https://badge.fury.io/rb/faraday-detailed_logger)
4
+ [![Tests](https://github.com/envylabs/faraday-detailed_logger/workflows/Tests/badge.svg)](https://github.com/envylabs/faraday-detailed_logger/actions?query=workflow%3ATests)
8
5
 
9
6
  ## [HEAD][] / unreleased
10
7
 
11
8
  * No significant changes.
12
9
 
10
+ ## [2.5.0][] / 2022-01-23
11
+
12
+ * Add faraday 2 support.
13
+ * Extract an initial internal cURL formatter
14
+
15
+ ## [2.4.2][] / 2021-11-09
16
+
17
+ * Revert zeitwerk autoloading changes.
18
+
19
+ The existing implementation caused application errors citing a `uninitialized
20
+ constant Faraday::DetailedLogger::Middleware`.
21
+
22
+ ## [2.4.1][] / 2021-11-09
23
+
24
+ * Fix `Faraday::Error: :detailed_logger is not registered on Faraday::Response`
25
+ by relocating middleware registration.
26
+ * Increase the low-end of the faraday dependency to `~> 0.16` for Ruby 3
27
+ compatibility. Versions of faraday earlier than 0.16 are incompatible with
28
+ Ruby 3's Proc interface.
29
+
30
+ ## [2.4.0][] / 2021-11-06
31
+
32
+ * Use [zeitwerk](https://rubygems.org/gems/zeitwerk) autoloading.
33
+
13
34
  ## [2.3.0][] / 2020-02-11
14
35
 
15
36
  * Sort the request and response headers when logging.
@@ -66,4 +87,8 @@
66
87
  [2.1.3]: https://github.com/envylabs/faraday-detailed_logger/compare/v2.1.2...v2.1.3
67
88
  [2.2.0]: https://github.com/envylabs/faraday-detailed_logger/compare/v2.1.3...v2.2.0
68
89
  [2.3.0]: https://github.com/envylabs/faraday-detailed_logger/compare/v2.2.0...v2.3.0
69
- [HEAD]: https://github.com/envylabs/faraday-detailed_logger/compare/v2.3.0...master
90
+ [2.4.0]: https://github.com/envylabs/faraday-detailed_logger/compare/v2.3.0...v2.4.0
91
+ [2.4.1]: https://github.com/envylabs/faraday-detailed_logger/compare/v2.4.0...v2.4.1
92
+ [2.4.2]: https://github.com/envylabs/faraday-detailed_logger/compare/v2.4.1...v2.4.2
93
+ [2.5.0]: https://github.com/envylabs/faraday-detailed_logger/compare/v2.4.2...v2.5.0
94
+ [HEAD]: https://github.com/envylabs/faraday-detailed_logger/compare/v2.5.0...main
data/README.md CHANGED
@@ -1,10 +1,7 @@
1
1
  # Faraday::DetailedLogger
2
2
 
3
- [![Gem Version](https://img.shields.io/gem/v/faraday-detailed_logger.svg)](https://rubygems.org/gems/faraday-detailed_logger)
4
- [![Build Status](https://img.shields.io/travis/envylabs/faraday-detailed_logger/master.svg)](https://travis-ci.org/envylabs/faraday-detailed_logger)
5
- [![Maintainability](https://api.codeclimate.com/v1/badges/4d352482c536f5cee0c8/maintainability)](https://codeclimate.com/github/envylabs/faraday-detailed_logger/maintainability)
6
- [![Coverage Status](https://img.shields.io/coveralls/envylabs/faraday-detailed_logger.svg)](https://coveralls.io/r/envylabs/faraday-detailed_logger)
7
- [![Inline docs](https://inch-ci.org/github/envylabs/faraday-detailed_logger.svg?branch=master)](https://inch-ci.org/github/envylabs/faraday-detailed_logger)
3
+ [![Gem Version](https://badge.fury.io/rb/faraday-detailed_logger.svg)](https://badge.fury.io/rb/faraday-detailed_logger)
4
+ [![Tests](https://github.com/envylabs/faraday-detailed_logger/workflows/Tests/badge.svg)](https://github.com/envylabs/faraday-detailed_logger/actions?query=workflow%3ATests)
8
5
 
9
6
  A Faraday middleware used for providing debug- and info-level logging
10
7
  information. The request and response logs follow very closely with cURL output
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('../lib', __FILE__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'faraday/detailed_logger/version'
3
+ require_relative 'lib/faraday/detailed_logger/version'
6
4
 
7
5
  Gem::Specification.new do |spec|
8
6
  spec.name = 'faraday-detailed_logger'
@@ -17,26 +15,28 @@ Gem::Specification.new do |spec|
17
15
  )
18
16
  spec.homepage = 'https://github.com/envylabs/faraday-detailed_logger'
19
17
  spec.license = 'MIT'
18
+ spec.required_ruby_version = '>= 2.4.0'
20
19
 
21
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
22
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ spec.metadata['bug_tracker_uri'] = 'https://github.com/envylabs/faraday-detailed_logger/issues'
21
+ spec.metadata['changelog_uri'] = 'https://github.com/envylabs/faraday-detailed_logger/blob/main/CHANGELOG.md'
22
+ spec.metadata['source_code_uri'] = 'https://github.com/envylabs/faraday-detailed_logger'
23
+
24
+ # Specify which files should be added to the gem when it is released.
25
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
26
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
27
+ `git ls-files -z`.split("\x0").reject do |f|
28
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|doc|gemfiles|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
29
+ end
23
30
  end
24
31
 
25
- spec.bindir = 'exe'
26
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
32
  spec.require_paths = ['lib']
28
33
 
29
- spec.metadata['changelog_uri'] = 'https://github.com/envylabs/faraday-detailed_logger/blob/master/CHANGELOG.md'
30
- spec.metadata['source_code_uri'] = 'https://github.com/envylabs/faraday-detailed_logger'
31
- spec.metadata['bug_tracker_uri'] = 'https://github.com/envylabs/faraday-detailed_logger/issues'
32
-
33
- spec.add_runtime_dependency 'faraday', '>= 0.8', '< 2'
34
+ spec.add_runtime_dependency 'faraday', '>= 0.16', '< 3'
34
35
 
35
36
  spec.add_development_dependency 'appraisal', '~> 2.0'
36
37
  spec.add_development_dependency 'bundler', '~> 2.0'
37
- spec.add_development_dependency 'coveralls', '~> 0.8.0'
38
38
  spec.add_development_dependency 'license_finder', '~> 6.0'
39
39
  spec.add_development_dependency 'rake', '~> 13.0'
40
40
  spec.add_development_dependency 'rspec', '~> 3.0'
41
- spec.add_development_dependency 'rubocop-rails_config', '~> 0.9.0'
41
+ spec.add_development_dependency 'rubocop-rails_config', '~> 1.3'
42
42
  end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Faraday
4
+ module DetailedLogger
5
+ module CurlFormatter
6
+ def self.request(env)
7
+ "#{env[:method].upcase} #{env[:url]}"
8
+ end
9
+
10
+ def self.request_body(env)
11
+ curl_output(env[:request_headers], env[:body]).inspect
12
+ end
13
+
14
+ def self.response(env)
15
+ "HTTP #{env[:status]}"
16
+ end
17
+
18
+ def self.response_body(env)
19
+ curl_output(env[:response_headers], env[:body]).inspect
20
+ end
21
+
22
+ private
23
+
24
+ def self.curl_output(headers, body)
25
+ string = headers.to_a.sort_by(&:first).map { |k, v| "#{k}: #{v}" }.join("\n")
26
+ string + "\n\n#{body}"
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,107 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'faraday'
4
+
5
+ module Faraday
6
+ module DetailedLogger
7
+ # A Faraday middleware used for providing debug-level logging information.
8
+ # The request and response logs follow very closely with cURL output for
9
+ # ease of understanding.
10
+ #
11
+ # Be careful about your log level settings when using this middleware,
12
+ # especially in a production environment. With a DEBUG level log enabled,
13
+ # there will be potential information security concerns, because the
14
+ # request and response headers and bodies will be logged out. At an INFO or
15
+ # greater level, this is not a concern.
16
+ #
17
+ class Middleware < Faraday::Middleware
18
+ attr_reader :logger
19
+ attr_reader :tags
20
+
21
+ # Internal: Used as the Middleware's logger in the case that an explicit
22
+ # logger is not provided.
23
+ #
24
+ # Returns a Logger instance.
25
+ #
26
+ def self.default_logger
27
+ require 'logger'
28
+ ::Logger.new($stdout)
29
+ end
30
+
31
+ # Public: Initialize a new Logger middleware.
32
+ #
33
+ # app - A Faraday-compatible middleware stack or application.
34
+ # logger - A Logger-compatible object to which the log information will
35
+ # be recorded.
36
+ # tags - An optional array of tags to apply to the log output.
37
+ #
38
+ # Returns a Logger instance.
39
+ #
40
+ def initialize(app, logger = nil, *tags)
41
+ super(app)
42
+ @formatter = CurlFormatter
43
+ @logger = TaggedLogging.new(logger || self.class.default_logger)
44
+ @tags = tags
45
+ end
46
+
47
+ # Public: Used by Faraday to execute the middleware during the
48
+ # request/response cycle.
49
+ #
50
+ # env - A Faraday-compatible request environment.
51
+ #
52
+ # Returns the result of the parent application execution.
53
+ #
54
+ def call(env)
55
+ super
56
+ rescue
57
+ logger.error do
58
+ "#{$!.class.name} - #{$!.message} (#{$!.backtrace.first})"
59
+ end
60
+ raise
61
+ end
62
+
63
+ # Internal: Used by Faraday as a callback hook to process a network
64
+ # response after it has completed.
65
+ #
66
+ # env - A Faraday-compatible response environment.
67
+ #
68
+ # Returns nothing.
69
+ #
70
+ def on_complete(env)
71
+ status = env[:status]
72
+
73
+ logger.tagged(*tags) do
74
+ log_response_status(status) { formatter.response(env) }
75
+ logger.debug { formatter.response_body(env) }
76
+ end
77
+ end
78
+
79
+ # Public: Used by Faraday as a callback hook to process a network request
80
+ # before it has been made.
81
+ #
82
+ # env - A Faraday-compatible request environment.
83
+ #
84
+ # Returns nothing.
85
+ #
86
+ def on_request(env)
87
+ logger.tagged(*tags) do
88
+ logger.info { formatter.request(env) }
89
+ logger.debug { formatter.request_body(env) }
90
+ end
91
+ end
92
+
93
+ private
94
+
95
+ attr_reader :formatter
96
+
97
+ def log_response_status(status, &block)
98
+ case status
99
+ when 200..399
100
+ logger.info(&block)
101
+ else
102
+ logger.warn(&block)
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end
@@ -0,0 +1,97 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'faraday'
4
+
5
+ module Faraday
6
+ module DetailedLogger
7
+ # A Faraday middleware used for providing debug-level logging information.
8
+ # The request and response logs follow very closely with cURL output for
9
+ # ease of understanding.
10
+ #
11
+ # Be careful about your log level settings when using this middleware,
12
+ # especially in a production environment. With a DEBUG level log enabled,
13
+ # there will be potential information security concerns, because the
14
+ # request and response headers and bodies will be logged out. At an INFO or
15
+ # greater level, this is not a concern.
16
+ #
17
+ class Middleware < Faraday::Response::Middleware
18
+ attr_reader :logger
19
+ attr_reader :tags
20
+
21
+ # Internal: Used as the Middleware's logger in the case that an explicit
22
+ # logger is not provided.
23
+ #
24
+ # Returns a Logger instance.
25
+ #
26
+ def self.default_logger
27
+ require 'logger'
28
+ ::Logger.new($stdout)
29
+ end
30
+
31
+ # Public: Initialize a new Logger middleware.
32
+ #
33
+ # app - A Faraday-compatible middleware stack or application.
34
+ # logger - A Logger-compatible object to which the log information will
35
+ # be recorded.
36
+ # tags - An optional array of tags to apply to the log output.
37
+ #
38
+ # Returns a Logger instance.
39
+ #
40
+ def initialize(app, logger = nil, *tags)
41
+ super(app)
42
+ @formatter = CurlFormatter
43
+ @logger = TaggedLogging.new(logger || self.class.default_logger)
44
+ @tags = tags
45
+ end
46
+
47
+ # Public: Used by Faraday to execute the middleware during the
48
+ # request/response cycle.
49
+ #
50
+ # env - A Faraday-compatible request environment.
51
+ #
52
+ # Returns the result of the parent application execution.
53
+ #
54
+ def call(env)
55
+ logger.tagged(*tags) do
56
+ logger.info { formatter.request(env) }
57
+ logger.debug { formatter.request_body(env) }
58
+ end
59
+ super
60
+ rescue
61
+ logger.error do
62
+ "#{$!.class.name} - #{$!.message} (#{$!.backtrace.first})"
63
+ end
64
+ raise
65
+ end
66
+
67
+ # Internal: Used by Faraday as a callback hook to process a network
68
+ # response after it has completed.
69
+ #
70
+ # env - A Faraday-compatible response environment.
71
+ #
72
+ # Returns nothing.
73
+ #
74
+ def on_complete(env)
75
+ status = env[:status]
76
+
77
+ logger.tagged(*tags) do
78
+ log_response_status(status) { formatter.response(env) }
79
+ logger.debug { formatter.response_body(env) }
80
+ end
81
+ end
82
+
83
+ private
84
+
85
+ attr_reader :formatter
86
+
87
+ def log_response_status(status, &block)
88
+ case status
89
+ when 200..399
90
+ logger.info(&block)
91
+ else
92
+ logger.warn(&block)
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
@@ -1,110 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'faraday'
4
+ require 'faraday/detailed_logger/curl_formatter'
4
5
  require 'faraday/detailed_logger/tagged_logging'
5
6
 
6
- module Faraday
7
- module DetailedLogger
8
- # A Faraday middleware used for providing debug-level logging information.
9
- # The request and response logs follow very closely with cURL output for
10
- # ease of understanding.
11
- #
12
- # Be careful about your log level settings when using this middleware,
13
- # especially in a production environment. With a DEBUG level log enabled,
14
- # there will be potential information security concerns, because the
15
- # request and response headers and bodies will be logged out. At an INFO or
16
- # greater level, this is not a concern.
17
- #
18
- class Middleware < Faraday::Response::Middleware
19
- attr_reader :logger
20
- attr_reader :tags
21
-
22
- # Internal: Used as the Middleware's logger in the case that an explicit
23
- # logger is not provided.
24
- #
25
- # Returns a Logger instance.
26
- #
27
- def self.default_logger
28
- require 'logger'
29
- ::Logger.new($stdout)
30
- end
31
-
32
- # Public: Initialize a new Logger middleware.
33
- #
34
- # app - A Faraday-compatible middleware stack or application.
35
- # logger - A Logger-compatible object to which the log information will
36
- # be recorded.
37
- # tags - An optional array of tags to apply to the log output.
38
- #
39
- # Returns a Logger instance.
40
- #
41
- def initialize(app, logger = nil, *tags)
42
- super(app)
43
- @logger = TaggedLogging.new(logger || self.class.default_logger)
44
- @tags = tags
45
- end
46
-
47
- # Public: Used by Faraday to execute the middleware during the
48
- # request/response cycle.
49
- #
50
- # env - A Faraday-compatible request environment.
51
- #
52
- # Returns the result of the parent application execution.
53
- #
54
- def call(env)
55
- logger.tagged(*tags) do
56
- logger.info { "#{env[:method].upcase} #{env[:url]}" }
57
- logger.debug { curl_request_output(env) }
58
- end
59
- super
60
- rescue
61
- logger.error do
62
- "#{$!.class.name} - #{$!.message} (#{$!.backtrace.first})"
63
- end
64
- raise
65
- end
66
-
67
- # Internal: Used by Faraday as a callback hook to process a network
68
- # response after it has completed.
69
- #
70
- # env - A Faraday-compatible response environment.
71
- #
72
- # Returns nothing.
73
- #
74
- def on_complete(env)
75
- status = env[:status]
76
-
77
- logger.tagged(*tags) do
78
- log_response_status(status) { "HTTP #{status}" }
79
- logger.debug { curl_response_output(env) }
80
- end
81
- end
82
-
83
- private
84
-
85
- def curl_request_output(env)
86
- curl_output(env[:request_headers], env[:body]).inspect
87
- end
88
-
89
- def curl_response_output(env)
90
- curl_output(env[:response_headers], env[:body]).inspect
91
- end
92
-
93
- def curl_output(headers, body)
94
- string = headers.to_a.sort_by(&:first).map { |k, v| "#{k}: #{v}" }.join("\n")
95
- string + "\n\n#{body}"
96
- end
97
-
98
- def log_response_status(status, &block)
99
- case status
100
- when 200..399
101
- logger.info(&block)
102
- else
103
- logger.warn(&block)
104
- end
105
- end
106
- end
107
- end
7
+ case
8
+ when Gem::Dependency.new('', '> 2.0.0.alpha.pre.1').match?('', Faraday::VERSION)
9
+ require_relative 'middleware/current'
10
+ else
11
+ require_relative 'middleware/legacy'
108
12
  end
109
-
110
- Faraday::Response.register_middleware(detailed_logger: Faraday::DetailedLogger::Middleware)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Faraday
4
4
  module DetailedLogger
5
- VERSION = '2.3.0'
5
+ VERSION = '2.5.0'
6
6
  end
7
7
  end
@@ -3,7 +3,11 @@
3
3
  require 'faraday/detailed_logger/version'
4
4
  require 'faraday/detailed_logger/middleware'
5
5
 
6
+ require 'faraday'
7
+
6
8
  module Faraday
7
9
  module DetailedLogger
8
10
  end
9
11
  end
12
+
13
+ Faraday::Response.register_middleware(detailed_logger: Faraday::DetailedLogger::Middleware)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday-detailed_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Envy Labs
8
- autorequire:
9
- bindir: exe
8
+ autorequire:
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-11 00:00:00.000000000 Z
11
+ date: 2022-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.8'
19
+ version: '0.16'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '2'
22
+ version: '3'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.8'
29
+ version: '0.16'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '2'
32
+ version: '3'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: appraisal
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -58,20 +58,6 @@ dependencies:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '2.0'
61
- - !ruby/object:Gem::Dependency
62
- name: coveralls
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: 0.8.0
68
- type: :development
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: 0.8.0
75
61
  - !ruby/object:Gem::Dependency
76
62
  name: license_finder
77
63
  requirement: !ruby/object:Gem::Requirement
@@ -120,14 +106,14 @@ dependencies:
120
106
  requirements:
121
107
  - - "~>"
122
108
  - !ruby/object:Gem::Version
123
- version: 0.9.0
109
+ version: '1.3'
124
110
  type: :development
125
111
  prerelease: false
126
112
  version_requirements: !ruby/object:Gem::Requirement
127
113
  requirements:
128
114
  - - "~>"
129
115
  - !ruby/object:Gem::Version
130
- version: 0.9.0
116
+ version: '1.3'
131
117
  description: "\n A Faraday middleware for logging request and response activity
132
118
  including\n method, URI, headers, and body at varying log levels.\n "
133
119
  email:
@@ -136,40 +122,30 @@ executables: []
136
122
  extensions: []
137
123
  extra_rdoc_files: []
138
124
  files:
139
- - ".github/workflows/release.yml"
140
- - ".github/workflows/tests.yml"
141
- - ".gitignore"
142
125
  - ".rspec"
143
126
  - ".rubocop.yml"
144
- - ".travis.yml"
145
127
  - Appraisals
146
128
  - CHANGELOG.md
147
129
  - Gemfile
148
- - Gemfile.lock
149
130
  - LICENSE.txt
150
131
  - README.md
151
132
  - Rakefile
152
- - bin/console
153
- - bin/setup
154
- - doc/dependency_decisions.yml
155
133
  - faraday-detailed_logger.gemspec
156
- - gemfiles/faraday_0.8.gemfile
157
- - gemfiles/faraday_0.x.gemfile
158
- - gemfiles/faraday_1.x.gemfile
159
- - gemfiles/faraday_canary.gemfile
160
- - gemfiles/faraday_latest.gemfile
161
134
  - lib/faraday/detailed_logger.rb
135
+ - lib/faraday/detailed_logger/curl_formatter.rb
162
136
  - lib/faraday/detailed_logger/middleware.rb
137
+ - lib/faraday/detailed_logger/middleware/current.rb
138
+ - lib/faraday/detailed_logger/middleware/legacy.rb
163
139
  - lib/faraday/detailed_logger/tagged_logging.rb
164
140
  - lib/faraday/detailed_logger/version.rb
165
141
  homepage: https://github.com/envylabs/faraday-detailed_logger
166
142
  licenses:
167
143
  - MIT
168
144
  metadata:
169
- changelog_uri: https://github.com/envylabs/faraday-detailed_logger/blob/master/CHANGELOG.md
170
- source_code_uri: https://github.com/envylabs/faraday-detailed_logger
171
145
  bug_tracker_uri: https://github.com/envylabs/faraday-detailed_logger/issues
172
- post_install_message:
146
+ changelog_uri: https://github.com/envylabs/faraday-detailed_logger/blob/main/CHANGELOG.md
147
+ source_code_uri: https://github.com/envylabs/faraday-detailed_logger
148
+ post_install_message:
173
149
  rdoc_options: []
174
150
  require_paths:
175
151
  - lib
@@ -177,15 +153,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
177
153
  requirements:
178
154
  - - ">="
179
155
  - !ruby/object:Gem::Version
180
- version: '0'
156
+ version: 2.4.0
181
157
  required_rubygems_version: !ruby/object:Gem::Requirement
182
158
  requirements:
183
159
  - - ">="
184
160
  - !ruby/object:Gem::Version
185
161
  version: '0'
186
162
  requirements: []
187
- rubygems_version: 3.1.2
188
- signing_key:
163
+ rubygems_version: 3.2.31
164
+ signing_key:
189
165
  specification_version: 4
190
166
  summary: A detailed request and response logger for Faraday.
191
167
  test_files: []
@@ -1,36 +0,0 @@
1
- ---
2
-
3
- name: "Release"
4
-
5
- "on":
6
- push:
7
- tags:
8
- - "v*"
9
-
10
- jobs:
11
- github_packages:
12
- runs-on: "ubuntu-latest"
13
-
14
- steps:
15
- - uses: "actions/checkout@v1"
16
- - uses: "actions/setup-ruby@v1"
17
- with:
18
- ruby-version: "2.7"
19
- - name: "Publish to GitHub"
20
- uses: "jstastny/publish-gem-to-github@v1.1"
21
- with:
22
- token: "${{ secrets.GITHUB_TOKEN }}"
23
- owner: "envylabs"
24
-
25
- rubygems:
26
- runs-on: "ubuntu-latest"
27
-
28
- steps:
29
- - uses: "actions/checkout@v1"
30
- - uses: "actions/setup-ruby@v1"
31
- with:
32
- ruby-version: "2.7"
33
- - name: "Publish to Rubygems"
34
- uses: "dawidd6/action-publish-gem@v1.0.0"
35
- with:
36
- api_key: "${{secrets.RUBYGEMS_API_KEY}}"
@@ -1,44 +0,0 @@
1
- ---
2
-
3
- name: "Tests"
4
-
5
- "on": [push]
6
-
7
- jobs:
8
- tests:
9
- runs-on: "ubuntu-latest"
10
-
11
- strategy:
12
- matrix:
13
- gemfile:
14
- - "Gemfile"
15
- - "gemfiles/faraday_latest.gemfile"
16
- - "gemfiles/faraday_0.8.gemfile"
17
- - "gemfiles/faraday_0.x.gemfile"
18
- - "gemfiles/faraday_1.x.gemfile"
19
-
20
- steps:
21
- - uses: "actions/checkout@v1"
22
- - uses: "actions/setup-ruby@v1"
23
- with:
24
- ruby-version: "2.7"
25
- - uses: "actions/cache@v1"
26
- with:
27
- path: "vendor/bundle"
28
- key: "${{ runner.os }}-gems-${{ hashFiles(matrix.gemfile) }}"
29
- restore-keys: |
30
- ${{ runner.os }}-gems-
31
- - name: "Install Latest Bundler"
32
- run: |
33
- gem install bundler --no-document
34
- bundle config --global gemfile ${{ matrix.gemfile }}
35
- bundle config path vendor/bundle
36
- bundle config set without "tools benchmarks docs"
37
- - name: "Bundle Install"
38
- run: "bundle install --jobs 4 --retry 3"
39
- - name: "Run Tests"
40
- run: "bundle exec rake spec"
41
- - name: "Check Licenses"
42
- run: "bundle exec license_finder --quiet"
43
- - name: "Check Ruby Style"
44
- run: "bundle exec rubocop -c ./.rubocop.yml -fq"
data/.gitignore DELETED
@@ -1,15 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
12
-
13
- /.ruby-version
14
- /gemfiles/.bundle/
15
- /gemfiles/*.gemfile.lock
data/.travis.yml DELETED
@@ -1,37 +0,0 @@
1
- ---
2
-
3
- before_install:
4
- - "gem install bundler -v 2.1.4"
5
- before_script:
6
- - "bundle exec license_finder licenses add bundler MIT"
7
- branches:
8
- only:
9
- - "master"
10
- - '/^v\d+\.\d+\.\d+/'
11
- cache:
12
- bundler: true
13
- dist: "bionic"
14
- jobs:
15
- allow_failures:
16
- - gemfile: "gemfiles/faraday_canary.gemfile"
17
-
18
- fail_fast: true
19
-
20
- include:
21
- - stage: "Test"
22
-
23
- - stage: "Latest Faraday Release"
24
- gemfile: "gemfiles/faraday_latest.gemfile"
25
-
26
- - gemfile: "gemfiles/faraday_0.8.gemfile"
27
- stage: "Additional Faraday Tests"
28
- - gemfile: "gemfiles/faraday_0.x.gemfile"
29
- - gemfile: "gemfiles/faraday_1.x.gemfile"
30
- - gemfile: "gemfiles/faraday_canary.gemfile"
31
- language: "ruby"
32
- notifications:
33
- email: false
34
- script:
35
- - "bundle exec rake"
36
- - "bundle exec rubocop -fq"
37
- - "bundle exec license_finder --quiet"
data/Gemfile.lock DELETED
@@ -1,155 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- faraday-detailed_logger (2.3.0)
5
- faraday (>= 0.8, < 2)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- actionpack (6.0.2.1)
11
- actionview (= 6.0.2.1)
12
- activesupport (= 6.0.2.1)
13
- rack (~> 2.0, >= 2.0.8)
14
- rack-test (>= 0.6.3)
15
- rails-dom-testing (~> 2.0)
16
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
17
- actionview (6.0.2.1)
18
- activesupport (= 6.0.2.1)
19
- builder (~> 3.1)
20
- erubi (~> 1.4)
21
- rails-dom-testing (~> 2.0)
22
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
23
- activesupport (6.0.2.1)
24
- concurrent-ruby (~> 1.0, >= 1.0.2)
25
- i18n (>= 0.7, < 2)
26
- minitest (~> 5.1)
27
- tzinfo (~> 1.1)
28
- zeitwerk (~> 2.2)
29
- appraisal (2.2.0)
30
- bundler
31
- rake
32
- thor (>= 0.14.0)
33
- ast (2.4.0)
34
- builder (3.2.4)
35
- concurrent-ruby (1.1.6)
36
- coveralls (0.8.23)
37
- json (>= 1.8, < 3)
38
- simplecov (~> 0.16.1)
39
- term-ansicolor (~> 1.3)
40
- thor (>= 0.19.4, < 2.0)
41
- tins (~> 1.6)
42
- crass (1.0.6)
43
- diff-lcs (1.3)
44
- docile (1.3.2)
45
- erubi (1.9.0)
46
- faraday (1.0.0)
47
- multipart-post (>= 1.2, < 3)
48
- i18n (1.8.2)
49
- concurrent-ruby (~> 1.0)
50
- jaro_winkler (1.5.4)
51
- json (2.3.0)
52
- license_finder (6.0.0)
53
- bundler
54
- rubyzip (>= 1, < 3)
55
- thor
56
- toml (= 0.2.0)
57
- with_env (= 1.1.0)
58
- xml-simple
59
- loofah (2.4.0)
60
- crass (~> 1.0.2)
61
- nokogiri (>= 1.5.9)
62
- method_source (0.9.2)
63
- mini_portile2 (2.4.0)
64
- minitest (5.14.0)
65
- multipart-post (2.1.1)
66
- nokogiri (1.10.8)
67
- mini_portile2 (~> 2.4.0)
68
- parallel (1.19.1)
69
- parser (2.7.0.2)
70
- ast (~> 2.4.0)
71
- parslet (1.8.2)
72
- rack (2.2.2)
73
- rack-test (1.1.0)
74
- rack (>= 1.0, < 3)
75
- rails-dom-testing (2.0.3)
76
- activesupport (>= 4.2.0)
77
- nokogiri (>= 1.6)
78
- rails-html-sanitizer (1.3.0)
79
- loofah (~> 2.3)
80
- railties (6.0.2.1)
81
- actionpack (= 6.0.2.1)
82
- activesupport (= 6.0.2.1)
83
- method_source
84
- rake (>= 0.8.7)
85
- thor (>= 0.20.3, < 2.0)
86
- rainbow (3.0.0)
87
- rake (13.0.1)
88
- rspec (3.9.0)
89
- rspec-core (~> 3.9.0)
90
- rspec-expectations (~> 3.9.0)
91
- rspec-mocks (~> 3.9.0)
92
- rspec-core (3.9.1)
93
- rspec-support (~> 3.9.1)
94
- rspec-expectations (3.9.0)
95
- diff-lcs (>= 1.2.0, < 2.0)
96
- rspec-support (~> 3.9.0)
97
- rspec-mocks (3.9.1)
98
- diff-lcs (>= 1.2.0, < 2.0)
99
- rspec-support (~> 3.9.0)
100
- rspec-support (3.9.2)
101
- rubocop (0.79.0)
102
- jaro_winkler (~> 1.5.1)
103
- parallel (~> 1.10)
104
- parser (>= 2.7.0.1)
105
- rainbow (>= 2.2.2, < 4.0)
106
- ruby-progressbar (~> 1.7)
107
- unicode-display_width (>= 1.4.0, < 1.7)
108
- rubocop-performance (1.5.2)
109
- rubocop (>= 0.71.0)
110
- rubocop-rails (2.4.2)
111
- rack (>= 1.1)
112
- rubocop (>= 0.72.0)
113
- rubocop-rails_config (0.9.1)
114
- railties (>= 3.0)
115
- rubocop (~> 0.77)
116
- rubocop-performance (~> 1.3)
117
- rubocop-rails (~> 2.0)
118
- ruby-progressbar (1.10.1)
119
- rubyzip (2.2.0)
120
- simplecov (0.16.1)
121
- docile (~> 1.1)
122
- json (>= 1.8, < 3)
123
- simplecov-html (~> 0.10.0)
124
- simplecov-html (0.10.2)
125
- sync (0.5.0)
126
- term-ansicolor (1.7.1)
127
- tins (~> 1.0)
128
- thor (1.0.1)
129
- thread_safe (0.3.6)
130
- tins (1.24.1)
131
- sync
132
- toml (0.2.0)
133
- parslet (~> 1.8.0)
134
- tzinfo (1.2.6)
135
- thread_safe (~> 0.1)
136
- unicode-display_width (1.6.1)
137
- with_env (1.1.0)
138
- xml-simple (1.1.5)
139
- zeitwerk (2.2.2)
140
-
141
- PLATFORMS
142
- ruby
143
-
144
- DEPENDENCIES
145
- appraisal (~> 2.0)
146
- bundler (~> 2.0)
147
- coveralls (~> 0.8.0)
148
- faraday-detailed_logger!
149
- license_finder (~> 6.0)
150
- rake (~> 13.0)
151
- rspec (~> 3.0)
152
- rubocop-rails_config (~> 0.9.0)
153
-
154
- BUNDLED WITH
155
- 2.1.4
data/bin/console DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'faraday/detailed_logger'
6
-
7
- # You can add fixtures and/or initialization code here to make experimenting
8
- # with your gem easier. You can also use a different console, if you like.
9
-
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
- require 'irb'
15
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,25 +0,0 @@
1
- ---
2
- - - :permit
3
- - MIT
4
- - :who: Nathaniel Bibler
5
- :why: This license is FSF and OSI approved.
6
- :versions: []
7
- :when: 2018-02-20 17:46:01.372600000 Z
8
- - - :permit
9
- - Simplified BSD
10
- - :who: Nathaniel Bibler
11
- :why: This license is FSF and OSI approved.
12
- :versions: []
13
- :when: 2018-02-20 17:46:13.990005000 Z
14
- - - :permit
15
- - Ruby
16
- - :who: Nathaniel Bibler
17
- :why: This license is FSF approved.
18
- :versions: []
19
- :when: 2018-02-20 17:46:30.088049000 Z
20
- - - :permit
21
- - Apache-2.0
22
- - :who: Nathaniel Bibler
23
- :why: This license is FSF and OSI approved.
24
- :versions: []
25
- :when: 2018-02-20 17:46:53.048804000 Z
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "faraday", "~> 0.8.0"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "faraday", "~> 0.15"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "faraday", "~> 1.0"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "faraday", git: "https://github.com/lostisland/faraday.git"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "faraday"
6
-
7
- gemspec path: "../"