watch_list 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,31 @@
1
+ describe 'monitor' do
2
+ it do
3
+ watch_list do
4
+ <<-RUBY
5
+ monitor "http monitor" do
6
+ target "http://example.com"
7
+ interval 5
8
+ paused false
9
+ alert_contact :email, "#{WATCH_LIST_TEST_EMAIL}"
10
+ type :http
11
+ end
12
+
13
+ alert_contact do
14
+ type :email
15
+ value "#{WATCH_LIST_TEST_EMAIL}"
16
+ end
17
+ RUBY
18
+ end
19
+
20
+ wait_until {|h| h[:monitors].length > 0 }
21
+
22
+ status = watch_list_client.status
23
+ monitor = status[:monitors]['http monitor']
24
+
25
+ expect(status).to have_key(:timezone)
26
+ expect(monitor).to have_key(:status)
27
+ expect(monitor).to have_key(:alltimeuptimeratio)
28
+ expect(monitor).to have_key(:log)
29
+ expect(monitor).to have_key(:responsetime)
30
+ end
31
+ end
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'watch_list/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'watch_list'
8
+ spec.version = WatchList::VERSION
9
+ spec.authors = ['Genki Sugawara']
10
+ spec.email = ['sgwr_dts@yahoo.co.jp']
11
+ spec.summary = %q{watch_list is a tool to manage Uptime Robot.}
12
+ spec.description = %q{watch_list is a tool to manage Uptime Robot. It defines Uptime Robot monitors using Ruby DSL, and updates monitors according to DSL.}
13
+ spec.homepage = 'https://github.com/winebarrel/watch_list'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'uptimerobot', '>= 0.1.6'
22
+ spec.add_dependency 'term-ansicolor'
23
+
24
+ spec.add_development_dependency 'bundler'
25
+ spec.add_development_dependency 'rake'
26
+ spec.add_development_dependency 'rspec', '>= 3.0.0'
27
+ end
metadata ADDED
@@ -0,0 +1,154 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: watch_list
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Genki Sugawara
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: uptimerobot
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.1.6
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.1.6
27
+ - !ruby/object:Gem::Dependency
28
+ name: term-ansicolor
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: 3.0.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: 3.0.0
83
+ description: watch_list is a tool to manage Uptime Robot. It defines Uptime Robot
84
+ monitors using Ruby DSL, and updates monitors according to DSL.
85
+ email:
86
+ - sgwr_dts@yahoo.co.jp
87
+ executables:
88
+ - watch_list
89
+ extensions: []
90
+ extra_rdoc_files: []
91
+ files:
92
+ - .gitignore
93
+ - .rspec
94
+ - .travis.yml
95
+ - Gemfile
96
+ - LICENSE.txt
97
+ - README.md
98
+ - Rakefile
99
+ - bin/watch_list
100
+ - lib/watch_list.rb
101
+ - lib/watch_list/client.rb
102
+ - lib/watch_list/constants.rb
103
+ - lib/watch_list/driver.rb
104
+ - lib/watch_list/dsl.rb
105
+ - lib/watch_list/dsl/context.rb
106
+ - lib/watch_list/dsl/context/alert_contact.rb
107
+ - lib/watch_list/dsl/context/monitor.rb
108
+ - lib/watch_list/dsl/context/monitor/http.rb
109
+ - lib/watch_list/dsl/context/monitor/keyword.rb
110
+ - lib/watch_list/dsl/context/monitor/ping.rb
111
+ - lib/watch_list/dsl/context/monitor/port.rb
112
+ - lib/watch_list/dsl/context/monitor/type.rb
113
+ - lib/watch_list/dsl/converter.rb
114
+ - lib/watch_list/exporter.rb
115
+ - lib/watch_list/ext/string_ext.rb
116
+ - lib/watch_list/logger.rb
117
+ - lib/watch_list/utils.rb
118
+ - lib/watch_list/version.rb
119
+ - spec/alert_contact_spec.rb
120
+ - spec/monitor_spec.rb
121
+ - spec/paused_spec.rb
122
+ - spec/spec_helper.rb
123
+ - spec/status_spec.rb
124
+ - watch_list.gemspec
125
+ homepage: https://github.com/winebarrel/watch_list
126
+ licenses:
127
+ - MIT
128
+ metadata: {}
129
+ post_install_message:
130
+ rdoc_options: []
131
+ require_paths:
132
+ - lib
133
+ required_ruby_version: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - '>='
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ required_rubygems_version: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ requirements: []
144
+ rubyforge_project:
145
+ rubygems_version: 2.0.14
146
+ signing_key:
147
+ specification_version: 4
148
+ summary: watch_list is a tool to manage Uptime Robot.
149
+ test_files:
150
+ - spec/alert_contact_spec.rb
151
+ - spec/monitor_spec.rb
152
+ - spec/paused_spec.rb
153
+ - spec/spec_helper.rb
154
+ - spec/status_spec.rb