Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Now ping works on all rubies

  • Loading branch information...
commit 4fd6f47489e6935e4a407f8be361d39c937120d2 1 parent e170f64
@lukefx authored
View
10 Gemfile
@@ -5,8 +5,14 @@ gem 'rails', '3.2.6'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
-gem 'activerecord-jdbcsqlite3-adapter'
-gem 'jruby-openssl'
+platforms :jruby do
+ gem 'activerecord-jdbcsqlite3-adapter'
+ gem 'jruby-openssl'
+end
+
+platforms :ruby do
+ gem 'sqlite3'
+end
# Gems used only for assets and not required
# in production environments by default.
View
4 Gemfile.lock
@@ -45,6 +45,7 @@ GEM
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
+ ffi (1.0.11)
ffi (1.0.11-java)
hike (1.2.1)
i18n (0.6.0)
@@ -102,6 +103,7 @@ GEM
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
+ sqlite3 (1.3.6)
therubyrhino (1.73.4)
thor (0.15.4)
tilt (1.3.3)
@@ -115,6 +117,7 @@ GEM
PLATFORMS
java
+ ruby
DEPENDENCIES
activerecord-jdbcsqlite3-adapter
@@ -124,5 +127,6 @@ DEPENDENCIES
net-ping
rails (= 3.2.6)
sass-rails (~> 3.2.3)
+ sqlite3
therubyrhino
uglifier (>= 1.0.3)
View
5 app/models/ping_checker.rb
@@ -1,9 +1,8 @@
class PingChecker < Checker
def up?
- require 'java'
- address = java.net.InetAddress.getByName(self.server.ip)
- address.isReachable(5000)
+ p = Net::Ping::External.new(self.server.ip, 7)
+ p.ping?
end
end
View
1  config/application.rb
@@ -2,6 +2,7 @@
require 'rails/all'
require 'open-uri'
+require 'net/ping'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Please sign in to comment.
Something went wrong with that request. Please try again.