lhc 12.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +37 -0
  3. data/.rubocop.localch.yml +325 -0
  4. data/.rubocop.yml +61 -0
  5. data/.ruby-version +1 -0
  6. data/Gemfile +13 -0
  7. data/Gemfile.activesupport4 +4 -0
  8. data/Gemfile.activesupport5 +4 -0
  9. data/Gemfile.activesupport6 +4 -0
  10. data/LICENSE +674 -0
  11. data/README.md +984 -0
  12. data/Rakefile +25 -0
  13. data/cider-ci.yml +6 -0
  14. data/cider-ci/bin/bundle +51 -0
  15. data/cider-ci/bin/ruby_install +8 -0
  16. data/cider-ci/bin/ruby_version +25 -0
  17. data/cider-ci/jobs/rspec-activesupport-4.yml +28 -0
  18. data/cider-ci/jobs/rspec-activesupport-5.yml +27 -0
  19. data/cider-ci/jobs/rspec-activesupport-6.yml +28 -0
  20. data/cider-ci/jobs/rubocop.yml +18 -0
  21. data/cider-ci/task_components/bundle.yml +22 -0
  22. data/cider-ci/task_components/rspec.yml +36 -0
  23. data/cider-ci/task_components/rubocop.yml +29 -0
  24. data/cider-ci/task_components/ruby.yml +15 -0
  25. data/friday.yml +3 -0
  26. data/lhc.gemspec +39 -0
  27. data/lib/core_ext/hash/deep_transform_values.rb +48 -0
  28. data/lib/lhc.rb +136 -0
  29. data/lib/lhc/concerns/lhc/basic_methods_concern.rb +42 -0
  30. data/lib/lhc/concerns/lhc/configuration_concern.rb +20 -0
  31. data/lib/lhc/concerns/lhc/fix_invalid_encoding_concern.rb +42 -0
  32. data/lib/lhc/concerns/lhc/formats_concern.rb +25 -0
  33. data/lib/lhc/concerns/lhc/request/user_agent_concern.rb +25 -0
  34. data/lib/lhc/config.rb +47 -0
  35. data/lib/lhc/endpoint.rb +119 -0
  36. data/lib/lhc/error.rb +80 -0
  37. data/lib/lhc/errors/client_error.rb +73 -0
  38. data/lib/lhc/errors/parser_error.rb +4 -0
  39. data/lib/lhc/errors/server_error.rb +28 -0
  40. data/lib/lhc/errors/timeout.rb +4 -0
  41. data/lib/lhc/errors/unknown_error.rb +4 -0
  42. data/lib/lhc/format.rb +18 -0
  43. data/lib/lhc/formats.rb +8 -0
  44. data/lib/lhc/formats/form.rb +45 -0
  45. data/lib/lhc/formats/json.rb +55 -0
  46. data/lib/lhc/formats/multipart.rb +45 -0
  47. data/lib/lhc/formats/plain.rb +42 -0
  48. data/lib/lhc/interceptor.rb +32 -0
  49. data/lib/lhc/interceptors.rb +26 -0
  50. data/lib/lhc/interceptors/auth.rb +98 -0
  51. data/lib/lhc/interceptors/caching.rb +127 -0
  52. data/lib/lhc/interceptors/default_timeout.rb +16 -0
  53. data/lib/lhc/interceptors/logging.rb +37 -0
  54. data/lib/lhc/interceptors/monitoring.rb +63 -0
  55. data/lib/lhc/interceptors/prometheus.rb +51 -0
  56. data/lib/lhc/interceptors/retry.rb +41 -0
  57. data/lib/lhc/interceptors/rollbar.rb +36 -0
  58. data/lib/lhc/interceptors/throttle.rb +81 -0
  59. data/lib/lhc/interceptors/zipkin.rb +110 -0
  60. data/lib/lhc/railtie.rb +10 -0
  61. data/lib/lhc/request.rb +157 -0
  62. data/lib/lhc/response.rb +60 -0
  63. data/lib/lhc/response/data.rb +28 -0
  64. data/lib/lhc/response/data/base.rb +22 -0
  65. data/lib/lhc/response/data/collection.rb +16 -0
  66. data/lib/lhc/response/data/item.rb +29 -0
  67. data/lib/lhc/rspec.rb +12 -0
  68. data/lib/lhc/test/cache_helper.rb +3 -0
  69. data/lib/lhc/version.rb +5 -0
  70. data/script/ci/build.sh +19 -0
  71. data/spec/basic_methods/delete_spec.rb +34 -0
  72. data/spec/basic_methods/get_spec.rb +49 -0
  73. data/spec/basic_methods/post_spec.rb +42 -0
  74. data/spec/basic_methods/put_spec.rb +48 -0
  75. data/spec/basic_methods/request_spec.rb +19 -0
  76. data/spec/basic_methods/request_without_rails_spec.rb +29 -0
  77. data/spec/config/endpoints_spec.rb +63 -0
  78. data/spec/config/placeholders_spec.rb +32 -0
  79. data/spec/core_ext/hash/deep_transform_values_spec.rb +24 -0
  80. data/spec/dummy/README.rdoc +28 -0
  81. data/spec/dummy/Rakefile +8 -0
  82. data/spec/dummy/app/assets/config/manifest.js +3 -0
  83. data/spec/dummy/app/assets/images/.keep +0 -0
  84. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  85. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  86. data/spec/dummy/app/controllers/application_controller.rb +7 -0
  87. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  88. data/spec/dummy/app/helpers/application_helper.rb +4 -0
  89. data/spec/dummy/app/mailers/.keep +0 -0
  90. data/spec/dummy/app/models/.keep +0 -0
  91. data/spec/dummy/app/models/concerns/.keep +0 -0
  92. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  93. data/spec/dummy/bin/bundle +5 -0
  94. data/spec/dummy/bin/rails +6 -0
  95. data/spec/dummy/bin/rake +6 -0
  96. data/spec/dummy/config.ru +6 -0
  97. data/spec/dummy/config/application.rb +16 -0
  98. data/spec/dummy/config/boot.rb +7 -0
  99. data/spec/dummy/config/environment.rb +7 -0
  100. data/spec/dummy/config/environments/development.rb +36 -0
  101. data/spec/dummy/config/environments/production.rb +77 -0
  102. data/spec/dummy/config/environments/test.rb +41 -0
  103. data/spec/dummy/config/initializers/assets.rb +10 -0
  104. data/spec/dummy/config/initializers/backtrace_silencers.rb +9 -0
  105. data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
  106. data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
  107. data/spec/dummy/config/initializers/inflections.rb +18 -0
  108. data/spec/dummy/config/initializers/mime_types.rb +6 -0
  109. data/spec/dummy/config/initializers/session_store.rb +5 -0
  110. data/spec/dummy/config/initializers/wrap_parameters.rb +11 -0
  111. data/spec/dummy/config/locales/en.yml +23 -0
  112. data/spec/dummy/config/routes.rb +58 -0
  113. data/spec/dummy/config/secrets.yml +22 -0
  114. data/spec/dummy/lib/assets/.keep +0 -0
  115. data/spec/dummy/log/.keep +0 -0
  116. data/spec/dummy/public/404.html +67 -0
  117. data/spec/dummy/public/422.html +67 -0
  118. data/spec/dummy/public/500.html +66 -0
  119. data/spec/dummy/public/favicon.ico +0 -0
  120. data/spec/endpoint/compile_spec.rb +35 -0
  121. data/spec/endpoint/match_spec.rb +41 -0
  122. data/spec/endpoint/placeholders_spec.rb +30 -0
  123. data/spec/endpoint/remove_interpolated_params_spec.rb +17 -0
  124. data/spec/endpoint/values_as_params_spec.rb +31 -0
  125. data/spec/error/dup_spec.rb +12 -0
  126. data/spec/error/find_spec.rb +57 -0
  127. data/spec/error/response_spec.rb +17 -0
  128. data/spec/error/timeout_spec.rb +14 -0
  129. data/spec/error/to_s_spec.rb +80 -0
  130. data/spec/formats/form_spec.rb +27 -0
  131. data/spec/formats/json_spec.rb +66 -0
  132. data/spec/formats/multipart_spec.rb +26 -0
  133. data/spec/formats/plain_spec.rb +29 -0
  134. data/spec/interceptors/after_request_spec.rb +20 -0
  135. data/spec/interceptors/after_response_spec.rb +39 -0
  136. data/spec/interceptors/auth/basic_auth_spec.rb +17 -0
  137. data/spec/interceptors/auth/bearer_spec.rb +19 -0
  138. data/spec/interceptors/auth/reauthentication_configuration_spec.rb +61 -0
  139. data/spec/interceptors/auth/reauthentication_spec.rb +44 -0
  140. data/spec/interceptors/before_request_spec.rb +21 -0
  141. data/spec/interceptors/before_response_spec.rb +20 -0
  142. data/spec/interceptors/caching/hydra_spec.rb +26 -0
  143. data/spec/interceptors/caching/main_spec.rb +73 -0
  144. data/spec/interceptors/caching/methods_spec.rb +42 -0
  145. data/spec/interceptors/caching/options_spec.rb +89 -0
  146. data/spec/interceptors/caching/parameters_spec.rb +24 -0
  147. data/spec/interceptors/caching/response_status_spec.rb +29 -0
  148. data/spec/interceptors/caching/to_cache_spec.rb +16 -0
  149. data/spec/interceptors/default_interceptors_spec.rb +15 -0
  150. data/spec/interceptors/default_timeout/main_spec.rb +34 -0
  151. data/spec/interceptors/define_spec.rb +29 -0
  152. data/spec/interceptors/dup_spec.rb +19 -0
  153. data/spec/interceptors/logging/main_spec.rb +37 -0
  154. data/spec/interceptors/monitoring/main_spec.rb +97 -0
  155. data/spec/interceptors/prometheus_spec.rb +54 -0
  156. data/spec/interceptors/response_competition_spec.rb +41 -0
  157. data/spec/interceptors/retry/main_spec.rb +73 -0
  158. data/spec/interceptors/return_response_spec.rb +38 -0
  159. data/spec/interceptors/rollbar/invalid_encoding_spec.rb +43 -0
  160. data/spec/interceptors/rollbar/main_spec.rb +57 -0
  161. data/spec/interceptors/throttle/main_spec.rb +106 -0
  162. data/spec/interceptors/throttle/reset_track_spec.rb +53 -0
  163. data/spec/interceptors/zipkin/distributed_tracing_spec.rb +135 -0
  164. data/spec/rails_helper.rb +6 -0
  165. data/spec/request/body_spec.rb +39 -0
  166. data/spec/request/encoding_spec.rb +37 -0
  167. data/spec/request/error_handling_spec.rb +88 -0
  168. data/spec/request/headers_spec.rb +12 -0
  169. data/spec/request/ignore_errors_spec.rb +73 -0
  170. data/spec/request/option_dup_spec.rb +13 -0
  171. data/spec/request/parallel_requests_spec.rb +59 -0
  172. data/spec/request/params_encoding_spec.rb +26 -0
  173. data/spec/request/request_without_rails_spec.rb +15 -0
  174. data/spec/request/url_patterns_spec.rb +54 -0
  175. data/spec/request/user_agent_spec.rb +26 -0
  176. data/spec/request/user_agent_without_rails_spec.rb +27 -0
  177. data/spec/response/body_spec.rb +16 -0
  178. data/spec/response/code_spec.rb +16 -0
  179. data/spec/response/data_accessor_spec.rb +29 -0
  180. data/spec/response/data_spec.rb +61 -0
  181. data/spec/response/effective_url_spec.rb +16 -0
  182. data/spec/response/headers_spec.rb +18 -0
  183. data/spec/response/options_spec.rb +18 -0
  184. data/spec/response/success_spec.rb +13 -0
  185. data/spec/response/time_spec.rb +21 -0
  186. data/spec/spec_helper.rb +8 -0
  187. data/spec/support/fixtures/json/feedback.json +11 -0
  188. data/spec/support/fixtures/json/feedbacks.json +164 -0
  189. data/spec/support/fixtures/json/localina_content_ad.json +23 -0
  190. data/spec/support/load_json.rb +5 -0
  191. data/spec/support/reset_config.rb +7 -0
  192. data/spec/support/zipkin_mock.rb +113 -0
  193. data/spec/timeouts/no_signal_spec.rb +13 -0
  194. data/spec/timeouts/timings_spec.rb +55 -0
  195. metadata +534 -0
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ def load_json(name)
4
+ File.read("spec/support/fixtures/json/#{name}.json")
5
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.configure do |config|
4
+ config.before(:each) do
5
+ LHC::Config.instance.reset
6
+ end
7
+ end
@@ -0,0 +1,113 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ZipkinTracer
4
+ class TraceContainer
5
+ attr_reader :trace_id, :parent_id, :span_id, :sampled, :flags
6
+ class << self
7
+ attr_accessor :current
8
+
9
+ def setup_mock(trace_id:, parent_id:, span_id:, sampled:, flags:)
10
+ @current = new(trace_id: trace_id, parent_id: parent_id, span_id: span_id, sampled: sampled, flags: flags)
11
+ end
12
+
13
+ def with_trace_id(trace_id)
14
+ yield trace_id
15
+ end
16
+ end
17
+
18
+ def initialize(trace_id:, parent_id:, span_id:, sampled:, flags:)
19
+ @trace_id = trace_id
20
+ @parent_id = parent_id
21
+ @span_id = span_id
22
+ @sampled = sampled
23
+ @flags = flags
24
+ end
25
+ end
26
+
27
+ class TraceGenerator
28
+ def next_trace_id
29
+ TraceId.new
30
+ end
31
+ end
32
+
33
+ class TraceId
34
+ def trace_id
35
+ 'trace_id'
36
+ end
37
+
38
+ def parent_id
39
+ 'parent_id'
40
+ end
41
+
42
+ def span_id
43
+ 'span_id'
44
+ end
45
+
46
+ def sampled
47
+ ZipkinTracer::TraceContainer.current.sampled
48
+ end
49
+
50
+ def flags
51
+ 'flags'
52
+ end
53
+
54
+ def sampled?
55
+ ZipkinTracer::TraceContainer.current.sampled
56
+ end
57
+ end
58
+
59
+ class Span
60
+ def record_tag(*); end
61
+
62
+ def record(*); end
63
+ end
64
+ end
65
+
66
+ module Trace
67
+ def self.default_endpoint
68
+ Endpoint.new
69
+ end
70
+
71
+ def self.tracer
72
+ Tracer.new
73
+ end
74
+
75
+ class Tracer
76
+ def start_span(*)
77
+ return ZipkinTracer::Span.new
78
+ end
79
+
80
+ def end_span(*)
81
+ return ZipkinTracer::Span.new
82
+ end
83
+ end
84
+
85
+ class Annotation
86
+ CLIENT_SEND = 'client_send'
87
+ CLIENT_RECV = 'client_recv'
88
+ end
89
+
90
+ class BinaryAnnotation
91
+ PATH = 'path'
92
+ SERVER_ADDRESS = 'server_address'
93
+ STATUS = 'status'
94
+ ERROR = 'error'
95
+
96
+ class Type
97
+ STRING = 'string'
98
+ BOOL = 'bool'
99
+ end
100
+ end
101
+
102
+ class Endpoint
103
+ class << self
104
+ def remote_endpoint(*)
105
+ new
106
+ end
107
+ end
108
+
109
+ def ip_format
110
+ 'ipv4'
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rails_helper'
4
+
5
+ describe LHC::Request do
6
+ context 'timeouts' do
7
+ it 'has no_signal options set to true by default' do
8
+ expect_any_instance_of(Ethon::Easy).to receive(:http_request).with(anything, anything, hash_including(nosignal: true)).and_call_original
9
+ stub_request(:get, "http://local.ch/")
10
+ LHC.get('http://local.ch')
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rails_helper'
4
+
5
+ describe LHC::Request do
6
+ context 'timeouts' do
7
+ context "when timeout is not a whole number and timeout_ms is not set" do
8
+ let(:options) { { timeout: 0.1 } }
9
+
10
+ it "ceils timeout and sets timeout_ms" do
11
+ expect_any_instance_of(Ethon::Easy).to receive(:http_request)
12
+ .with(anything, anything, hash_including(timeout_ms: 100, timeout: 1))
13
+ .and_call_original
14
+ stub_request(:get, "http://local.ch/")
15
+ LHC.get('http://local.ch', options)
16
+ end
17
+ end
18
+
19
+ context "when timeout is not a whole number and timeout_ms is set" do
20
+ let(:options) { { timeout: 0.1, timeout_ms: 123 } }
21
+
22
+ it "ceils timeout and does not change timeout_ms" do
23
+ expect_any_instance_of(Ethon::Easy).to receive(:http_request)
24
+ .with(anything, anything, hash_including(timeout_ms: 123, timeout: 1))
25
+ .and_call_original
26
+ stub_request(:get, "http://local.ch/")
27
+ LHC.get('http://local.ch', options)
28
+ end
29
+ end
30
+
31
+ context "when connecttimeout is not a whole number and connecttimeout_ms is not set" do
32
+ let(:options) { { connecttimeout: 0.1 } }
33
+
34
+ it "ceils connecttimeout and sets connecttimeout_ms" do
35
+ expect_any_instance_of(Ethon::Easy).to receive(:http_request)
36
+ .with(anything, anything, hash_including(connecttimeout_ms: 100, connecttimeout: 1))
37
+ .and_call_original
38
+ stub_request(:get, "http://local.ch/")
39
+ LHC.get('http://local.ch', options)
40
+ end
41
+ end
42
+
43
+ context "when connecttimeout is not a whole number and connecttimeout_ms is set" do
44
+ let(:options) { { connecttimeout: 0.1, connecttimeout_ms: 123 } }
45
+
46
+ it "ceils connecttimeout and does not change connecttimeout_ms" do
47
+ expect_any_instance_of(Ethon::Easy).to receive(:http_request)
48
+ .with(anything, anything, hash_including(connecttimeout_ms: 123, connecttimeout: 1))
49
+ .and_call_original
50
+ stub_request(:get, "http://local.ch/")
51
+ LHC.get('http://local.ch', options)
52
+ end
53
+ end
54
+ end
55
+ end
metadata ADDED
@@ -0,0 +1,534 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lhc
3
+ version: !ruby/object:Gem::Version
4
+ version: 12.0.0
5
+ platform: ruby
6
+ authors:
7
+ - https://github.com/local-ch/lhc/contributors
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-07-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '4.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: addressable
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: typhoeus
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0.11'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0.11'
55
+ - !ruby/object:Gem::Dependency
56
+ name: geminabox
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: prometheus-client
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.7.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.7.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rails
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '4.2'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '4.2'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec-rails
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: 3.0.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: 3.0.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.57.1
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.57.1
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop-rspec
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 1.26.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 1.26.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: timecop
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: webmock
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ description: LHC is an extended/advanced HTTP client. Implementing basic http-communication
182
+ enhancements like interceptors, exception handling, format handling, accessing response
183
+ data, configuring endpoints and placeholders and fully compatible, RFC-compliant
184
+ URL-template support.
185
+ email:
186
+ - web@localsearch.ch
187
+ executables: []
188
+ extensions: []
189
+ extra_rdoc_files: []
190
+ files:
191
+ - ".gitignore"
192
+ - ".rubocop.localch.yml"
193
+ - ".rubocop.yml"
194
+ - ".ruby-version"
195
+ - Gemfile
196
+ - Gemfile.activesupport4
197
+ - Gemfile.activesupport5
198
+ - Gemfile.activesupport6
199
+ - LICENSE
200
+ - README.md
201
+ - Rakefile
202
+ - cider-ci.yml
203
+ - cider-ci/bin/bundle
204
+ - cider-ci/bin/ruby_install
205
+ - cider-ci/bin/ruby_version
206
+ - cider-ci/jobs/rspec-activesupport-4.yml
207
+ - cider-ci/jobs/rspec-activesupport-5.yml
208
+ - cider-ci/jobs/rspec-activesupport-6.yml
209
+ - cider-ci/jobs/rubocop.yml
210
+ - cider-ci/task_components/bundle.yml
211
+ - cider-ci/task_components/rspec.yml
212
+ - cider-ci/task_components/rubocop.yml
213
+ - cider-ci/task_components/ruby.yml
214
+ - friday.yml
215
+ - lhc.gemspec
216
+ - lib/core_ext/hash/deep_transform_values.rb
217
+ - lib/lhc.rb
218
+ - lib/lhc/concerns/lhc/basic_methods_concern.rb
219
+ - lib/lhc/concerns/lhc/configuration_concern.rb
220
+ - lib/lhc/concerns/lhc/fix_invalid_encoding_concern.rb
221
+ - lib/lhc/concerns/lhc/formats_concern.rb
222
+ - lib/lhc/concerns/lhc/request/user_agent_concern.rb
223
+ - lib/lhc/config.rb
224
+ - lib/lhc/endpoint.rb
225
+ - lib/lhc/error.rb
226
+ - lib/lhc/errors/client_error.rb
227
+ - lib/lhc/errors/parser_error.rb
228
+ - lib/lhc/errors/server_error.rb
229
+ - lib/lhc/errors/timeout.rb
230
+ - lib/lhc/errors/unknown_error.rb
231
+ - lib/lhc/format.rb
232
+ - lib/lhc/formats.rb
233
+ - lib/lhc/formats/form.rb
234
+ - lib/lhc/formats/json.rb
235
+ - lib/lhc/formats/multipart.rb
236
+ - lib/lhc/formats/plain.rb
237
+ - lib/lhc/interceptor.rb
238
+ - lib/lhc/interceptors.rb
239
+ - lib/lhc/interceptors/auth.rb
240
+ - lib/lhc/interceptors/caching.rb
241
+ - lib/lhc/interceptors/default_timeout.rb
242
+ - lib/lhc/interceptors/logging.rb
243
+ - lib/lhc/interceptors/monitoring.rb
244
+ - lib/lhc/interceptors/prometheus.rb
245
+ - lib/lhc/interceptors/retry.rb
246
+ - lib/lhc/interceptors/rollbar.rb
247
+ - lib/lhc/interceptors/throttle.rb
248
+ - lib/lhc/interceptors/zipkin.rb
249
+ - lib/lhc/railtie.rb
250
+ - lib/lhc/request.rb
251
+ - lib/lhc/response.rb
252
+ - lib/lhc/response/data.rb
253
+ - lib/lhc/response/data/base.rb
254
+ - lib/lhc/response/data/collection.rb
255
+ - lib/lhc/response/data/item.rb
256
+ - lib/lhc/rspec.rb
257
+ - lib/lhc/test/cache_helper.rb
258
+ - lib/lhc/version.rb
259
+ - script/ci/build.sh
260
+ - spec/basic_methods/delete_spec.rb
261
+ - spec/basic_methods/get_spec.rb
262
+ - spec/basic_methods/post_spec.rb
263
+ - spec/basic_methods/put_spec.rb
264
+ - spec/basic_methods/request_spec.rb
265
+ - spec/basic_methods/request_without_rails_spec.rb
266
+ - spec/config/endpoints_spec.rb
267
+ - spec/config/placeholders_spec.rb
268
+ - spec/core_ext/hash/deep_transform_values_spec.rb
269
+ - spec/dummy/README.rdoc
270
+ - spec/dummy/Rakefile
271
+ - spec/dummy/app/assets/config/manifest.js
272
+ - spec/dummy/app/assets/images/.keep
273
+ - spec/dummy/app/assets/javascripts/application.js
274
+ - spec/dummy/app/assets/stylesheets/application.css
275
+ - spec/dummy/app/controllers/application_controller.rb
276
+ - spec/dummy/app/controllers/concerns/.keep
277
+ - spec/dummy/app/helpers/application_helper.rb
278
+ - spec/dummy/app/mailers/.keep
279
+ - spec/dummy/app/models/.keep
280
+ - spec/dummy/app/models/concerns/.keep
281
+ - spec/dummy/app/views/layouts/application.html.erb
282
+ - spec/dummy/bin/bundle
283
+ - spec/dummy/bin/rails
284
+ - spec/dummy/bin/rake
285
+ - spec/dummy/config.ru
286
+ - spec/dummy/config/application.rb
287
+ - spec/dummy/config/boot.rb
288
+ - spec/dummy/config/environment.rb
289
+ - spec/dummy/config/environments/development.rb
290
+ - spec/dummy/config/environments/production.rb
291
+ - spec/dummy/config/environments/test.rb
292
+ - spec/dummy/config/initializers/assets.rb
293
+ - spec/dummy/config/initializers/backtrace_silencers.rb
294
+ - spec/dummy/config/initializers/cookies_serializer.rb
295
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
296
+ - spec/dummy/config/initializers/inflections.rb
297
+ - spec/dummy/config/initializers/mime_types.rb
298
+ - spec/dummy/config/initializers/session_store.rb
299
+ - spec/dummy/config/initializers/wrap_parameters.rb
300
+ - spec/dummy/config/locales/en.yml
301
+ - spec/dummy/config/routes.rb
302
+ - spec/dummy/config/secrets.yml
303
+ - spec/dummy/lib/assets/.keep
304
+ - spec/dummy/log/.keep
305
+ - spec/dummy/public/404.html
306
+ - spec/dummy/public/422.html
307
+ - spec/dummy/public/500.html
308
+ - spec/dummy/public/favicon.ico
309
+ - spec/dummy/tmp/cache/.gitkeep
310
+ - spec/endpoint/compile_spec.rb
311
+ - spec/endpoint/match_spec.rb
312
+ - spec/endpoint/placeholders_spec.rb
313
+ - spec/endpoint/remove_interpolated_params_spec.rb
314
+ - spec/endpoint/values_as_params_spec.rb
315
+ - spec/error/dup_spec.rb
316
+ - spec/error/find_spec.rb
317
+ - spec/error/response_spec.rb
318
+ - spec/error/timeout_spec.rb
319
+ - spec/error/to_s_spec.rb
320
+ - spec/formats/form_spec.rb
321
+ - spec/formats/json_spec.rb
322
+ - spec/formats/multipart_spec.rb
323
+ - spec/formats/plain_spec.rb
324
+ - spec/interceptors/after_request_spec.rb
325
+ - spec/interceptors/after_response_spec.rb
326
+ - spec/interceptors/auth/basic_auth_spec.rb
327
+ - spec/interceptors/auth/bearer_spec.rb
328
+ - spec/interceptors/auth/reauthentication_configuration_spec.rb
329
+ - spec/interceptors/auth/reauthentication_spec.rb
330
+ - spec/interceptors/before_request_spec.rb
331
+ - spec/interceptors/before_response_spec.rb
332
+ - spec/interceptors/caching/hydra_spec.rb
333
+ - spec/interceptors/caching/main_spec.rb
334
+ - spec/interceptors/caching/methods_spec.rb
335
+ - spec/interceptors/caching/options_spec.rb
336
+ - spec/interceptors/caching/parameters_spec.rb
337
+ - spec/interceptors/caching/response_status_spec.rb
338
+ - spec/interceptors/caching/to_cache_spec.rb
339
+ - spec/interceptors/default_interceptors_spec.rb
340
+ - spec/interceptors/default_timeout/main_spec.rb
341
+ - spec/interceptors/define_spec.rb
342
+ - spec/interceptors/dup_spec.rb
343
+ - spec/interceptors/logging/main_spec.rb
344
+ - spec/interceptors/monitoring/main_spec.rb
345
+ - spec/interceptors/prometheus_spec.rb
346
+ - spec/interceptors/response_competition_spec.rb
347
+ - spec/interceptors/retry/main_spec.rb
348
+ - spec/interceptors/return_response_spec.rb
349
+ - spec/interceptors/rollbar/invalid_encoding_spec.rb
350
+ - spec/interceptors/rollbar/main_spec.rb
351
+ - spec/interceptors/throttle/main_spec.rb
352
+ - spec/interceptors/throttle/reset_track_spec.rb
353
+ - spec/interceptors/zipkin/distributed_tracing_spec.rb
354
+ - spec/rails_helper.rb
355
+ - spec/request/body_spec.rb
356
+ - spec/request/encoding_spec.rb
357
+ - spec/request/error_handling_spec.rb
358
+ - spec/request/headers_spec.rb
359
+ - spec/request/ignore_errors_spec.rb
360
+ - spec/request/option_dup_spec.rb
361
+ - spec/request/parallel_requests_spec.rb
362
+ - spec/request/params_encoding_spec.rb
363
+ - spec/request/request_without_rails_spec.rb
364
+ - spec/request/url_patterns_spec.rb
365
+ - spec/request/user_agent_spec.rb
366
+ - spec/request/user_agent_without_rails_spec.rb
367
+ - spec/response/body_spec.rb
368
+ - spec/response/code_spec.rb
369
+ - spec/response/data_accessor_spec.rb
370
+ - spec/response/data_spec.rb
371
+ - spec/response/effective_url_spec.rb
372
+ - spec/response/headers_spec.rb
373
+ - spec/response/options_spec.rb
374
+ - spec/response/success_spec.rb
375
+ - spec/response/time_spec.rb
376
+ - spec/spec_helper.rb
377
+ - spec/support/fixtures/json/feedback.json
378
+ - spec/support/fixtures/json/feedbacks.json
379
+ - spec/support/fixtures/json/localina_content_ad.json
380
+ - spec/support/load_json.rb
381
+ - spec/support/reset_config.rb
382
+ - spec/support/zipkin_mock.rb
383
+ - spec/timeouts/no_signal_spec.rb
384
+ - spec/timeouts/timings_spec.rb
385
+ homepage: https://github.com/local-ch/lhc
386
+ licenses:
387
+ - GPL-3
388
+ metadata: {}
389
+ post_install_message:
390
+ rdoc_options: []
391
+ require_paths:
392
+ - lib
393
+ required_ruby_version: !ruby/object:Gem::Requirement
394
+ requirements:
395
+ - - ">="
396
+ - !ruby/object:Gem::Version
397
+ version: '0'
398
+ required_rubygems_version: !ruby/object:Gem::Requirement
399
+ requirements:
400
+ - - ">="
401
+ - !ruby/object:Gem::Version
402
+ version: '0'
403
+ requirements:
404
+ - Ruby >= 2.0.0
405
+ rubygems_version: 3.0.6
406
+ signing_key:
407
+ specification_version: 4
408
+ summary: Advanced HTTP Client for Ruby, fueled with interceptors
409
+ test_files:
410
+ - spec/basic_methods/delete_spec.rb
411
+ - spec/basic_methods/get_spec.rb
412
+ - spec/basic_methods/post_spec.rb
413
+ - spec/basic_methods/put_spec.rb
414
+ - spec/basic_methods/request_spec.rb
415
+ - spec/basic_methods/request_without_rails_spec.rb
416
+ - spec/config/endpoints_spec.rb
417
+ - spec/config/placeholders_spec.rb
418
+ - spec/core_ext/hash/deep_transform_values_spec.rb
419
+ - spec/dummy/README.rdoc
420
+ - spec/dummy/Rakefile
421
+ - spec/dummy/app/assets/config/manifest.js
422
+ - spec/dummy/app/assets/images/.keep
423
+ - spec/dummy/app/assets/javascripts/application.js
424
+ - spec/dummy/app/assets/stylesheets/application.css
425
+ - spec/dummy/app/controllers/application_controller.rb
426
+ - spec/dummy/app/controllers/concerns/.keep
427
+ - spec/dummy/app/helpers/application_helper.rb
428
+ - spec/dummy/app/mailers/.keep
429
+ - spec/dummy/app/models/.keep
430
+ - spec/dummy/app/models/concerns/.keep
431
+ - spec/dummy/app/views/layouts/application.html.erb
432
+ - spec/dummy/bin/bundle
433
+ - spec/dummy/bin/rails
434
+ - spec/dummy/bin/rake
435
+ - spec/dummy/config.ru
436
+ - spec/dummy/config/application.rb
437
+ - spec/dummy/config/boot.rb
438
+ - spec/dummy/config/environment.rb
439
+ - spec/dummy/config/environments/development.rb
440
+ - spec/dummy/config/environments/production.rb
441
+ - spec/dummy/config/environments/test.rb
442
+ - spec/dummy/config/initializers/assets.rb
443
+ - spec/dummy/config/initializers/backtrace_silencers.rb
444
+ - spec/dummy/config/initializers/cookies_serializer.rb
445
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
446
+ - spec/dummy/config/initializers/inflections.rb
447
+ - spec/dummy/config/initializers/mime_types.rb
448
+ - spec/dummy/config/initializers/session_store.rb
449
+ - spec/dummy/config/initializers/wrap_parameters.rb
450
+ - spec/dummy/config/locales/en.yml
451
+ - spec/dummy/config/routes.rb
452
+ - spec/dummy/config/secrets.yml
453
+ - spec/dummy/lib/assets/.keep
454
+ - spec/dummy/log/.keep
455
+ - spec/dummy/public/404.html
456
+ - spec/dummy/public/422.html
457
+ - spec/dummy/public/500.html
458
+ - spec/dummy/public/favicon.ico
459
+ - spec/dummy/tmp/cache/.gitkeep
460
+ - spec/endpoint/compile_spec.rb
461
+ - spec/endpoint/match_spec.rb
462
+ - spec/endpoint/placeholders_spec.rb
463
+ - spec/endpoint/remove_interpolated_params_spec.rb
464
+ - spec/endpoint/values_as_params_spec.rb
465
+ - spec/error/dup_spec.rb
466
+ - spec/error/find_spec.rb
467
+ - spec/error/response_spec.rb
468
+ - spec/error/timeout_spec.rb
469
+ - spec/error/to_s_spec.rb
470
+ - spec/formats/form_spec.rb
471
+ - spec/formats/json_spec.rb
472
+ - spec/formats/multipart_spec.rb
473
+ - spec/formats/plain_spec.rb
474
+ - spec/interceptors/after_request_spec.rb
475
+ - spec/interceptors/after_response_spec.rb
476
+ - spec/interceptors/auth/basic_auth_spec.rb
477
+ - spec/interceptors/auth/bearer_spec.rb
478
+ - spec/interceptors/auth/reauthentication_configuration_spec.rb
479
+ - spec/interceptors/auth/reauthentication_spec.rb
480
+ - spec/interceptors/before_request_spec.rb
481
+ - spec/interceptors/before_response_spec.rb
482
+ - spec/interceptors/caching/hydra_spec.rb
483
+ - spec/interceptors/caching/main_spec.rb
484
+ - spec/interceptors/caching/methods_spec.rb
485
+ - spec/interceptors/caching/options_spec.rb
486
+ - spec/interceptors/caching/parameters_spec.rb
487
+ - spec/interceptors/caching/response_status_spec.rb
488
+ - spec/interceptors/caching/to_cache_spec.rb
489
+ - spec/interceptors/default_interceptors_spec.rb
490
+ - spec/interceptors/default_timeout/main_spec.rb
491
+ - spec/interceptors/define_spec.rb
492
+ - spec/interceptors/dup_spec.rb
493
+ - spec/interceptors/logging/main_spec.rb
494
+ - spec/interceptors/monitoring/main_spec.rb
495
+ - spec/interceptors/prometheus_spec.rb
496
+ - spec/interceptors/response_competition_spec.rb
497
+ - spec/interceptors/retry/main_spec.rb
498
+ - spec/interceptors/return_response_spec.rb
499
+ - spec/interceptors/rollbar/invalid_encoding_spec.rb
500
+ - spec/interceptors/rollbar/main_spec.rb
501
+ - spec/interceptors/throttle/main_spec.rb
502
+ - spec/interceptors/throttle/reset_track_spec.rb
503
+ - spec/interceptors/zipkin/distributed_tracing_spec.rb
504
+ - spec/rails_helper.rb
505
+ - spec/request/body_spec.rb
506
+ - spec/request/encoding_spec.rb
507
+ - spec/request/error_handling_spec.rb
508
+ - spec/request/headers_spec.rb
509
+ - spec/request/ignore_errors_spec.rb
510
+ - spec/request/option_dup_spec.rb
511
+ - spec/request/parallel_requests_spec.rb
512
+ - spec/request/params_encoding_spec.rb
513
+ - spec/request/request_without_rails_spec.rb
514
+ - spec/request/url_patterns_spec.rb
515
+ - spec/request/user_agent_spec.rb
516
+ - spec/request/user_agent_without_rails_spec.rb
517
+ - spec/response/body_spec.rb
518
+ - spec/response/code_spec.rb
519
+ - spec/response/data_accessor_spec.rb
520
+ - spec/response/data_spec.rb
521
+ - spec/response/effective_url_spec.rb
522
+ - spec/response/headers_spec.rb
523
+ - spec/response/options_spec.rb
524
+ - spec/response/success_spec.rb
525
+ - spec/response/time_spec.rb
526
+ - spec/spec_helper.rb
527
+ - spec/support/fixtures/json/feedback.json
528
+ - spec/support/fixtures/json/feedbacks.json
529
+ - spec/support/fixtures/json/localina_content_ad.json
530
+ - spec/support/load_json.rb
531
+ - spec/support/reset_config.rb
532
+ - spec/support/zipkin_mock.rb
533
+ - spec/timeouts/no_signal_spec.rb
534
+ - spec/timeouts/timings_spec.rb