infoblox 2.0.5 → 3.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: f2adc338dbb18becd75ccbc3583871e36aac7668
4
- data.tar.gz: 389cbe8d4d6887e8f098f112f3ef3b83e453eb6f
2
+ SHA256:
3
+ metadata.gz: d60af69c0405939bbd3ca3066e5e2b2ea525abc27ce6a1bdb2444aca51698766
4
+ data.tar.gz: 444b7a9f3e893182237f236b85a42d02b74c471f1bf9ca0554be91ca3afbf14f
5
5
  SHA512:
6
- metadata.gz: 5d91c6e7fecb484852ca5698043f98077e4f6561c4c5ff263c53d5d39e9c6486077831f8e6e5a7fa7ad8c87adb31d2bbc3819e96af297bbabb6a3b99ec03ffc2
7
- data.tar.gz: 8ce3f9d1467209f38342daacbf0327dcd2ec32ba3ad67be4306d355427a5ffabe88a983a421378397d983193d445d6b486d4f9d83a74dd4b69f69afdfbb410dc
6
+ metadata.gz: cdca7064bae06646b53afc88dfc65e905e918e0324dfcf6ed0416962dbb159c3f2e0369d21a27bb8a7f33b4821a333c4df7085de3c04903ecd70685fdaad5f3e
7
+ data.tar.gz: e131968c658ab557ea6e61a5ad832861045eab12b526b48a8e7e2bb81037a8dcc5cf2a679bb7af75be511b0e638845953a27fa339a7c0bd01c0725616d3c0dc1
@@ -1 +1 @@
1
- 2.3.1
1
+ 2.6.3
@@ -1,11 +1,18 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.4.0
4
- - 2.3.3
5
- - 2.2.6
3
+ - 2.6.3
4
+ - 2.5.5
5
+ - 2.4.6
6
+ - 2.3.8
7
+ - 2.2.10
6
8
  - 2.1.10
7
9
  - 1.9.3
8
- - jruby-19mode
9
- - 1.8.7
10
- before_install: gem install bundler
10
+ - jruby-9.2.7.0
11
+ # https://docs.travis-ci.com/user/languages/ruby/
12
+ # https://bundler.io/blog/2019/01/04/an-update-on-the-bundler-2-release.html
13
+ before_install:
14
+ - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
15
+ - gem uninstall bundler -v '>= 2' || true
16
+ - gem install bundler -v '< 2'
17
+ - gem list | grep bundler
11
18
  script: bundle exec rspec
data/README.md CHANGED
@@ -32,6 +32,10 @@ You can supply a logger to get debugging information:
32
32
 
33
33
  connection = Infoblox::Connection.new(username: '', password: '', host: '', logger: Logger.new(STDOUT))
34
34
 
35
+ It is possible to set timeout, read and write timeout:
36
+
37
+ connection = Infoblox::Connection.new(username: '', password: '', host: '', timeout: 120)
38
+
35
39
  ## Reading
36
40
  Each resource class implements `.all`, `.find`, and `#get`.
37
41
 
@@ -196,7 +200,9 @@ The default version is 2.0.
196
200
 
197
201
  ## Ruby Version Compatibility
198
202
 
199
- This gem is tested against Ruby versions 1.8.7, 1.9.3, 2.1.6, JRuby-head, and JRuby in 1.9 mode.
203
+ This gem is tested against Ruby versions 1.9.3, 2.1.6, JRuby-head, and JRuby in 1.9 mode.
204
+
205
+ The last compatible version with Ruby 1.8.x is 2.0.5.
200
206
 
201
207
  ## Development / testing
202
208
 
@@ -1,3 +1,7 @@
1
+ ## 3.0.0 - June 26, 2019
2
+ * Removed 1.8.7 support (should still work, but no longer supported in CI)
3
+ * Added new connection timeout option with 60-second default value
4
+
1
5
  ## 2.0.5 - August 28 2017
2
6
  * Added ZoneForward resource
3
7
 
@@ -10,7 +10,8 @@ module Infoblox
10
10
  :logger,
11
11
  :password,
12
12
  :ssl_opts,
13
- :username
13
+ :username,
14
+ :timeout
14
15
 
15
16
  def get(href, params={})
16
17
  wrap do
@@ -48,10 +49,14 @@ module Infoblox
48
49
  self.host = opts[:host]
49
50
  self.logger = opts[:logger]
50
51
  self.ssl_opts = opts[:ssl_opts] || {}
52
+ self.timeout = opts[:timeout] || 60
51
53
  end
52
54
 
53
55
  def connection
54
- @connection ||= Faraday.new(:url => self.host, :ssl => self.ssl_opts) do |faraday|
56
+ @connection ||= Faraday.new(
57
+ :request => {:timeout => self.timeout, :open_timeout => self.timeout},
58
+ :url => self.host,
59
+ :ssl => self.ssl_opts) do |faraday|
55
60
  faraday.use Faraday::Response::Logger, logger if logger
56
61
  faraday.request :json
57
62
  faraday.basic_auth(self.username, self.password)
@@ -1,3 +1,3 @@
1
1
  module Infoblox
2
- VERSION = "2.0.5"
2
+ VERSION = "3.0.0"
3
3
  end
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+ require 'socket'
3
+
4
+ describe 'Infoblox::Connection' do
5
+ it "should timeout in defined time" do
6
+ begin
7
+ server = TCPServer.new('localhost', 8813)
8
+ host = 'localhost:8813'
9
+ conn_params = {
10
+ :host => host,
11
+ :timeout => 4
12
+ }
13
+ uri = "/wapi/v1.0"
14
+
15
+ ic = Infoblox::Connection.new(conn_params)
16
+ start = Time.now
17
+ if RUBY_VERSION < "2.0"
18
+ # old pinned version of faraday gem throws a different exception
19
+ expect { ic.get(uri) }.to raise_error(Faraday::TimeoutError)
20
+ else
21
+ expect { ic.get(uri) }.to raise_error(Faraday::ConnectionFailed)
22
+ end
23
+ finish = Time.now
24
+ # this should take approx. 4 seconds but let's be safe
25
+ expect(finish - start).to be_between(3, 55)
26
+ ensure
27
+ server.close
28
+ end
29
+ end
30
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infoblox
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Billy Reisinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-28 00:00:00.000000000 Z
11
+ date: 2019-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -140,6 +140,7 @@ files:
140
140
  - spec/host_spec.rb
141
141
  - spec/integration/arecord_spec.rb
142
142
  - spec/integration/cname_spec.rb
143
+ - spec/integration/connection_timeout_spec.rb
143
144
  - spec/integration/host_ipv4addr_spec.rb
144
145
  - spec/integration/host_spec.rb
145
146
  - spec/integration/ptr_spec.rb
@@ -167,8 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
168
  - !ruby/object:Gem::Version
168
169
  version: '0'
169
170
  requirements: []
170
- rubyforge_project:
171
- rubygems_version: 2.5.1
171
+ rubygems_version: 3.0.3
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: This gem is a Ruby interface to the Infoblox WAPI. Using the gem, you can
@@ -179,6 +179,7 @@ test_files:
179
179
  - spec/host_spec.rb
180
180
  - spec/integration/arecord_spec.rb
181
181
  - spec/integration/cname_spec.rb
182
+ - spec/integration/connection_timeout_spec.rb
182
183
  - spec/integration/host_ipv4addr_spec.rb
183
184
  - spec/integration/host_spec.rb
184
185
  - spec/integration/ptr_spec.rb
@@ -187,4 +188,3 @@ test_files:
187
188
  - spec/resource_spec.rb
188
189
  - spec/search_spec.rb
189
190
  - spec/spec_helper.rb
190
- has_rdoc: