watchman 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ include Watchman
4
+ describe "Watchman::CallWatcher" do
5
+ before(:each) do
6
+ Client.username = "some.name"
7
+ Client.password = "1234"
8
+ Client.host = "some.cad-host.com"
9
+ IstatusMocker.fake_call_path(Client.host,"201023687")
10
+ end
11
+
12
+ it "can find the address" do
13
+ call = CallWatcher.new.info_for("201023687")
14
+ call.address.should == "7750 HIGHWAY AB E"
15
+ call.incident_number.should == "201023687"
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ include Watchman
4
+ describe "Watchman::Client" do
5
+ before(:each) do
6
+ Client.username = "some.name"
7
+ Client.password = "1234"
8
+ Client.host = "some.cad-host.com"
9
+ end
10
+
11
+ describe "authentication info" do
12
+ it "can have auth info set" do
13
+ Client.username.should == "some.name"
14
+ Client.password.should == "1234"
15
+ Client.host.should == "some.cad-host.com"
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ include Watchman
4
+ describe "Watchman::MedicWatcher" do
5
+ before(:each) do
6
+ Client.username = "some.name"
7
+ Client.password = "1234"
8
+ Client.host = "some.cad-host.com"
9
+ IstatusMocker.fake_medic_path(Client.host)
10
+ end
11
+
12
+ let(:watcher){ MedicWatcher.new}
13
+
14
+ it "can pull the medic apparatus page" do
15
+ watcher.raw_page.should =~ /M131/
16
+ end
17
+
18
+ it "can count the medic units in the city" do
19
+ watcher.city_status.should == 4
20
+ end
21
+
22
+ it "counts the medic units in the county" do
23
+ watcher.county_status.should == 6
24
+ end
25
+
26
+ it "can find the status of one medic unit" do
27
+ watcher.status_of("131").should == "AVL"
28
+ end
29
+ end
data/watchman.gemspec ADDED
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path("../lib/watchman/version", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "watchman"
6
+ s.version = Watchman::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Ethan Vizitei"]
9
+ s.email = ["ethan.vizitei@gmail.com"]
10
+ s.homepage = "http://rubygems.org/gems/watchman"
11
+ s.summary = "monitor your CAD"
12
+ s.description = "works for our web-view on the CAD produced by enroute. your mileage may vary."
13
+
14
+ s.required_rubygems_version = ">= 1.3.6"
15
+ s.rubyforge_project = "watchman"
16
+
17
+ s.add_dependency "mechanize"
18
+
19
+ s.add_development_dependency "bundler", ">= 1.0.0.rc.6"
20
+ s.add_development_dependency "rspec", ">= 2.3.0"
21
+ s.add_development_dependency "fakeweb"
22
+
23
+ s.files = `git ls-files`.split("\n")
24
+ s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
25
+ s.require_path = 'lib'
26
+ end
metadata ADDED
@@ -0,0 +1,147 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: watchman
3
+ version: !ruby/object:Gem::Version
4
+ hash: 25
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 3
10
+ version: 0.0.3
11
+ platform: ruby
12
+ authors:
13
+ - Ethan Vizitei
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-12-19 00:00:00 -06:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: mechanize
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: bundler
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 15424057
44
+ segments:
45
+ - 1
46
+ - 0
47
+ - 0
48
+ - rc
49
+ - 6
50
+ version: 1.0.0.rc.6
51
+ type: :development
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: rspec
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 3
62
+ segments:
63
+ - 2
64
+ - 3
65
+ - 0
66
+ version: 2.3.0
67
+ type: :development
68
+ version_requirements: *id003
69
+ - !ruby/object:Gem::Dependency
70
+ name: fakeweb
71
+ prerelease: false
72
+ requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ hash: 3
78
+ segments:
79
+ - 0
80
+ version: "0"
81
+ type: :development
82
+ version_requirements: *id004
83
+ description: works for our web-view on the CAD produced by enroute. your mileage may vary.
84
+ email:
85
+ - ethan.vizitei@gmail.com
86
+ executables: []
87
+
88
+ extensions: []
89
+
90
+ extra_rdoc_files: []
91
+
92
+ files:
93
+ - .gitignore
94
+ - .rvmrc
95
+ - Gemfile
96
+ - Gemfile.lock
97
+ - Rakefile
98
+ - lib/watchman.rb
99
+ - lib/watchman/call.rb
100
+ - lib/watchman/call_watcher.rb
101
+ - lib/watchman/client.rb
102
+ - lib/watchman/medic_watcher.rb
103
+ - lib/watchman/version.rb
104
+ - spec/spec_helper.rb
105
+ - spec/support/istatus_mocker.rb
106
+ - spec/watchman/call_watcher_spec.rb
107
+ - spec/watchman/client_spec.rb
108
+ - spec/watchman/medic_watcher_spec.rb
109
+ - watchman.gemspec
110
+ has_rdoc: true
111
+ homepage: http://rubygems.org/gems/watchman
112
+ licenses: []
113
+
114
+ post_install_message:
115
+ rdoc_options: []
116
+
117
+ require_paths:
118
+ - lib
119
+ required_ruby_version: !ruby/object:Gem::Requirement
120
+ none: false
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ hash: 3
125
+ segments:
126
+ - 0
127
+ version: "0"
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ hash: 23
134
+ segments:
135
+ - 1
136
+ - 3
137
+ - 6
138
+ version: 1.3.6
139
+ requirements: []
140
+
141
+ rubyforge_project: watchman
142
+ rubygems_version: 1.3.7
143
+ signing_key:
144
+ specification_version: 3
145
+ summary: monitor your CAD
146
+ test_files: []
147
+