autodiscover 1.0.1 → 1.0.2

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
  SHA1:
3
- metadata.gz: 6506217143a3c1ae0bee471b4f50149bc1c9cbd9
4
- data.tar.gz: c48738b78bb6cbe0829bae7e5c8b50b80ef30077
3
+ metadata.gz: 27456985a67e136bd990830cbd74707cda82a2a1
4
+ data.tar.gz: bcaff404de4395a19995cc609c736b8f2c36dd00
5
5
  SHA512:
6
- metadata.gz: fbd0688c8b7c57b296f3d2bae5a09ee55a8e3f30bd9829b6821438f8c79eba82d9fcb3f26c9e1de4215162ee25fbfdba199f68502407a4296ef6dc18aef08702
7
- data.tar.gz: e066eae20b4bb314abbdaa21f712cf43e7c4ae90419d197c460dc68c4fbf57f3797df7cd694bb76a422c46f81d90320c1847eec880035090805d2d4104f35f5e
6
+ metadata.gz: ab42f7d08a28a45f118fb00247bc21cb44032fdf8ed3b833124fcf1cda249408dd88f5024af94a2715ff69407788f9d92bff1f4319897e79e1c508af071573bd
7
+ data.tar.gz: 6244776c25972cc095a749f7c67d7b38b1295478e02dc49852dae544b71a609f94ebce8167162d1b454acdeda3d53a7b19bf3e7bd4ed3b48f1ac3c8daea1b4f4
@@ -1,6 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.0
4
- - rbx-2
3
+ - 2.2
4
+ - 2.1
5
5
  - ruby-head
6
6
  - jruby-head
7
+ before_install:
8
+ # bundler installation needed for jruby-head
9
+ # https://github.com/travis-ci/travis-ci/issues/5861
10
+ - gem install bundler
data/README.md CHANGED
@@ -53,6 +53,9 @@ client = Autodiscover::Client.new(email: "blumbergh@initech.local", password: "t
53
53
  # Override the domain
54
54
  client = Autodiscover::Client.new(email: "blumbergh@initech.local", password: "tps_eq_awesome", domain: "tpsreports.local")
55
55
 
56
+ # Set a custom connection timeout
57
+ client = Autodiscover::Client.new(email: "blumbergh@initech.local", password: "tps_eq_awesome", connect_timeout: 5)
58
+
56
59
  # Ignore SSL Errors
57
60
  client.autodiscover(ignore_ssl_errors: true)
58
61
  ```
@@ -6,6 +6,7 @@ require 'autodiscover/version'
6
6
  Gem::Specification.new do |s|
7
7
  s.name = 'autodiscover'
8
8
  s.version = Autodiscover::VERSION
9
+ s.license = 'MIT'
9
10
  s.summary = "Ruby client for Microsoft's Autodiscover Service"
10
11
  s.description = "The Autodiscover Service provides information about a Microsoft Exchange environment such as service URLs, versions and many other attributes."
11
12
  s.required_ruby_version = '>= 2.1.0'
@@ -1,6 +1,6 @@
1
1
  module Autodiscover
2
2
  class Client
3
-
3
+ DEFAULT_HTTP_TIMEOUT = 10
4
4
  attr_reader :domain, :email, :http
5
5
 
6
6
  # @param email [String] An e-mail to use for autodiscovery. It will be
@@ -10,10 +10,11 @@ module Autodiscover
10
10
  # with something other than the e-mail. For instance DOMAIN\user
11
11
  # @param domain [String] An optional domain to provide as an override for
12
12
  # the one parsed from the e-mail.
13
- def initialize(email:, password:, username: nil, domain: nil)
13
+ def initialize(email:, password:, username: nil, domain: nil, connect_timeout: DEFAULT_HTTP_TIMEOUT)
14
14
  @email = email
15
15
  @domain = domain || @email.split("@").last
16
16
  @http = HTTPClient.new
17
+ @http.connect_timeout = connect_timeout if connect_timeout
17
18
  @username = username || email
18
19
  @http.set_auth(nil, @username, password)
19
20
  end
@@ -19,7 +19,7 @@ module Autodiscover
19
19
  begin
20
20
  response = client.http.post(url, request_body, {'Content-Type' => 'text/xml; charset=utf-8'})
21
21
  return PoxResponse.new(response.body) if good_response?(response)
22
- rescue Errno::ENETUNREACH, Errno::ECONNREFUSED
22
+ rescue Errno::ENETUNREACH, Errno::ECONNREFUSED, HTTPClient::ConnectTimeoutError
23
23
  next
24
24
  rescue OpenSSL::SSL::SSLError
25
25
  options[:ignore_ssl_errors] ? next : raise
@@ -1,3 +1,3 @@
1
1
  module Autodiscover
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autodiscover
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David King
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-09-13 00:00:00.000000000 Z
12
+ date: 2016-10-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -169,7 +169,8 @@ files:
169
169
  - test/units/pox_response_test.rb
170
170
  - test/units/server_version_parser_test.rb
171
171
  homepage: http://github.com/WinRb/autodiscover
172
- licenses: []
172
+ licenses:
173
+ - MIT
173
174
  metadata: {}
174
175
  post_install_message:
175
176
  rdoc_options: []