measures 4.0.0 → 6.0.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
- SHA1:
3
- metadata.gz: 70eaeeaaca44acefa72f3e07d7218c475c1c9f95
4
- data.tar.gz: 4488c134898b88fe1076eb539f12a08ece7560d2
2
+ SHA256:
3
+ metadata.gz: 21903bb81fedf90108e66ada2542784977c51478b48c7469a788aa16c9670ec3
4
+ data.tar.gz: c7cbc6e1e6d0a1b3c0a4e80f432e961248599e0e5ef12adc0d650597595d98c5
5
5
  SHA512:
6
- metadata.gz: 8ee94661fec3b5fbe4f5a61ab2ee7e2fdb4f25d755950d01c9c17c3c988f9ea6fcbc5ddff0b4fcc865b956a7e9a1241d8e2513efd5e0b571fd55976f7414367c
7
- data.tar.gz: aab1674c92d8406477f50e57e40d423dbb951acfeaca8b08460e9ffa8b015b4a1f909a5419bdfcd8a3fa15580377644bec56a9109ea124e8552d0a52ead73302
6
+ metadata.gz: 1af112418bc023dbd2179cf6263e2034801fb66e4a579b37fef6072f65efa33cbeccb2f99e458a887257ab6ba890fc72eb79359905d9240201b207fff0599a3f
7
+ data.tar.gz: 53c1d089de7963fc55d26df809e723a7efb068e4d20e2ebb8383c52ad1d018d9f414e1a77a4867dbb49cad075058fccb0f0f21347a8f39b5d375a5798a8be3e8
@@ -1,30 +1,36 @@
1
1
  require "faraday"
2
- require "faraday_middleware"
3
2
  require "uri"
4
3
 
5
4
  module Measures
6
5
  module Transports
7
6
  class HTTP
8
- def initialize(host, port = 80, url = "/")
7
+ def initialize(host, port = 80, url = "/", open_timeout = 30, timeout = 30)
9
8
  @host = host
10
9
  @port = port
11
10
  @url = url
11
+ @open_timeout = open_timeout
12
+ @timeout = timeout
12
13
  end
13
14
 
14
15
  def send(data)
15
- client = Faraday.new(url: URI::HTTP.build(host: @host, port: @port)) do |c|
16
- c.request :json
17
-
18
- c.response :raise_error
19
- c.adapter Faraday.default_adapter
20
- end
21
-
22
16
  client.post do |req|
23
17
  req.url @url
24
18
  req.headers["Content-Type"] = "application/json"
25
19
  req.body = data
26
20
  end
27
21
  end
22
+
23
+ def client
24
+ Faraday.new(url: URI::HTTP.build(host: @host, port: @port)) do |c|
25
+ c.request :json
26
+
27
+ c.options[:open_timeout] = @open_timeout
28
+ c.options[:timeout] = @timeout
29
+
30
+ c.response :raise_error
31
+ c.adapter Faraday.default_adapter
32
+ end
33
+ end
28
34
  end
29
35
  end
30
36
  end
@@ -1,3 +1,3 @@
1
1
  module Measures
2
- VERSION = "4.0.0"
2
+ VERSION = "6.0.0"
3
3
  end
data/measures.gemspec CHANGED
@@ -15,8 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
16
  spec.require_paths = ["lib"]
17
17
 
18
- spec.add_dependency "faraday"
19
- spec.add_dependency "faraday_middleware"
18
+ spec.add_dependency "faraday", ">= 2.1.0"
20
19
 
21
20
  spec.add_development_dependency "bundler", "~> 1.11"
22
21
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: measures
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Boeira
8
8
  - Juan Ibiapina
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-17 00:00:00.000000000 Z
12
+ date: 1980-01-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -17,28 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
20
+ version: 2.1.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '0'
28
- - !ruby/object:Gem::Dependency
29
- name: faraday_middleware
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: '0'
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- version: '0'
27
+ version: 2.1.0
42
28
  - !ruby/object:Gem::Dependency
43
29
  name: bundler
44
30
  requirement: !ruby/object:Gem::Requirement
@@ -150,7 +136,7 @@ homepage: ''
150
136
  licenses:
151
137
  - MIT
152
138
  metadata: {}
153
- post_install_message:
139
+ post_install_message:
154
140
  rdoc_options: []
155
141
  require_paths:
156
142
  - lib
@@ -165,10 +151,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
151
  - !ruby/object:Gem::Version
166
152
  version: '0'
167
153
  requirements: []
168
- rubyforge_project:
169
- rubygems_version: 2.5.1
170
- signing_key:
154
+ rubygems_version: 3.3.20
155
+ signing_key:
171
156
  specification_version: 4
172
157
  summary: Measures ruby client
173
158
  test_files: []
174
- has_rdoc: