Skip to content

Commit

Permalink
add reset command
Browse files Browse the repository at this point in the history
  • Loading branch information
melborne committed Dec 3, 2010
1 parent a5d00d5 commit d48d71d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/irc.rb
Expand Up @@ -7,7 +7,7 @@ class Irc
COLORS = (ATTRS*" ")[/red.*?white/].split(" ")

def initialize(str='Ruby is not Gem!')
@str = str
@str = @str_defo = str
end

def run
Expand All @@ -22,6 +22,9 @@ def run
when set_string?
@str = line.sub($&, '')
puts @str
when reset?
@str = @str_defo
puts @str
when help?
print help_manual
when rainbow?
Expand Down Expand Up @@ -50,6 +53,10 @@ def set_string?
/^\s*=\s*/
end

def reset?
/^reset/i
end

def help?
/^(help|h|colors|attrs)$/i
end
Expand Down

0 comments on commit d48d71d

Please sign in to comment.