rbIRC 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/rbirc.rb +29 -0
- metadata +45 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 8619381b71d32efcccaf19b8de94009b3bfac628
|
|
4
|
+
data.tar.gz: 0b9975bdcd5a29aa04e4743234822a3c3473fe94
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 383c5d3407f6e50f110197fd285b9f274d796b804b2a5a69a6d780c4f9559ce311cff3f58da1fce387eb7af47c7d292e539ad345fd7f1356d425422341426f6e
|
|
7
|
+
data.tar.gz: ead3fc7ee59b0081b73a662cebab6c33e8cbca0bbb043ba9ef4462d175908785b72a1ee75e7c197b784e834a6e18fe7af0883a5a76f5d32008acc665281f3426
|
data/lib/rbirc.rb
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require 'socket'
|
|
2
|
+
class RbIRC
|
|
3
|
+
#The main class
|
|
4
|
+
#
|
|
5
|
+
#Example
|
|
6
|
+
# >>RbIRC.start("irc.rizon.net", "MyNick", "#YourFavouriteChannel")
|
|
7
|
+
# It should connect after that and will start showing essentially raw IRC
|
|
8
|
+
def self.start(server, nick, channel)
|
|
9
|
+
puts "Starting connect to #{server} with nick #{nick}"
|
|
10
|
+
sock = TCPSocket.new(server, 6667)
|
|
11
|
+
while stuff = sock.gets
|
|
12
|
+
if stuff.include? "Couldn't"
|
|
13
|
+
sock.puts "USER #{nick} #{nick} #{nick} :#{nick}\r\n", 'UTF-8'
|
|
14
|
+
sock.puts "NICK #{nick}\r\n" , 'UTF-8'
|
|
15
|
+
sock.puts "JOIN #{channel}\r\n"
|
|
16
|
+
end
|
|
17
|
+
puts stuff
|
|
18
|
+
end
|
|
19
|
+
while line = sock.gets
|
|
20
|
+
if line.include? "PING"
|
|
21
|
+
ping = Array.new
|
|
22
|
+
ping = line.split(':')
|
|
23
|
+
sock.puts "PONG : #{ping[1]}\r\n"
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
#rbIRC.start('irc6.rizon.net', 'Fanebot', '#Hazeroncommonwealth')
|
metadata
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: rbIRC
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.2
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Fane
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2015-08-12 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: A simple IRC framework made for either making a bot or even an IRC client.
|
|
14
|
+
Currently can only connect to a server and join a channel
|
|
15
|
+
email: n/a
|
|
16
|
+
executables: []
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- lib/rbirc.rb
|
|
21
|
+
homepage: http://rubygems.org/gems/rbIRC
|
|
22
|
+
licenses:
|
|
23
|
+
- MIT
|
|
24
|
+
metadata: {}
|
|
25
|
+
post_install_message:
|
|
26
|
+
rdoc_options: []
|
|
27
|
+
require_paths:
|
|
28
|
+
- lib
|
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0'
|
|
39
|
+
requirements: []
|
|
40
|
+
rubyforge_project:
|
|
41
|
+
rubygems_version: 2.4.6
|
|
42
|
+
signing_key:
|
|
43
|
+
specification_version: 4
|
|
44
|
+
summary: Simple IRC framework!
|
|
45
|
+
test_files: []
|