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 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
- puts msg.prefix.nick # => 'Angel'
26
- puts msg.prefix.user # => 'wings'
27
- puts msg.prefix.host # => 'irc.org'
28
- puts msg.command # => 'PRIVMSG'
29
- puts msg.params[0] # => 'Wiz'
30
- puts msg.params[1] # => 'Are you receiving this message ?'
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 to_s
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 to_s
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
@@ -1,3 +1,3 @@
1
1
  module Ircp
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
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.0
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-03-02 00:00:00.000000000Z
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: &22104100 !ruby/object:Gem::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: *22104100
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: &22103640 !ruby/object:Gem::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: *22103640
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: &22063060 !ruby/object:Gem::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: *22063060
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.10
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: