ircparser 0.3.0 → 0.3.1
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 +4 -4
- data/lib/ircparser/message.rb +3 -3
- data/lib/ircparser.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01f9fd36ac377195234a6fd90492586ed5af8c8c
|
4
|
+
data.tar.gz: 52ee9336c4e4f1811186aae63bcf0d9add72c063
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d5804b02d687a2c524c7319b6068cc05cf86a595ee45de4a33b76aef91302588ce317bd59f52f672b167dce5a0a823fbefe2a4eb413c76cd8c7caa7d4f1bd67
|
7
|
+
data.tar.gz: d53b421a5c92b99f8425ca9ce121ccfc4666f2bdb59ca7b31c8503200af537c4085d42ed9aceb5e0316f4c4ade678d011d12fee6f9a209d57ac71e3964046c5a
|
data/lib/ircparser/message.rb
CHANGED
@@ -19,7 +19,7 @@ module IRCParser
|
|
19
19
|
class Message
|
20
20
|
|
21
21
|
# Internal: A regular expression which matches a tag.
|
22
|
-
MATCH_TAG = /^(
|
22
|
+
MATCH_TAG = /^(?<name>[^\s=]+?)(?:=(?<value>[^\s;]+))?$/
|
23
23
|
|
24
24
|
# Internal: The characters which need to be escaped in tag values.
|
25
25
|
TAG_ESCAPES = {
|
@@ -52,7 +52,7 @@ module IRCParser
|
|
52
52
|
|
53
53
|
# Public: Parses an IRC message from network form.
|
54
54
|
#
|
55
|
-
# line - The line to attempt to parse
|
55
|
+
# line - The line to attempt to parse.
|
56
56
|
def self.parse line
|
57
57
|
|
58
58
|
# Ruby really needs some kind of basic type checking.
|
@@ -143,7 +143,7 @@ module IRCParser
|
|
143
143
|
tags = Hash.new
|
144
144
|
token[1..-1].split(';').each do |tag|
|
145
145
|
if tag =~ MATCH_TAG
|
146
|
-
name, value = $~[
|
146
|
+
name, value = $~['name'], $~['value']
|
147
147
|
TAG_ESCAPES.each do |unescaped, escaped|
|
148
148
|
value.gsub! escaped, unescaped
|
149
149
|
end unless value.nil?
|
data/lib/ircparser.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ircparser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter "SaberUK" Powell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|
78
78
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.4.
|
79
|
+
rubygems_version: 2.4.8
|
80
80
|
signing_key:
|
81
81
|
specification_version: 4
|
82
82
|
summary: An IRCv3.2 message parser.
|