dogapi 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- Ruby client for Datadog API v1.0.0
1
+ Ruby client for Datadog API v1.0.2
2
2
 
3
3
  The Ruby client is a library suitable for inclusion in existing Ruby projects or for development of standalone scripts. It provides an abstraction on top of Datadog's raw HTTP interface for reporting events and metrics.
4
4
 
@@ -10,7 +10,7 @@ Available at: https://github.com/DataDog/dogapi-rb
10
10
 
11
11
  $ cd dogapi-rb
12
12
  $ rake gem
13
- $ gem install pkg/dogapi-1.0.0.gem
13
+ $ gem install pkg/dogapi-*.gem
14
14
 
15
15
  == RubyGems
16
16
 
@@ -26,6 +26,7 @@ The client expects the +DATADOG_HOST+ environment variable to be set to the host
26
26
 
27
27
  Minimal example:
28
28
 
29
+ require 'rubygems'
29
30
  require 'dogapi'
30
31
 
31
32
  dog = Dogapi::Client.new(@api_key)
@@ -1,5 +1,5 @@
1
1
  require 'cgi'
2
- require 'net/http'
2
+ require 'net/https'
3
3
  require 'pp'
4
4
  require 'socket'
5
5
  require 'uri'
@@ -31,10 +31,12 @@ module Dogapi
31
31
  host = host || @host
32
32
 
33
33
  uri = URI.parse(host)
34
- Net::HTTP.start(uri.host, uri.port) do |conn|
35
- if 'https' == uri.scheme
36
- conn.use_ssl = true
37
- end
34
+ session = Net::HTTP.new(uri.host, uri.port)
35
+ if 'https' == uri.scheme
36
+ session.use_ssl = true
37
+ session.verify_mode = OpenSSL::SSL::VERIFY_PEER
38
+ end
39
+ session.start do |conn|
38
40
  yield(conn)
39
41
  end
40
42
  end
@@ -38,8 +38,7 @@ class TestEventClient < Test::Unit::TestCase
38
38
  submit_event(Dogapi::Scope.new('scoped-testhost', 'testdevice'))
39
39
  end
40
40
 
41
- def test_submit_event
42
- submit_event(Dogapi::Scope.new('typed-testhost', 'testdevice'), 'Nagios')
41
+ def test_submit_typed_event
43
42
  submit_event(Dogapi::Scope.new('typed-testhost', 'testdevice'), 'GitHub')
44
43
  end
45
44
 
@@ -2,7 +2,7 @@ require 'test/unit'
2
2
  require 'time'
3
3
  require 'dogapi'
4
4
 
5
- class TestEnvironment < Test::Unit::TestCase
5
+ class TestMetricClient < Test::Unit::TestCase
6
6
 
7
7
  def config_client_test_env
8
8
  @api_key = Dogapi.find_api_key
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dogapi
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Datadog, Inc.
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-21 00:00:00 -04:00
18
+ date: 2011-06-22 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency