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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca17530277754676389fe66fb2d9cf7a3a4542a0
4
- data.tar.gz: e99d76bc5489e5018252c94feed5c1a9f7321600
3
+ metadata.gz: 01f9fd36ac377195234a6fd90492586ed5af8c8c
4
+ data.tar.gz: 52ee9336c4e4f1811186aae63bcf0d9add72c063
5
5
  SHA512:
6
- metadata.gz: f596aef553fc6571fd830fe89f5763d4e95c02c850c8bd69a8ca6142bb03318efdad876948e6ade7544d16df9600077edeb279f0d0ad8c4f76fbb6cdfa5118db
7
- data.tar.gz: a3c21a80748ec07c9be0ac257b12ced140e03736e2d56683adde323d26f633e88030950ca879c09623208b1b5f62cf1ac0265cbdf92c35035a2be8955881cbfb
6
+ metadata.gz: 4d5804b02d687a2c524c7319b6068cc05cf86a595ee45de4a33b76aef91302588ce317bd59f52f672b167dce5a0a823fbefe2a4eb413c76cd8c7caa7d4f1bd67
7
+ data.tar.gz: d53b421a5c92b99f8425ca9ce121ccfc4666f2bdb59ca7b31c8503200af537c4085d42ed9aceb5e0316f4c4ade678d011d12fee6f9a209d57ac71e3964046c5a
@@ -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 = /^(\S+?)(?:=(\S+))?$/
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 = $~[1..2]
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
@@ -16,7 +16,7 @@
16
16
  module IRCParser
17
17
 
18
18
  # Public: The version of IRCParser in use.
19
- VERSION = '0.3.0'
19
+ VERSION = '0.3.1'
20
20
  end
21
21
 
22
22
  require_relative 'ircparser/error'
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.0
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-05-03 00:00:00.000000000 Z
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.6
79
+ rubygems_version: 2.4.8
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: An IRCv3.2 message parser.