Module: Hubeye::Server

Included in:
Server
Defined in:
lib/hubeye/server/commit.rb,
lib/hubeye/server/server.rb,
lib/hubeye/server/session.rb

Defined Under Namespace

Classes: AddHook, AddRepo, Commit, Exit, ListHooks, ListTracking, LoadHook, LoadRepo, Next, RmRepo, SaveHook, SaveRepo, Server, Session, Shutdown, Strategy

Constant Summary collapse

CONFIG_FILE =
File.join(ENV['HOME'], ".hubeye", "hubeyerc")
CONFIG =
{}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#daemonizedObject (readonly)

Returns the value of attribute daemonized.



11
12
13
# File 'lib/hubeye/server/server.rb', line 11

def daemonized
  @daemonized
end

#remote_connectionObject

Returns the value of attribute remote_connection.



10
11
12
# File 'lib/hubeye/server/server.rb', line 10

def remote_connection
  @remote_connection
end

#sessionObject (readonly)

Returns the value of attribute session.



11
12
13
# File 'lib/hubeye/server/server.rb', line 11

def session
  @session
end

#socketObject (readonly)

Returns the value of attribute socket.



11
12
13
# File 'lib/hubeye/server/server.rb', line 11

def socket
  @socket
end

#socketsObject (readonly)

Returns the value of attribute sockets.



11
12
13
# File 'lib/hubeye/server/server.rb', line 11

def sockets
  @sockets
end

Instance Method Details

#start(port, options = {}) ⇒ Object



459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
# File 'lib/hubeye/server/server.rb', line 459

def start(port, options={})
  listen(port)
  setup_env(options)
  loop do
    waiting = catch(:connect) do
      look_for_changes unless @remote_connection
    end
    client_connect(@sockets) if waiting
    catch(:invalid_input) do
      strategy = Strategy.new(self)
      strategy.call
    end
    @session.cleanup
  end
end