Permalink
Browse files

LiveConsole 0.2.0: This time it's personal.

  • Loading branch information...
1 parent 543acd5 commit 61b5547e5d53db309129d2fed5ecf3d1147a9831 tailor committed Feb 12, 2008
Showing with 9 additions and 15 deletions.
  1. +1 −1 lib/live_console/io_methods.rb
  2. +7 −13 lib/live_console/io_methods/socket_io.rb
  3. +1 −1 lib/live_console_config.rb
@@ -33,7 +33,7 @@ def missing_opts
def self.included(other)
other.instance_eval {
- readers = [:opts, :raw_input, :raw_output]
+ readers = [:opts, :raw]
attr_accessor *readers
private *readers.map { |r| (r.to_s + '=').to_sym }
@@ -1,33 +1,27 @@
class LiveConsole::IOMethods::SocketIO
+
DefaultOpts = {
- :host => '127.0.0.1',
+ :host => '127.0.0.1'
}.freeze
RequiredOpts = DefaultOpts.keys + [:port]
- include LiveConsole::IOMethods::IOMethod
-
def start
@server ||= TCPServer.new host, port
begin
- self.raw_input = self.raw_output = server.accept_nonblock
+ self.raw = @server.accept_nonblock
return true
rescue Errno::EAGAIN, Errno::ECONNABORTED, Errno::EPROTO,
Errno::EINTR => e
- select
+ stop
retry
end
end
def stop
- select
- raw_input.close rescue nil
+ IO.select [@server], [], [], 1 if @server
+ raw.close rescue nil
end
- def select
- IO.select [server], [], [], 1 if server
- end
-
- private
- attr_accessor :server
+ include LiveConsole::IOMethods::IOMethod
end
@@ -3,6 +3,6 @@ module LiveConsoleConfig
Authors = 'Pete Elmore'
Email = 'pete.elmore@gmail.com'
PkgName = 'live_console'
- Version = '0.1.0'
+ Version = '0.2.0'
URL = 'http://debu.gs/live-console'
end

0 comments on commit 61b5547

Please sign in to comment.