pingdom-client 0.0.5.alpha → 0.0.6.alpha

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ RSpec::Core::RakeTask.new do |t|
15
15
  end
16
16
 
17
17
  task :console do
18
- exec %(ruby -rirb -rubygems -r bundler/setup -r lib/pingdom-client -e '$credentials = YAML.load_file("credentials.yml").with_indifferent_access; $client = Pingdom::Client.new($credentials); IRB.start')
18
+ exec %(ruby -rirb -rubygems -r bundler/setup -r ./lib/pingdom-client -e '$credentials = YAML.load_file("credentials.yml").with_indifferent_access; $client = Pingdom::Client.new($credentials); IRB.start')
19
19
  end
20
20
 
21
21
  task :default => :spec
@@ -1,6 +1,6 @@
1
1
  module Pingdom
2
2
 
3
- VERSION = '0.0.5.alpha'
3
+ VERSION = '0.0.6.alpha'
4
4
 
5
5
  class Error < RuntimeError
6
6
  end
@@ -7,6 +7,9 @@ module Pingdom
7
7
 
8
8
  def initialize(options = {})
9
9
  @options = options.with_indifferent_access.reverse_merge(:http_driver => :excon)
10
+
11
+ raise ArgumentError, "an application key must be provided (as :key)" unless @options.key?(:key)
12
+
10
13
  @connection = Faraday::Connection.new(:url => "https://api/pingdom.com/api/2.0/") do |builder|
11
14
  builder.url_prefix = "https://api.pingdom.com/api/2.0"
12
15
 
@@ -33,7 +36,7 @@ module Pingdom
33
36
  end
34
37
 
35
38
  def get(uri, params = {}, &block)
36
- response = @connection.get(@connection.build_url(uri, prepare_params(params)), &block)
39
+ response = @connection.get(@connection.build_url(uri, prepare_params(params)), "App-Key" => @options[:key], &block)
37
40
  update_limits!(response.headers['req-limit-short'], response.headers['req-limit-long'])
38
41
  response
39
42
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{pingdom-client}
3
- s.version = "0.0.5.alpha"
3
+ s.version = "0.0.6.alpha"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Matt Todd"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pingdom-client
3
3
  version: !ruby/object:Gem::Version
4
- hash: -1851332182
4
+ hash: -1851332186
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
9
+ - 6
10
10
  - alpha
11
- version: 0.0.5.alpha
11
+ version: 0.0.6.alpha
12
12
  platform: ruby
13
13
  authors:
14
14
  - Matt Todd