From b0d6f0a6bdabefb6b06215e5bf2de6dc99eee807 Mon Sep 17 00:00:00 2001 From: Dhananjay Sathe Date: Mon, 29 Jul 2013 19:22:10 +0530 Subject: [PATCH 01/21] Added analysis to the Pingdon gem for a given checkid --- lib/pingdom-client.rb | 1 + lib/pingdom/client.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib/pingdom-client.rb b/lib/pingdom-client.rb index f4c6678..69f9bde 100644 --- a/lib/pingdom-client.rb +++ b/lib/pingdom-client.rb @@ -16,6 +16,7 @@ require 'pingdom/client' require 'pingdom/base' require 'pingdom/check' +require 'pingdom/analysis' require 'pingdom/result' require 'pingdom/probe' require 'pingdom/contact' diff --git a/lib/pingdom/client.rb b/lib/pingdom/client.rb index 2481d5e..5a6c63e 100644 --- a/lib/pingdom/client.rb +++ b/lib/pingdom/client.rb @@ -85,5 +85,9 @@ def summary(id) Summary.proxy(self, id) end + def analysis(id) + Analysis.parse(self,get("analysis/#{id}")) + end + end end From 8d4db5556ead8b3b55656f9e32e76b0edef34964 Mon Sep 17 00:00:00 2001 From: Dhananjay Sathe Date: Mon, 29 Jul 2013 19:23:55 +0530 Subject: [PATCH 02/21] Fix documentation --- lib/pingdom/analysis.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/pingdom/analysis.rb diff --git a/lib/pingdom/analysis.rb b/lib/pingdom/analysis.rb new file mode 100644 index 0000000..350f1dc --- /dev/null +++ b/lib/pingdom/analysis.rb @@ -0,0 +1,15 @@ +module Pingdom + + # {"id"=>259103, "timefirsttest"=>203173, "timeconfirmtest"=>1298102416} + class Analysis < Base + def self.parse(client, response) + analysis = super + Array.wrap(analysis[:analysis]).map do |analysis_element| + new(client, response, analysis_element) + end + end + + attributes :timefirsttest => :time_start, + :timeconfirmtest => :time_confirm, + end +end \ No newline at end of file From 173129d661a0318644cd1f5a303ea956c9235e47 Mon Sep 17 00:00:00 2001 From: Dhananjay Sathe Date: Mon, 29 Jul 2013 19:47:57 +0530 Subject: [PATCH 03/21] Added RCA Analyis or a given check id ID and unique analysis id --- lib/pingdom-client.rb | 1 + lib/pingdom/client.rb | 3 +++ lib/pingdom/rca.rb | 9 +++++++++ 3 files changed, 13 insertions(+) create mode 100644 lib/pingdom/rca.rb diff --git a/lib/pingdom-client.rb b/lib/pingdom-client.rb index 69f9bde..a64b4ff 100644 --- a/lib/pingdom-client.rb +++ b/lib/pingdom-client.rb @@ -17,6 +17,7 @@ require 'pingdom/base' require 'pingdom/check' require 'pingdom/analysis' +require 'pingdom/rca' require 'pingdom/result' require 'pingdom/probe' require 'pingdom/contact' diff --git a/lib/pingdom/client.rb b/lib/pingdom/client.rb index 5a6c63e..069ed9a 100644 --- a/lib/pingdom/client.rb +++ b/lib/pingdom/client.rb @@ -89,5 +89,8 @@ def analysis(id) Analysis.parse(self,get("analysis/#{id}")) end + def rca(check_id, analysis_id) + RCA.parse(self,get("analysis/#{check_id}/#{analysis_id}")) + end end end diff --git a/lib/pingdom/rca.rb b/lib/pingdom/rca.rb new file mode 100644 index 0000000..929363d --- /dev/null +++ b/lib/pingdom/rca.rb @@ -0,0 +1,9 @@ +module Pingdom + + class RCA < Base + def self.parse(client, response) + rca = super + new(client, response, rca) + end + end +end \ No newline at end of file From 87dfb68bfcd9ce4de464a3072e90930e2a57a756 Mon Sep 17 00:00:00 2001 From: Dhananjay Sathe Date: Wed, 31 Jul 2013 15:19:46 +0530 Subject: [PATCH 04/21] Update faraday gem version solving conflicts with other apps using newer versions of data_mapper that depends on a newer version of addressable --- Gemfile | 2 +- pingdom-client.gemspec | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index b92d7b4..af27db3 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source :rubygems -gem "faraday", "~> 0.5.7" +gem "faraday", "~> 0.8.5" gem "excon", "~> 0.5.6" gem "yajl-ruby", "~> 0.8.1", :require => "yajl" diff --git a/pingdom-client.gemspec b/pingdom-client.gemspec index fd391e4..80d8978 100644 --- a/pingdom-client.gemspec +++ b/pingdom-client.gemspec @@ -44,7 +44,7 @@ Gem::Specification.new do |s| s.specification_version = 3 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency("faraday", ["~> 0.5.7"]) + s.add_runtime_dependency("faraday", ["~> 0.8.5"]) s.add_runtime_dependency("excon", ["~> 0.5.6"]) s.add_runtime_dependency("yajl-ruby", ["~> 0.8.1"]) s.add_runtime_dependency("activesupport", ["~> 3.0.4"]) @@ -54,7 +54,7 @@ Gem::Specification.new do |s| s.add_development_dependency("rake", ["~> 0.8.7"]) s.add_development_dependency("rspec", ["= 2.1.0"]) else - s.add_dependency("faraday", ["~> 0.5.7"]) + s.add_dependency("faraday", ["~> 0.8.5"]) s.add_dependency("excon", ["~> 0.5.6"]) s.add_dependency("yajl-ruby", ["~> 0.8.1"]) s.add_dependency("activesupport", ["~> 3.0.4"]) @@ -65,7 +65,7 @@ Gem::Specification.new do |s| s.add_dependency("rspec", ["= 2.1.0"]) end else - s.add_dependency("faraday", ["~> 0.5.7"]) + s.add_dependency("faraday", ["~> 0.8.5"]) s.add_dependency("excon", ["~> 0.5.6"]) s.add_dependency("yajl-ruby", ["~> 0.8.1"]) s.add_dependency("activesupport", ["~> 3.0.4"]) From 0db59f35af141d447f68f539c83c1d45eed62c2e Mon Sep 17 00:00:00 2001 From: Dhananjay Sathe Date: Fri, 2 Aug 2013 16:28:40 +0530 Subject: [PATCH 05/21] Add ability to add options to analysis, addput,post,delete methods --- lib/pingdom/client.rb | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/pingdom/client.rb b/lib/pingdom/client.rb index 069ed9a..fd0a07a 100644 --- a/lib/pingdom/client.rb +++ b/lib/pingdom/client.rb @@ -41,6 +41,24 @@ def get(uri, params = {}, &block) response end + def put(uri, params = {}, data, &block) + response = @connection.put(@connection.build_url(uri, prepare_params(params)), data, "App-Key" => @options[:key], &block) + update_limits!(response.headers['req-limit-short'], response.headers['req-limit-long']) + response + end + + def post(uri, params = {}, data, &block) + response = @connection.post(@connection.build_url(uri, prepare_params(params)), data, "App-Key" => @options[:key], &block) + update_limits!(response.headers['req-limit-short'], response.headers['req-limit-long']) + response + end + + def delete(uri, &block) + response = @connection.delete(@connection.build_url(uri), "App-Key" => @options[:key], &block) + update_limits!(response.headers['req-limit-short'], response.headers['req-limit-long']) + response + end + def update_limits!(short, long) @limit ||= {} @limit[:short] = parse_limit(short) @@ -85,8 +103,8 @@ def summary(id) Summary.proxy(self, id) end - def analysis(id) - Analysis.parse(self,get("analysis/#{id}")) + def analysis(id, options = {}) + Analysis.parse(self,get("analysis/#{id}", options)) end def rca(check_id, analysis_id) From 9a0ae625776ac6f933cb7cba7791423524ae038c Mon Sep 17 00:00:00 2001 From: JDStraughan Date: Fri, 4 Oct 2013 11:39:09 -0500 Subject: [PATCH 06/21] Modernized gemfile for use with Ruby 1.9.3 --- Gemfile | 12 ++++++------ Gemfile.lock | 48 ++++++++++++++++++++++-------------------------- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/Gemfile b/Gemfile index b92d7b4..7771028 100644 --- a/Gemfile +++ b/Gemfile @@ -1,15 +1,15 @@ -source :rubygems +source 'https://rubygems.org' -gem "faraday", "~> 0.5.7" +gem "faraday", '~> 0.8.8' -gem "excon", "~> 0.5.6" +gem "excon", '~> 0.26.0' gem "yajl-ruby", "~> 0.8.1", :require => "yajl" gem "activesupport", "~> 3.0.4" gem "i18n", "~> 0.5.0" # ActiveSupport dependency group :development do - gem "bundler", "~> 1.0.0" - gem "rake", "~> 0.8.7" - gem "rspec", "2.1.0" + gem "bundler" + gem "rake", '~> 10.1.0' + gem "rspec", '~> 2.14.1' end diff --git a/Gemfile.lock b/Gemfile.lock index 12f340c..d5577f0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,37 +1,33 @@ GEM - remote: http://rubygems.org/ + remote: https://rubygems.org/ specs: - activesupport (3.0.4) - addressable (2.2.4) - diff-lcs (1.1.2) - excon (0.5.6) - faraday (0.5.7) - addressable (~> 2.2.4) - multipart-post (~> 1.1.0) - rack (>= 1.1.0, < 2) + activesupport (3.0.20) + diff-lcs (1.2.4) + excon (0.26.0) + faraday (0.8.8) + multipart-post (~> 1.2.0) i18n (0.5.0) - multipart-post (1.1.0) - rack (1.2.1) - rake (0.8.7) - rspec (2.1.0) - rspec-core (~> 2.1.0) - rspec-expectations (~> 2.1.0) - rspec-mocks (~> 2.1.0) - rspec-core (2.1.0) - rspec-expectations (2.1.0) - diff-lcs (~> 1.1.2) - rspec-mocks (2.1.0) - yajl-ruby (0.8.1) + multipart-post (1.2.0) + rake (10.1.0) + rspec (2.14.1) + rspec-core (~> 2.14.0) + rspec-expectations (~> 2.14.0) + rspec-mocks (~> 2.14.0) + rspec-core (2.14.5) + rspec-expectations (2.14.3) + diff-lcs (>= 1.1.3, < 2.0) + rspec-mocks (2.14.3) + yajl-ruby (0.8.3) PLATFORMS ruby DEPENDENCIES activesupport (~> 3.0.4) - bundler (~> 1.0.0) - excon (~> 0.5.6) - faraday (~> 0.5.7) + bundler + excon (~> 0.26.0) + faraday (~> 0.8.8) i18n (~> 0.5.0) - rake (~> 0.8.7) - rspec (= 2.1.0) + rake (~> 10.1.0) + rspec (~> 2.14.1) yajl-ruby (~> 0.8.1) From af15343a125b74a793015bcb54d3e561e52e94fe Mon Sep 17 00:00:00 2001 From: JDStraughan Date: Fri, 4 Oct 2013 11:44:20 -0500 Subject: [PATCH 07/21] Gemspec dependency updates --- pingdom-client.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pingdom-client.gemspec b/pingdom-client.gemspec index fd391e4..6259ef9 100644 --- a/pingdom-client.gemspec +++ b/pingdom-client.gemspec @@ -44,8 +44,8 @@ Gem::Specification.new do |s| s.specification_version = 3 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency("faraday", ["~> 0.5.7"]) - s.add_runtime_dependency("excon", ["~> 0.5.6"]) + s.add_runtime_dependency("faraday", ["~> 0.8.8"]) + s.add_runtime_dependency("excon", ["~> 0.26.0"]) s.add_runtime_dependency("yajl-ruby", ["~> 0.8.1"]) s.add_runtime_dependency("activesupport", ["~> 3.0.4"]) s.add_runtime_dependency("i18n", ["~> 0.5.0"]) From 81eac6b1de5c96abf30e8797e19ea0b816a927a8 Mon Sep 17 00:00:00 2001 From: JDStraughan Date: Fri, 4 Oct 2013 11:45:25 -0500 Subject: [PATCH 08/21] Needs to all 0.25 --- pingdom-client.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pingdom-client.gemspec b/pingdom-client.gemspec index 6259ef9..2963f31 100644 --- a/pingdom-client.gemspec +++ b/pingdom-client.gemspec @@ -45,7 +45,7 @@ Gem::Specification.new do |s| if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then s.add_runtime_dependency("faraday", ["~> 0.8.8"]) - s.add_runtime_dependency("excon", ["~> 0.26.0"]) + s.add_runtime_dependency("excon", ["~> 0.25"]) s.add_runtime_dependency("yajl-ruby", ["~> 0.8.1"]) s.add_runtime_dependency("activesupport", ["~> 3.0.4"]) s.add_runtime_dependency("i18n", ["~> 0.5.0"]) From 715fc5f0f680ca1563fe93b65475223c15eda19b Mon Sep 17 00:00:00 2001 From: JDStraughan Date: Fri, 4 Oct 2013 11:46:30 -0500 Subject: [PATCH 09/21] Remove dependency hell child ;) --- pingdom-client.gemspec | 1 - 1 file changed, 1 deletion(-) diff --git a/pingdom-client.gemspec b/pingdom-client.gemspec index 2963f31..9b61125 100644 --- a/pingdom-client.gemspec +++ b/pingdom-client.gemspec @@ -45,7 +45,6 @@ Gem::Specification.new do |s| if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then s.add_runtime_dependency("faraday", ["~> 0.8.8"]) - s.add_runtime_dependency("excon", ["~> 0.25"]) s.add_runtime_dependency("yajl-ruby", ["~> 0.8.1"]) s.add_runtime_dependency("activesupport", ["~> 3.0.4"]) s.add_runtime_dependency("i18n", ["~> 0.5.0"]) From 74d4ab5fbd454f01bc89ba83ff1ea8e374dd34f0 Mon Sep 17 00:00:00 2001 From: JDStraughan Date: Fri, 4 Oct 2013 11:47:46 -0500 Subject: [PATCH 10/21] Its everywhere --- pingdom-client.gemspec | 2 -- 1 file changed, 2 deletions(-) diff --git a/pingdom-client.gemspec b/pingdom-client.gemspec index 9b61125..3f1ad70 100644 --- a/pingdom-client.gemspec +++ b/pingdom-client.gemspec @@ -54,7 +54,6 @@ Gem::Specification.new do |s| s.add_development_dependency("rspec", ["= 2.1.0"]) else s.add_dependency("faraday", ["~> 0.5.7"]) - s.add_dependency("excon", ["~> 0.5.6"]) s.add_dependency("yajl-ruby", ["~> 0.8.1"]) s.add_dependency("activesupport", ["~> 3.0.4"]) s.add_dependency("i18n", ["~> 0.5.0"]) @@ -65,7 +64,6 @@ Gem::Specification.new do |s| end else s.add_dependency("faraday", ["~> 0.5.7"]) - s.add_dependency("excon", ["~> 0.5.6"]) s.add_dependency("yajl-ruby", ["~> 0.8.1"]) s.add_dependency("activesupport", ["~> 3.0.4"]) s.add_dependency("i18n", ["~> 0.5.0"]) From 6585c89323333c223bbf6b2af33adefd87890788 Mon Sep 17 00:00:00 2001 From: JDStraughan Date: Fri, 4 Oct 2013 11:48:52 -0500 Subject: [PATCH 11/21] Remove all version dependencies --- Gemfile | 2 +- Gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 7771028..e37e7dc 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' gem "faraday", '~> 0.8.8' -gem "excon", '~> 0.26.0' +gem "excon" gem "yajl-ruby", "~> 0.8.1", :require => "yajl" gem "activesupport", "~> 3.0.4" diff --git a/Gemfile.lock b/Gemfile.lock index d5577f0..a8cbcb2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -25,7 +25,7 @@ PLATFORMS DEPENDENCIES activesupport (~> 3.0.4) bundler - excon (~> 0.26.0) + excon faraday (~> 0.8.8) i18n (~> 0.5.0) rake (~> 10.1.0) From 4e1ceb61d37543e1279bedbd342093bd1bdb763a Mon Sep 17 00:00:00 2001 From: JDStraughan Date: Fri, 4 Oct 2013 11:54:22 -0500 Subject: [PATCH 12/21] Remove all spec fun --- pingdom-client.gemspec | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/pingdom-client.gemspec b/pingdom-client.gemspec index 3f1ad70..86dd82e 100644 --- a/pingdom-client.gemspec +++ b/pingdom-client.gemspec @@ -38,38 +38,4 @@ Gem::Specification.new do |s| "spec/spec_helper.rb", "spec/pingdom-client_spec.rb" ] - - if s.respond_to? :specification_version then - current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION - s.specification_version = 3 - - if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency("faraday", ["~> 0.8.8"]) - s.add_runtime_dependency("yajl-ruby", ["~> 0.8.1"]) - s.add_runtime_dependency("activesupport", ["~> 3.0.4"]) - s.add_runtime_dependency("i18n", ["~> 0.5.0"]) - - s.add_development_dependency("bundler", ["~> 1.0.0"]) - s.add_development_dependency("rake", ["~> 0.8.7"]) - s.add_development_dependency("rspec", ["= 2.1.0"]) - else - s.add_dependency("faraday", ["~> 0.5.7"]) - s.add_dependency("yajl-ruby", ["~> 0.8.1"]) - s.add_dependency("activesupport", ["~> 3.0.4"]) - s.add_dependency("i18n", ["~> 0.5.0"]) - - s.add_dependency("bundler", ["~> 1.0.0"]) - s.add_dependency("rake", ["~> 0.8.7"]) - s.add_dependency("rspec", ["= 2.1.0"]) - end - else - s.add_dependency("faraday", ["~> 0.5.7"]) - s.add_dependency("yajl-ruby", ["~> 0.8.1"]) - s.add_dependency("activesupport", ["~> 3.0.4"]) - s.add_dependency("i18n", ["~> 0.5.0"]) - - s.add_dependency("bundler", ["~> 1.0.0"]) - s.add_dependency("rake", ["~> 0.8.7"]) - s.add_dependency("rspec", ["= 2.1.0"]) - end end From ccb71c3d27fd18943e936c7ebbbb48f0347f3c63 Mon Sep 17 00:00:00 2001 From: JDStraughan Date: Fri, 4 Oct 2013 11:55:38 -0500 Subject: [PATCH 13/21] 007 --- pingdom-client.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pingdom-client.gemspec b/pingdom-client.gemspec index 86dd82e..2185fdf 100644 --- a/pingdom-client.gemspec +++ b/pingdom-client.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = %q{pingdom-client} - s.version = "0.0.6.alpha" + s.version = "0.0.7" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Matt Todd"] From 5eab4dadc201706359820e844a6497772be0bd72 Mon Sep 17 00:00:00 2001 From: JDStraughan Date: Fri, 4 Oct 2013 11:58:17 -0500 Subject: [PATCH 14/21] Cleaning up --- pingdom-client.gemspec | 2 -- 1 file changed, 2 deletions(-) diff --git a/pingdom-client.gemspec b/pingdom-client.gemspec index 2185fdf..434c47e 100644 --- a/pingdom-client.gemspec +++ b/pingdom-client.gemspec @@ -2,7 +2,6 @@ Gem::Specification.new do |s| s.name = %q{pingdom-client} s.version = "0.0.7" - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Matt Todd"] s.date = %q{2011-03-02} s.description = %q{Pingdom Ruby Client} @@ -29,7 +28,6 @@ Gem::Specification.new do |s| "spec/pingdom-client_spec.rb", "spec/spec_helper.rb" ] - s.homepage = %q{http://github.com/mtodd/pingdom-client} s.licenses = ["MIT"] s.require_paths = ["lib"] s.rubygems_version = %q{1.3.7} From 7af4d36843c03a3e0d33ab011efe148f9098a233 Mon Sep 17 00:00:00 2001 From: JDStraughan Date: Sat, 5 Oct 2013 16:28:54 -0500 Subject: [PATCH 15/21] Updating read me and gemspec for new "gem" as old repo is not having pull reqs accepted it appears. --- README.md | 4 +++- pingdom-client.gemspec | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7116c16..f109a91 100644 --- a/README.md +++ b/README.md @@ -28,13 +28,15 @@ NOTE: This is a 3rd party gem and not an official product from Pingdom. ## Contributors +* Updated for Ruby 1.9.x/2.0.0 by Jason Straughan ([jdstraughan](http://github.com/jdstraughan)) * Emily Price ([duien](http://github.com/duien)) +* Based on [pingom-client](https://github.com/mtodd/pingdom-client) by [Matt Todd](https://github.com/mtodd) ## License The MIT License -Copyright (c) 2011 Matt Todd. +Copyright (c) 2013 Jason Straughan. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/pingdom-client.gemspec b/pingdom-client.gemspec index 434c47e..2613dea 100644 --- a/pingdom-client.gemspec +++ b/pingdom-client.gemspec @@ -1,11 +1,11 @@ Gem::Specification.new do |s| s.name = %q{pingdom-client} - s.version = "0.0.7" + s.version = "1.0.0" - s.authors = ["Matt Todd"] - s.date = %q{2011-03-02} + s.authors = ["Jason Straughan"] + s.date = %q{2013-10-05} s.description = %q{Pingdom Ruby Client} - s.email = %q{chiology@gmail.com} + s.email = %q{jasons@grok-interactive.com} s.files = [ "pingdom-client.gemspec", "Gemfile", From c1c1bd6fc76d5fbad555f37092f0816c1ad769e0 Mon Sep 17 00:00:00 2001 From: JDStraughan Date: Sat, 5 Oct 2013 16:32:14 -0500 Subject: [PATCH 16/21] pingdom-client -> pingdom-ruby --- README.md | 3 +-- Rakefile | 2 +- lib/pingdom/client.rb | 2 +- pingdom-client.gemspec => pingdom-ruby.gemspec | 10 +++++----- spec/spec_helper.rb | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-) rename pingdom-client.gemspec => pingdom-ruby.gemspec (84%) diff --git a/README.md b/README.md index f109a91..065d610 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Pingdom RESTful API Client -Pingdom now offers a RESTful API, which gives us no reason not to make a decent, -non-SOAP API client for their services. +Pingdom RESTful API wrapper for Ruby. NOTE: This is a 3rd party gem and not an official product from Pingdom. diff --git a/Rakefile b/Rakefile index a663587..0e4bde4 100644 --- a/Rakefile +++ b/Rakefile @@ -15,7 +15,7 @@ RSpec::Core::RakeTask.new do |t| end task :console do - 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') + exec %(ruby -rirb -rubygems -r bundler/setup -r lib/pingdom-ruby -e '$credentials = YAML.load_file("credentials.yml").with_indifferent_access; $client = Pingdom::Client.new($credentials); IRB.start') end task :default => :spec diff --git a/lib/pingdom/client.rb b/lib/pingdom/client.rb index 2481d5e..730a0fa 100644 --- a/lib/pingdom/client.rb +++ b/lib/pingdom/client.rb @@ -1,4 +1,4 @@ -require File.join(File.dirname(__FILE__), '..', 'pingdom-client') unless defined? Pingdom +require File.join(File.dirname(__FILE__), '..', 'pingdom-ruby') unless defined? Pingdom module Pingdom class Client diff --git a/pingdom-client.gemspec b/pingdom-ruby.gemspec similarity index 84% rename from pingdom-client.gemspec rename to pingdom-ruby.gemspec index 2613dea..2c24740 100644 --- a/pingdom-client.gemspec +++ b/pingdom-ruby.gemspec @@ -1,5 +1,5 @@ Gem::Specification.new do |s| - s.name = %q{pingdom-client} + s.name = %q{pingdom-ruby} s.version = "1.0.0" s.authors = ["Jason Straughan"] @@ -7,7 +7,7 @@ Gem::Specification.new do |s| s.description = %q{Pingdom Ruby Client} s.email = %q{jasons@grok-interactive.com} s.files = [ - "pingdom-client.gemspec", + "pingdom-ruby.gemspec", "Gemfile", "Gemfile.lock", "lib/pingdom/base.rb", @@ -20,12 +20,12 @@ Gem::Specification.new do |s| "lib/pingdom/summary/outage.rb", "lib/pingdom/summary/performance.rb", "lib/pingdom/summary.rb", - "lib/pingdom-client.rb", + "lib/pingdom-ruby.rb", "lib/pingdom.rb", "lib/tinder/faraday_response.rb", "Rakefile", "Readme.md", - "spec/pingdom-client_spec.rb", + "spec/pingdom-ruby_spec.rb", "spec/spec_helper.rb" ] s.licenses = ["MIT"] @@ -34,6 +34,6 @@ Gem::Specification.new do |s| s.summary = %q{Pingdom Ruby Client} s.test_files = [ "spec/spec_helper.rb", - "spec/pingdom-client_spec.rb" + "spec/pingdom-ruby_spec.rb" ] end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e9b7b9d..20d30d1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,7 @@ $:.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))) require 'rubygems' require 'bundler/setup' -require 'pingdom-client' +require 'pingdom-ruby' require 'logger' require 'rspec' From 732e6c7f5cf54c836edcf6eced689c30d5d3261a Mon Sep 17 00:00:00 2001 From: JDStraughan Date: Sat, 5 Oct 2013 16:34:42 -0500 Subject: [PATCH 17/21] Renaming files to match new gem name --- lib/{pingdom-client.rb => pingdom-ruby.rb} | 0 spec/{pingdom-client_spec.rb => pingdom-ruby_spec.rb} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename lib/{pingdom-client.rb => pingdom-ruby.rb} (100%) rename spec/{pingdom-client_spec.rb => pingdom-ruby_spec.rb} (100%) diff --git a/lib/pingdom-client.rb b/lib/pingdom-ruby.rb similarity index 100% rename from lib/pingdom-client.rb rename to lib/pingdom-ruby.rb diff --git a/spec/pingdom-client_spec.rb b/spec/pingdom-ruby_spec.rb similarity index 100% rename from spec/pingdom-client_spec.rb rename to spec/pingdom-ruby_spec.rb From 6212ecc43589867b5cb975ce8d5edb582c37ee4b Mon Sep 17 00:00:00 2001 From: JDStraughan Date: Sat, 5 Oct 2013 17:19:08 -0500 Subject: [PATCH 18/21] Faraday dependency funness --- Gemfile | 2 +- Gemfile.lock | 15 ++++++++++----- pingdom-ruby.gemspec | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index e37e7dc..b9a2973 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem "faraday", '~> 0.8.8' +gem "faraday", "~> 0.5.7" gem "excon" gem "yajl-ruby", "~> 0.8.1", :require => "yajl" diff --git a/Gemfile.lock b/Gemfile.lock index a8cbcb2..3e6c9a3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,12 +2,17 @@ GEM remote: https://rubygems.org/ specs: activesupport (3.0.20) + addressable (2.2.8) diff-lcs (1.2.4) - excon (0.26.0) - faraday (0.8.8) - multipart-post (~> 1.2.0) + excon (0.27.0) + faraday (0.5.7) + addressable (~> 2.2.4) + multipart-post (~> 1.1.0) + rack (>= 1.1.0, < 2) + rack (>= 1.1.0, < 2) i18n (0.5.0) - multipart-post (1.2.0) + multipart-post (1.1.5) + rack (1.5.2) rake (10.1.0) rspec (2.14.1) rspec-core (~> 2.14.0) @@ -26,7 +31,7 @@ DEPENDENCIES activesupport (~> 3.0.4) bundler excon - faraday (~> 0.8.8) + faraday (~> 0.5.7) i18n (~> 0.5.0) rake (~> 10.1.0) rspec (~> 2.14.1) diff --git a/pingdom-ruby.gemspec b/pingdom-ruby.gemspec index 2c24740..90e5b01 100644 --- a/pingdom-ruby.gemspec +++ b/pingdom-ruby.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = %q{pingdom-ruby} - s.version = "1.0.0" + s.version = "1.0.3" s.authors = ["Jason Straughan"] s.date = %q{2013-10-05} From 40f83dbfaf64daba2fbddd4fcdc83531342de15a Mon Sep 17 00:00:00 2001 From: JDStraughan Date: Tue, 22 Oct 2013 13:14:25 -0500 Subject: [PATCH 19/21] Require faraday version 0.5.7 (for now) --- pingdom-ruby.gemspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pingdom-ruby.gemspec b/pingdom-ruby.gemspec index 90e5b01..91c0490 100644 --- a/pingdom-ruby.gemspec +++ b/pingdom-ruby.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = %q{pingdom-ruby} - s.version = "1.0.3" + s.version = "1.0.4" s.authors = ["Jason Straughan"] s.date = %q{2013-10-05} @@ -36,4 +36,5 @@ Gem::Specification.new do |s| "spec/spec_helper.rb", "spec/pingdom-ruby_spec.rb" ] + s.requirements << 'faraday, v0.5.7' end From e0d79d2e1fcfbd2777189701f3961b3fa6eab260 Mon Sep 17 00:00:00 2001 From: Dhananjay Sathe Date: Tue, 3 Dec 2013 16:09:06 +0530 Subject: [PATCH 20/21] Add rca features --- pingdom-ruby.gemspec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pingdom-ruby.gemspec b/pingdom-ruby.gemspec index 91c0490..2e7d452 100644 --- a/pingdom-ruby.gemspec +++ b/pingdom-ruby.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = %q{pingdom-ruby} s.version = "1.0.4" - + s.authors = ["Jason Straughan"] s.date = %q{2013-10-05} s.description = %q{Pingdom Ruby Client} @@ -16,6 +16,8 @@ Gem::Specification.new do |s| "lib/pingdom/contact.rb", "lib/pingdom/probe.rb", "lib/pingdom/result.rb", + "lib/pingdom/rca.rb", + "lib/pingdom/analysis.rb", "lib/pingdom/summary/average.rb", "lib/pingdom/summary/outage.rb", "lib/pingdom/summary/performance.rb", From 26d6c54108dc8fcfb9add7f0ba22c1bc108d326d Mon Sep 17 00:00:00 2001 From: Dhananjay Sathe Date: Thu, 19 Dec 2013 13:48:45 +0530 Subject: [PATCH 21/21] Fixes --- lib/pingdom/analysis.rb | 8 ++++---- pingdom-ruby.gemspec | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pingdom/analysis.rb b/lib/pingdom/analysis.rb index 350f1dc..40d86c9 100644 --- a/lib/pingdom/analysis.rb +++ b/lib/pingdom/analysis.rb @@ -1,5 +1,5 @@ module Pingdom - + # {"id"=>259103, "timefirsttest"=>203173, "timeconfirmtest"=>1298102416} class Analysis < Base def self.parse(client, response) @@ -8,8 +8,8 @@ def self.parse(client, response) new(client, response, analysis_element) end end - + attributes :timefirsttest => :time_start, - :timeconfirmtest => :time_confirm, - end + :timeconfirmtest => :time_confirm + end end \ No newline at end of file diff --git a/pingdom-ruby.gemspec b/pingdom-ruby.gemspec index 2e7d452..f68ed9e 100644 --- a/pingdom-ruby.gemspec +++ b/pingdom-ruby.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |s| "lib/pingdom.rb", "lib/tinder/faraday_response.rb", "Rakefile", - "Readme.md", + "README.md", "spec/pingdom-ruby_spec.rb", "spec/spec_helper.rb" ]