ircp 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -6
- data/lib/ircp/message.rb +2 -1
- data/lib/ircp/prefix.rb +2 -1
- data/lib/ircp/version.rb +1 -1
- metadata +30 -10
data/README.md
CHANGED
@@ -19,15 +19,20 @@ Or install it yourself as:
|
|
19
19
|
## Usage
|
20
20
|
|
21
21
|
```ruby
|
22
|
+
# Parse
|
22
23
|
require 'ircp'
|
23
24
|
msg = Ircp.parse ':Angel!wings@irc.org PRIVMSG Wiz :Are you receiving this message ?'
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
p msg.prefix.nick # => 'Angel'
|
27
|
+
p msg.prefix.user # => 'wings'
|
28
|
+
p msg.prefix.host # => 'irc.org'
|
29
|
+
p msg.command # => 'PRIVMSG'
|
30
|
+
p msg.params[0] # => 'Wiz'
|
31
|
+
p msg.params[1] # => 'Are you receiving this message ?'
|
32
|
+
|
33
|
+
# Dump
|
34
|
+
msg = Ircp::Message.new 'Wiz', ':Are you receiving this message ?', :command => 'PRIVMSG', :prefix => {:nick => 'Angel', :user => 'wings', :host => 'irc.org'}
|
35
|
+
p msg.to_s # => ':Angel!wings@irc.org PRIVMSG Wiz :Are you receiving this message ?\r\n'
|
31
36
|
```
|
32
37
|
|
33
38
|
## Contributing
|
data/lib/ircp/message.rb
CHANGED
@@ -18,7 +18,7 @@ module Ircp
|
|
18
18
|
"<#{variables.join ' '}>"
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
21
|
+
def to_irc
|
22
22
|
if @raw.nil? || @raw.empty?
|
23
23
|
tokens = []
|
24
24
|
tokens << @prefix
|
@@ -32,5 +32,6 @@ module Ircp
|
|
32
32
|
msg << "\r\n" unless msg.end_with?("\r\n")
|
33
33
|
msg
|
34
34
|
end
|
35
|
+
alias_method :to_s, :to_irc
|
35
36
|
end
|
36
37
|
end
|
data/lib/ircp/prefix.rb
CHANGED
@@ -20,7 +20,7 @@ module Ircp
|
|
20
20
|
"<#{variables.join ' '}>"
|
21
21
|
end
|
22
22
|
|
23
|
-
def
|
23
|
+
def to_irc
|
24
24
|
if @raw.nil? || @raw.empty?
|
25
25
|
if @servername
|
26
26
|
":#{servername}"
|
@@ -35,5 +35,6 @@ module Ircp
|
|
35
35
|
@raw.to_s
|
36
36
|
end
|
37
37
|
end
|
38
|
+
alias_method :to_s, :to_irc
|
38
39
|
end
|
39
40
|
end
|
data/lib/ircp/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ircp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: treetop
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: rake
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: rspec
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,7 +53,12 @@ dependencies:
|
|
43
53
|
version: '0'
|
44
54
|
type: :development
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
47
62
|
description: IRC minimal parser
|
48
63
|
email:
|
49
64
|
- mail@mashiro.org
|
@@ -82,17 +97,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
82
97
|
- - ! '>='
|
83
98
|
- !ruby/object:Gem::Version
|
84
99
|
version: '0'
|
100
|
+
segments:
|
101
|
+
- 0
|
102
|
+
hash: -4246548536809339078
|
85
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
104
|
none: false
|
87
105
|
requirements:
|
88
106
|
- - ! '>='
|
89
107
|
- !ruby/object:Gem::Version
|
90
108
|
version: '0'
|
109
|
+
segments:
|
110
|
+
- 0
|
111
|
+
hash: -4246548536809339078
|
91
112
|
requirements: []
|
92
113
|
rubyforge_project:
|
93
|
-
rubygems_version: 1.8.
|
114
|
+
rubygems_version: 1.8.21
|
94
115
|
signing_key:
|
95
116
|
specification_version: 3
|
96
117
|
summary: IRC minimal parser for ruby
|
97
118
|
test_files: []
|
98
|
-
has_rdoc:
|