ircp 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -20,7 +20,14 @@ Or install it yourself as:
20
20
 
21
21
  ```ruby
22
22
  require 'ircp'
23
- msg = Ircp.parse 'PRIVMSG ircp :hello ircp!'
23
+ msg = Ircp.parse ':Angel!wings@irc.org PRIVMSG Wiz :Are you receiving this message ?'
24
+
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 ?'
24
31
  ```
25
32
 
26
33
  ## Contributing
data/lib/ircp/message.rb CHANGED
@@ -7,7 +7,7 @@ module Ircp
7
7
  def initialize(*args)
8
8
  options = args.last.is_a?(Hash) ? args.pop : {}
9
9
  @raw = options[:raw]
10
- @prefix = Prefix.new(options[:prefix] || {})
10
+ @prefix = options[:prefix] ? Prefix.new(options[:prefix]) : nil
11
11
  @command = options[:command]
12
12
  @params = args
13
13
  end
data/lib/ircp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ircp
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/ircp.rb CHANGED
@@ -3,8 +3,8 @@ require 'ircp/parser'
3
3
  require 'ircp/message'
4
4
 
5
5
  module Ircp
6
- class ParseError < StandardError
7
- end
6
+ class IrcpError < RuntimeError; end
7
+ class ParseError < IrcpError; end
8
8
 
9
9
  def self.message_parser
10
10
  @message_parser ||= Ircp::Parser::MessageParser.new
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: 0.0.3
4
+ version: 0.0.4
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-02-15 00:00:00.000000000Z
12
+ date: 2012-02-26 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: treetop
16
- requirement: &15966740 !ruby/object:Gem::Requirement
16
+ requirement: &16109360 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *15966740
24
+ version_requirements: *16109360
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &15966320 !ruby/object:Gem::Requirement
27
+ requirement: &16108940 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *15966320
35
+ version_requirements: *16108940
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &15965900 !ruby/object:Gem::Requirement
38
+ requirement: &16108520 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *15965900
46
+ version_requirements: *16108520
47
47
  description: irc parser
48
48
  email:
49
49
  - mail@mashiro.org