aboutsummaryrefslogtreecommitdiff
path: root/irc.rb
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-04-20 04:23:20 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-04-20 04:23:20 -0700
commit7f134adccb20abe773234acecf526c9951b418e8 (patch)
treeeeb4b4f96a963591f244c8f661b84dd194cf1484 /irc.rb
parent7e7aa3278a9e478b02eb152575fb00ee0802ac81 (diff)
downloaddinobot-7f134adccb20abe773234acecf526c9951b418e8.tar.gz
dinobot-7f134adccb20abe773234acecf526c9951b418e8.tar.xz
Improved namespace and directory structure.
Diffstat (limited to 'irc.rb')
-rw-r--r--irc.rb65
1 files changed, 0 insertions, 65 deletions
diff --git a/irc.rb b/irc.rb
deleted file mode 100644
index bb7146d..0000000
--- a/irc.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require 'socket'
-
-require_relative 'logger'
-
-module Dinobot
- class IRC
- def initialize(server, port, nick, pass=nil)
- @server = server
- @port = port
- @nick = nick
- @pass = pass
-
- @socket = nil
- @logger = Dinobot::Logger.instance
- end
-
- def connect
- @logger.info "Connecting to #{@server}:#{@port}."
-
- @socket = TCPSocket.new(@server, @port)
-
- puts "PASS #{@pass}" if @pass
- puts "NICK #{@nick}"
- puts "USER #{@nick} 0 * :#{@nick}"
- end
-
- def disconnect
- @socket.close
- end
-
- def connected?
- !(@socket.nil? || @socket.closed?)
- end
-
- def gets
- str = @socket.gets
-
- @logger.in str.inspect
-
- str
- end
-
- def puts(str)
- @logger.out str.inspect
-
- @socket.puts str
- end
-
- def pong(message)
- puts "PONG #{message}"
- end
-
- def join(channel)
- puts "JOIN #{channel}"
- end
-
- def part(channel)
- puts "PART #{channel}"
- end
-
- def privmsg(channel, message)
- puts "PRIVMSG #{channel} :#{message}"
- end
- end
-end