Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removing trailing whitespace

  • Loading branch information...
commit 6932182912e26e0ccfe96c59d5d50cbd8d495a50 1 parent 5d90f08
@m1foley m1foley authored
Showing with 14 additions and 14 deletions.
  1. +14 −14 init.rb
View
28 init.rb
@@ -22,7 +22,7 @@ def initialize(*args)
def index
if get_status
dependencies = @current_status
-
+
puts "\nRanger Status"
puts "------------------------------------------"
@@ -31,7 +31,7 @@ def index
code = record["dependency"]["latest_response_code"]
puts "#{url} #{up_or_down(code)}"
end
-
+
watchers_list
else
no_domains_monitored
@@ -47,7 +47,7 @@ def domains
domain_list
return
end
-
+
case args.shift
when "add"
url = args.shift
@@ -189,7 +189,7 @@ def create_dependency(url)
params = { :dependency => { :name => "Website", :url => url, :check_every => "1" }, :api_key => @ranger_api_key}
resource.post(params)
end
-
+
def remove_url(url)
if delete_dependency_from_url(url)
puts "Removed #{url} from the monitoring list"
@@ -200,7 +200,7 @@ def remove_url(url)
def delete_dependency_from_url(url)
dependencies = JSON.parse(get_dependencies)
-
+
dependency_id = nil
dependencies.each do |record|
if record["dependency"]["url"] == url
@@ -224,15 +224,15 @@ def delete_dependency(id)
def clear_all_dependencies
dependencies = JSON.parse(get_dependencies)
-
+
dependencies.each do |record|
delete_dependency(record["dependency"]["id"])
end
end
-
+
def clear_all_watchers
watchers = get_watchers
-
+
watchers.each do |record|
delete_watcher(record["watcher"]["id"])
end
@@ -249,7 +249,7 @@ def no_domains_monitored
def domain_list
if get_status
dependencies = @current_status
-
+
puts "\nDomains Being Monitored"
puts "------------------------------------------"
@@ -271,7 +271,7 @@ def get_watchers
def watchers_list
get_watchers
-
+
puts "\nApp Watchers"
puts "------------------------------------------"
@@ -281,13 +281,13 @@ def watchers_list
end
puts ""
end
-
+
def create_watcher(email)
resource = authenticated_resource("/apps/#{@ranger_app_id}/watchers.json")
params = { :watcher => { :email => email }, :api_key => @ranger_api_key}
resource.post(params)
end
-
+
def remove_watcher(email)
if delete_watcher_from_email(email)
puts "Removed #{email} as a watcher"
@@ -295,10 +295,10 @@ def remove_watcher(email)
puts "No watchers with that email found in the watcher list"
end
end
-
+
def delete_watcher_from_email(email)
watchers = get_watchers
-
+
watcher_id = nil
watchers.each do |record|
if record["watcher"]["email"] == email
Please sign in to comment.
Something went wrong with that request. Please try again.