3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/hyper-operation/transport/connection.rb', line 3
def needs_init?
return false if Hyperloop.transport == :none
return true if connection.respond_to?(:data_sources) && !connection.data_sources.include?(table_name)
return true if !connection.respond_to?(:data_sources) && !connection.tables.include?(table_name)
return false unless Hyperloop.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
|