rails-pulse 0.4.3 → 0.4.5

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.
Files changed (2) hide show
  1. data/lib/pulse_controller.rb +4 -1
  2. metadata +19 -5
@@ -5,7 +5,10 @@ class PulseController < ActionController::Base
5
5
  #returned, 'OK' is displayed and a 200 response code is returned. If not,
6
6
  #'ERROR' is returned along with a 500 response code.
7
7
  def pulse
8
- if (ActiveRecord::Base.connection.execute("select 1 from dual").num_rows rescue 0) == 1
8
+ if (ActiveRecord::Base::connection_pool.spec.adapter_method =~ /mysql2/) &&
9
+ ((ActiveRecord::Base.connection.execute("select 1 from dual").count rescue 0) == 1)
10
+ render :text => "<html><body>OK #{Time.now.utc.to_s(:db)}</body></html>"
11
+ elsif (ActiveRecord::Base.connection.execute("select 1 from dual").num_rows rescue 0) == 1
9
12
  render :text => "<html><body>OK #{Time.now.utc.to_s(:db)}</body></html>"
10
13
  else
11
14
  render :text => '<html><body>ERROR</body></html>', :status => :internal_server_error
metadata CHANGED
@@ -1,16 +1,24 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-pulse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ hash: 5
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 4
9
+ - 5
10
+ version: 0.4.5
5
11
  platform: ruby
6
12
  authors:
7
13
  - Paul Gross
8
14
  - Jesse Newland
15
+ - Josh Goebel
16
+ - Will Farrington
9
17
  autorequire:
10
18
  bindir: bin
11
19
  cert_chain: []
12
20
 
13
- date: 2009-12-01 00:00:00 -05:00
21
+ date: 2011-02-07 00:00:00 -05:00
14
22
  default_executable:
15
23
  dependencies: []
16
24
 
@@ -41,21 +49,27 @@ rdoc_options: []
41
49
  require_paths:
42
50
  - lib
43
51
  required_ruby_version: !ruby/object:Gem::Requirement
52
+ none: false
44
53
  requirements:
45
54
  - - ">="
46
55
  - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
47
59
  version: "0"
48
- version:
49
60
  required_rubygems_version: !ruby/object:Gem::Requirement
61
+ none: false
50
62
  requirements:
51
63
  - - ">="
52
64
  - !ruby/object:Gem::Version
65
+ hash: 3
66
+ segments:
67
+ - 0
53
68
  version: "0"
54
- version:
55
69
  requirements: []
56
70
 
57
71
  rubyforge_project:
58
- rubygems_version: 1.3.5
72
+ rubygems_version: 1.5.0
59
73
  signing_key:
60
74
  specification_version: 3
61
75
  summary: Adds a pulse URL that pings the DB to a Rails app.