irc_socket 1.0.5 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/irc_socket.rb +13 -11
  3. metadata +11 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3349d3bcde4dd713984ca89e395a03e36959ac818e83fa0aa89323596a1a298
4
- data.tar.gz: 58851dc6709a5f384902b6d6f4599690aa66f4c185771aa4f1b7c5f6fc718673
3
+ metadata.gz: dede92b54a343c059fafbe34e55165fcf9b794abbe857eea8b3e02abdfbb32ea
4
+ data.tar.gz: 1bc273996c112b143362e4b51dca898fb0b87ceeb3ead7cb4fe0686b0bfeb083
5
5
  SHA512:
6
- metadata.gz: e5a2701b5bf7c873817a79083f9ac716dc7eea24bedc091ef3d6f713670cfe68058e25b57d30b33157502009dc96d9b99d54b2fab5de100b44a44b92e0460c6d
7
- data.tar.gz: 32e94e2e159e53c40cc96c98ffdcc739f37141e95430658fed630a1e47737fc02978712b4702202277a008cdee1539e278ae6683d29adecc913700d299d1547c
6
+ metadata.gz: 2a975c8f87882d1c3ba18293bfcfe8e48495df65f5566bf4aacc1fa332883d746b26c578b237578014078c32b3c200ffb92dd2d63c2af3e61d3bf91144d76abe
7
+ data.tar.gz: f833b6bd937c984c61a5cb0f3cb84db5d46a9c020b4e5333ce9439e53da39c7b086c913f0697ca9df9f13188925f132746aa9e17a789e6c98e0ca8c70e2eeee4
@@ -1,10 +1,7 @@
1
1
  require 'socket'
2
2
 
3
- # == Author
4
- # * Lee Jarvis - ljjarvis@gmail.com
5
- #
6
3
  # == Description
7
- # IRCSocket is an IRC wrapper around a TCPSocket. It implements all of the major
4
+ # IRCSocket is an IRC wrapper around a TCPSocket. It implements all of the major
8
5
  # commands laid out in {RFC 2812}[http://irchelp.org/irchelp/rfc/rfc2812.txt].
9
6
  # All these commands are available as instance methods of an IRCSocket Object.
10
7
  #
@@ -17,7 +14,7 @@ require 'socket'
17
14
  # irc.user "Hulk", 0, "*", "I am Hulk Hogan"
18
15
  #
19
16
  # while line = irc.read
20
- #
17
+ #
21
18
  # # Join a channel after MOTD
22
19
  # if line.split[1] == '376'
23
20
  # irc.join "#mychannel"
@@ -58,7 +55,7 @@ class IRCSocket
58
55
  irc.connect
59
56
  irc
60
57
  end
61
-
58
+
62
59
  # Create a new IRCSocket to connect to +server+ on +port+. Defaults to port 6667.
63
60
  # If an optional code block is given, it will be passed an instance of the IRCSocket.
64
61
  #
@@ -74,16 +71,16 @@ class IRCSocket
74
71
 
75
72
  if block_given?
76
73
  connect
77
- yield self
74
+ yield self
78
75
  end
79
76
  end
80
-
77
+
81
78
  # Check if our socket is alive and connected to an IRC server
82
79
  def connected?
83
80
  @connected
84
81
  end
85
82
  alias connected connected?
86
-
83
+
87
84
  # Connect to an IRC server, returns true on a successful connection, or
88
85
  # raises otherwise
89
86
  def connect
@@ -151,11 +148,14 @@ class IRCSocket
151
148
  write("NICK #{nickname}")
152
149
  end
153
150
 
154
- # Send USER command
151
+ # Send USER command
155
152
  def user(user, mode, unused, realname)
156
153
  write("USER #{user} #{mode} #{unused} :#{realname}")
157
154
  end
158
155
 
156
+ def lusers
157
+ write("LUSERS")
158
+ end
159
159
  # Send OPER command
160
160
  def oper(name, password)
161
161
  write("OPER #{name} #{password}")
@@ -287,6 +287,9 @@ class IRCSocket
287
287
  write_optional("USERS", target)
288
288
  end
289
289
 
290
+ def userip(target)
291
+ write_optional("USERIP", target)
292
+ end
290
293
  # Send USERHOST command
291
294
  def userhost(*users)
292
295
  write("USERHOST #{users.join(' ')}")
@@ -297,4 +300,3 @@ class IRCSocket
297
300
  @socket.close if connected?
298
301
  end
299
302
  end
300
-
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irc_socket
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
- - Lee Jarvis
8
- - Ken Spencer
7
+ - Ken 'Iota' Spencer
8
+ - Lee 'injekt' Jarvis
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
@@ -25,18 +25,14 @@ dependencies:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
27
  version: 2.1.0
28
- description: |+
28
+ description: |
29
29
  An IRC wrapper around TCPSocket.
30
-
31
-
32
- This is a mirror/grab/active version of leejarvis/irc-socket
33
-
34
-
35
- This also uses ruby conventions in naming, specifically
36
- changing `irc-socket` to `irc_socket` to make `IRCSocket` fit
37
- naming conventions.
38
-
39
- email: me+irc_socket@iotaspencer.me
30
+ This is a mirror-fork active version of leejarvis/irc-socket.
31
+ It uses ruby conventions in naming, specifically changing
32
+ `irc-socket` to `irc_socket` to make `IRCSocket` fit naming conventions.
33
+ email:
34
+ - me+irc_socket@iotaspencer.me
35
+ - ljjarvis@gmail.com
40
36
  executables: []
41
37
  extensions: []
42
38
  extra_rdoc_files: []
@@ -68,5 +64,5 @@ rubyforge_project:
68
64
  rubygems_version: 2.7.6
69
65
  signing_key:
70
66
  specification_version: 4
71
- summary: An IRC wrapper around TCPSocket
67
+ summary: An IRC wrapper around TCPSocket. Based on leejarvis/irc-socket.
72
68
  test_files: []