komachi_heartbeat 2.2.0 → 2.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1609f6011bd2ba4e3408665bfee66323ca0fc05
4
- data.tar.gz: 47363d0d94b506c9eeecd2468cef142eaee8f48f
3
+ metadata.gz: 578fb4a6c1f99f7e74f955742c53f1c06bc4c8ee
4
+ data.tar.gz: 26b85f1ad61a38a8ed2a97242518fd565fb2b636
5
5
  SHA512:
6
- metadata.gz: fa8d12a45cbb5052afdacd1b9b234cf4ca59a77beb673a465e2d4505f5bcf33246c7d5df92ba9981ab0bee27efb0ff11e0cc26ca7be142f90197c90ab0cdeaf5
7
- data.tar.gz: efeff23fb14777187f1abf78f4aa7dedc1c88b91fb166b8d867594c7351d505bc72c936c461a11273fef908118df8e4f41144e6de448e26a085bbb20bfd67135
6
+ metadata.gz: 83eff2290d55fbaf83255a4b732c7b2d3005da171d330ef3916bfefa44c88211855f2370e5dd37ff5ee4131bfd9c4df82c3640b549db85361874f27d9e59cf37
7
+ data.tar.gz: 8fa0b986ab4619f24fe14fdb4b4957cea28e39e4724bd4114c02d9610bc85481d73d4aa31f73eeb7f1396a15916b6db950f47ef0be75e7edba24abed15ac65e5
@@ -2,10 +2,16 @@ require_dependency "komachi_heartbeat/application_controller"
2
2
 
3
3
  module KomachiHeartbeat
4
4
  class HeartbeatController < ApplicationController
5
+ RED = "#e05d44"
6
+ GREEN = "#4c1"
5
7
 
6
- unless Rails.env.test?
7
- rescue_from Exception do |exception|
8
- head :internal_server_error
8
+ rescue_from Exception do |exception|
9
+ @message = "NG"
10
+ @badge_color = RED
11
+
12
+ respond_to do |format|
13
+ format.svg { render :index }
14
+ format.any { head :internal_server_error }
9
15
  end
10
16
  end
11
17
 
@@ -14,7 +20,13 @@ module KomachiHeartbeat
14
20
  redis_connection_check if redis_check?
15
21
  memcached_connection_check if memcached_check?
16
22
 
17
- render text: "heartbeat:ok", status: 200
23
+ @message = "ok"
24
+ @badge_color = GREEN
25
+
26
+ respond_to do |format|
27
+ format.svg { }
28
+ format.any { render plain: "heartbeat:ok", status: 200 }
29
+ end
18
30
  end
19
31
 
20
32
  def version
@@ -0,0 +1,18 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="99" height="18">
2
+ <linearGradient id="a" x2="0" y2="100%">
3
+ <stop offset="0" stop-color="#fff" stop-opacity=".7"/>
4
+ <stop offset=".1" stop-color="#aaa" stop-opacity=".1"/>
5
+ <stop offset=".9" stop-opacity=".3"/>
6
+ <stop offset="1" stop-opacity=".5"/>
7
+ </linearGradient>
8
+ <rect rx="4" width="99" height="18" fill="#555"/>
9
+ <rect rx="4" x="63" width="36" height="18" fill="<%= @badge_color %>"/>
10
+ <path fill="<%= @badge_color %>" d="M63 0h4v18h-4z"/>
11
+ <rect rx="4" width="99" height="18" fill="url(#a)"/>
12
+ <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
13
+ <text x="32.5" y="14" fill="#010101" fill-opacity=".3">heartbeat</text>
14
+ <text x="32.5" y="13">heartbeat</text>
15
+ <text x="80" y="14" fill="#010101" fill-opacity=".3"><%= @message %></text>
16
+ <text x="80" y="13"><%= @message %></text>
17
+ </g>
18
+ </svg>
@@ -0,0 +1,9 @@
1
+ module KomachiHeartbeat
2
+ class Railtie < ::Rails::Railtie
3
+ initializer "komachi_heartbeat.register_mime" do
4
+ unless Mime[:svg]
5
+ Mime::Type.register "image/svg+xml", :svg
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module KomachiHeartbeat
2
- VERSION = "2.2.0"
2
+ VERSION = "2.3.0"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require "komachi_heartbeat/config"
2
2
  require "komachi_heartbeat/engine"
3
+ require "komachi_heartbeat/railtie"
3
4
 
4
5
  module KomachiHeartbeat
5
6
  def self.config
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: komachi_heartbeat
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takumi MIURA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-30 00:00:00.000000000 Z
11
+ date: 2016-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.2.11
19
+ version: 4.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 3.2.11
26
+ version: 4.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: redis
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -220,6 +220,20 @@ dependencies:
220
220
  - - ">="
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
+ - !ruby/object:Gem::Dependency
224
+ name: test-unit
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - ">="
235
+ - !ruby/object:Gem::Version
236
+ version: '0'
223
237
  description: Alive Monitoring of Application Server and DB Server.
224
238
  email:
225
239
  - mitaku1104@gmail.com
@@ -235,11 +249,13 @@ files:
235
249
  - app/controllers/komachi_heartbeat/stats_controller.rb
236
250
  - app/helpers/komachi_heartbeat/application_helper.rb
237
251
  - app/helpers/komachi_heartbeat/heartbeat_helper.rb
252
+ - app/views/komachi_heartbeat/heartbeat/index.svg.erb
238
253
  - app/views/layouts/komachi_heartbeat/application.html.erb
239
254
  - config/routes.rb
240
255
  - lib/komachi_heartbeat.rb
241
256
  - lib/komachi_heartbeat/config.rb
242
257
  - lib/komachi_heartbeat/engine.rb
258
+ - lib/komachi_heartbeat/railtie.rb
243
259
  - lib/komachi_heartbeat/version.rb
244
260
  - lib/tasks/komachi_heartbeat_tasks.rake
245
261
  homepage: https://github.com/mitaku/komachi_heartbeat
@@ -261,7 +277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
261
277
  version: '0'
262
278
  requirements: []
263
279
  rubyforge_project:
264
- rubygems_version: 2.4.5
280
+ rubygems_version: 2.5.1
265
281
  signing_key:
266
282
  specification_version: 4
267
283
  summary: Rails Application Heartbeat Check Engine.