heartcheck-activerecord 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d606e6e2213e2656734ebc24574f0e330b60bc56
4
+ data.tar.gz: 07de80c3cc6ea895dbc9bda1077a724473109a12
5
+ SHA512:
6
+ metadata.gz: 9d04936a713c35e3f1fe0f38f1336beb072cbb6b85960b6b0628de7624ed683b3a36494404757356a20ecdd81a6768b247c000087147abe0d60787924a83c3f1
7
+ data.tar.gz: aeefc86bcaba3947b8df122baa764d798d83825614fa5256715ff3e2a5568d69dd74ff79940643afa5608d0d65d4196010508b0b668aa28c65c58a67d54407a2
@@ -0,0 +1,3 @@
1
+ require 'active_record'
2
+ require 'heartcheck'
3
+ require 'heartcheck/checks/activerecord'
@@ -0,0 +1,7 @@
1
+ # from hearcheck gem
2
+ module Heartcheck
3
+ # gem version
4
+ module Activerecord
5
+ VERSION = '0.0.1'
6
+ end
7
+ end
@@ -0,0 +1,33 @@
1
+ module Heartcheck
2
+ module Checks
3
+ # Check for a activerecord connection
4
+ # Base is set in heartcheck gem
5
+ class Activerecord < Base
6
+ # validate service connection
7
+ #
8
+ # @retun [void]
9
+ def validate
10
+ services.each do |service|
11
+ begin
12
+ service[:connection].execute('select 1')
13
+ rescue
14
+ append_error(service)
15
+ end
16
+ end
17
+ end
18
+
19
+ private
20
+
21
+ # customize the error message
22
+ # It's called in Heartcheck::Checks::Base#append_error
23
+ #
24
+ # @param [Hash] service
25
+ # @option opts [String] :name The connection identifier
26
+ #
27
+ # @return [void]
28
+ def custom_error(service)
29
+ @errors << "Error to use the \"#{service[:name]}\" connection"
30
+ end
31
+ end
32
+ end
33
+ end
metadata ADDED
@@ -0,0 +1,196 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: heartcheck-activerecord
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Locaweb
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: heartcheck
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.0.0
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.0.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: 1.0.0
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.0.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: activerecord
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 3.0.0
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 3.0.0
47
+ - !ruby/object:Gem::Dependency
48
+ name: sqlite3
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: pry-nav
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: 0.2.0
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 0.2.4
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: 0.2.0
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 0.2.4
81
+ - !ruby/object:Gem::Dependency
82
+ name: rspec
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - "~>"
86
+ - !ruby/object:Gem::Version
87
+ version: 3.1.0
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: 3.1.0
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: 3.1.0
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: 3.1.0
101
+ - !ruby/object:Gem::Dependency
102
+ name: rubocop
103
+ requirement: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - "~>"
106
+ - !ruby/object:Gem::Version
107
+ version: 0.27.0
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: 0.27.1
111
+ type: :development
112
+ prerelease: false
113
+ version_requirements: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.27.0
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: 0.27.1
121
+ - !ruby/object:Gem::Dependency
122
+ name: yard
123
+ requirement: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - "~>"
126
+ - !ruby/object:Gem::Version
127
+ version: 0.8.0
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: 0.8.7
131
+ type: :development
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: 0.8.0
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: 0.8.7
141
+ - !ruby/object:Gem::Dependency
142
+ name: redcarpet
143
+ requirement: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - "~>"
146
+ - !ruby/object:Gem::Version
147
+ version: 3.2.0
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: 3.2.2
151
+ type: :development
152
+ prerelease: false
153
+ version_requirements: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - "~>"
156
+ - !ruby/object:Gem::Version
157
+ version: 3.2.0
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: 3.2.2
161
+ description: Plugin to check activerecord connection in heartcheck.
162
+ email:
163
+ - desenvolvedores@locaweb.com.br
164
+ executables: []
165
+ extensions: []
166
+ extra_rdoc_files: []
167
+ files:
168
+ - lib/heartcheck/activerecord.rb
169
+ - lib/heartcheck/activerecord/version.rb
170
+ - lib/heartcheck/checks/activerecord.rb
171
+ homepage: http://developer.locaweb.com.br
172
+ licenses:
173
+ - MIT
174
+ metadata: {}
175
+ post_install_message:
176
+ rdoc_options: []
177
+ require_paths:
178
+ - lib
179
+ required_ruby_version: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: '0'
184
+ required_rubygems_version: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - ">="
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
189
+ requirements: []
190
+ rubyforge_project:
191
+ rubygems_version: 2.4.5
192
+ signing_key:
193
+ specification_version: 4
194
+ summary: A activerecord checker
195
+ test_files: []
196
+ has_rdoc: