Skip to content
Snippets Groups Projects
Commit 46abc782 authored by Defman21's avatar Defman21 Committed by Defman21
Browse files

Symbolize keys for @tags

parent b002f222
No related branches found
No related tags found
No related merge requests found
Gem::Specification.new do |s|
s.name = 'cinch'
s.version = '2.3.2'
s.version = '2.3.1'
s.summary = 'An IRC Bot Building Framework'
s.description = 'A simple, friendly DSL for creating IRC bots'
s.authors = ['Dominik Honnef']
......
......@@ -274,6 +274,10 @@ module Cinch
def parse_tags(raw_tags)
return {} if raw_tags.nil?
def to_symbol(string)
return string.gsub(/-/, "_").downcase.to_sym
end
tags = {}
raw_tags.split(";").each do |tag|
key, value = tag.split("=")
......@@ -282,10 +286,10 @@ module Cinch
value = {}
_value.split(",").each do |item|
_key, _value = item.split "/"
value[_key] = _value
value[to_symbol(_key)] = _value
end
end
tags[key] = value
tags[to_symbol(key)] = value
end
return tags
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment