Skip to content

Commit

Permalink
more reduction of ambiguous arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
kabaka committed Dec 14, 2015
1 parent 94491a2 commit ccaef9a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/time.rb
Expand Up @@ -143,7 +143,7 @@ def to_fuzzy_duration_s
def self.parse_duration str
t = Time.now

str.scan /(-?[0-9]+)(\w{1})/ do |s|
str.scan(/(-?[0-9]+)(\w{1})/) do
val = $1.to_i
case $2.downcase
when 's'
Expand All @@ -159,7 +159,7 @@ def self.parse_duration str
when 'y'
a = t.to_a
a[5] += val
t = Time.mktime *a
t = Time.mktime(*a)
end
end

Expand Down
4 changes: 2 additions & 2 deletions scripts/deviantart.rb
Expand Up @@ -29,13 +29,13 @@

register 'Fetch information from deviantART.'

url /\/\/([^\.]+)\.deviantart\.com\/art\/.+|fav\.me/ do
url(/\/\/([^\.]+)\.deviantart\.com\/art\/.+|fav\.me/) do
$log.info('deviantart.url') { @uri.inspect }

title_handler @uri
end

url /\/[\w-]+_by_[\w-]+-d[0-9A-Za-z]{5,8}+.\w{3}$/ do
url(/\/[\w-]+_by_[\w-]+-d[0-9A-Za-z]{5,8}+.\w{3}$/) do
$log.info('deviantart.url') { @uri.inspect }

match = @uri.to_s.match(/_by_.+-(?<id>d[0-9A-Za-z]{5,8})\.\w{3}/)
Expand Down
5 changes: 3 additions & 2 deletions scripts/speak.rb
Expand Up @@ -29,12 +29,13 @@
command 'say', 'Speak the given text.' do
level! 8 and argc_channel! 1

send_privmsg *@params
send_privmsg(*@params)
end

command 'act', 'Act the given text (CTCP ACTION).' do
level! 8 and argc_channel! 1

send_action *@params
send_action(*@params)
end

# vim: set tabstop=2 expandtab:

0 comments on commit ccaef9a

Please sign in to comment.