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 +1 -1
- data/lib/pingdom.rb +1 -1
- data/lib/pingdom/client.rb +4 -1
- data/pingdom-client.gemspec +1 -1
- metadata +3 -3
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
|
data/lib/pingdom.rb
CHANGED
data/lib/pingdom/client.rb
CHANGED
@@ -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
|
data/pingdom-client.gemspec
CHANGED
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: -
|
4
|
+
hash: -1851332186
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
9
|
+
- 6
|
10
10
|
- alpha
|
11
|
-
version: 0.0.
|
11
|
+
version: 0.0.6.alpha
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Matt Todd
|