blob: 8843ddeeab6ffefa0dc4d6be79fc98d3da84482a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!/usr/bin/ruby
#
# Nickserver key discovery daemon
#
def load_library(name)
begin # try without rubygems (might be already loaded or not present)
require name
rescue LoadError
begin # try it as a gem
require 'rubygems'
require name
rescue LoadError # try manually, requiring gems in Gemfile if it exists.
base_directory = File.expand_path('../..', File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__)
if File.exists?("#{base_directory}/Gemfile.lock")
ENV['BUNDLE_GEMFILE'] ||= "#{base_directory}/Gemfile"
require 'bundler'
Bundler.require(:default)
end
$LOAD_PATH << "#{base_directory}/lib"
require name
end
end
end
load_library('nickserver')
Nickserver::Daemon.run('nickserver') do
EventMachine.run do
Nickserver::Server.start
end
end
|