mutle-neighborhoodwatch-agent 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  .DS_Store
2
2
  *.swp
3
+ *.gem
@@ -6,6 +6,7 @@ module NeighborhoodWatch
6
6
 
7
7
  TIMEOUT = 20
8
8
  SERVER = "beta.neighborhoodwat.ch"
9
+ OK_STATUS = [200, 301, 302]
9
10
 
10
11
  def self.run
11
12
  EventMachine.run {
@@ -34,6 +35,7 @@ module NeighborhoodWatch
34
35
 
35
36
  multi = EventMachine::MultiRequest.new
36
37
  site_requests = []
38
+ puts sites.inspect
37
39
  sites.each do |site|
38
40
  req = EventMachine::HttpRequest.new(site['url']).get(:timeout => TIMEOUT)
39
41
  multi.add(req); site_requests << req
@@ -42,7 +44,7 @@ module NeighborhoodWatch
42
44
  status = {}
43
45
  multi.responses[:succeeded].each do |resp|
44
46
  site = sites[site_requests.index(resp)]
45
- if resp.response_header.status == 200
47
+ if OK_STATUS.include?(resp.response_header.status)
46
48
  status[site['id']] = "up"
47
49
  else
48
50
  status[site['id']] = "error-#{resp.response_header.status}"
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{neighborhoodwatch-agent}
5
- s.version = "0.0.1"
5
+ s.version = "0.0.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Mutwin Kraus"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mutle-neighborhoodwatch-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mutwin Kraus