3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/synchromesh/connection.rb', line 3
def needs_init?
return true unless connection.tables.include?(table_name)
return false unless HyperMesh.on_server?
return true if defined?(Rails::Server)
return true unless Connection.root_path
uri = URI("#{Connection.root_path}server_up")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.path)
if uri.scheme == 'https'
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
http.request(request) && return rescue true
end
|