Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow (and require) you to specify a commit when comparing code snippets
  • Loading branch information
MasterDuke17 committed Aug 14, 2016
1 parent 700cb30 commit 70e6fd3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Benchable.p6
Expand Up @@ -66,7 +66,7 @@ multi method benchmark-code($full-commit, @code) {
}


multi method irc-to-me($message where .text ~~ /^ \s* $<config>=\S+ \s+ $<code>=.+ /) {
multi method irc-to-me($message where .text ~~ /^ \s* $<config>=([:i compare \s]? \S+) \s+ $<code>=.+ /) {
my ($value, %additional-files) = self.process($message, ~$<config>, ~$<code>);
return ResponseStr.new(:$value, :$message, :%additional-files);
}
Expand Down Expand Up @@ -96,8 +96,8 @@ method process($message, $config, $code is copy) {
return "Too many commits ($num-commits) in range, you're only allowed " ~ LIMIT if $num-commits > LIMIT;
} elsif $config ~~ /:i releases / {
@commits = <2015.10 2015.11 2015.12 2016.02 2016.03 2016.04 2016.05 2016.06 2016.07 HEAD>;
} elsif $config ~~ /:i compare / {
@commits = 'HEAD';
} elsif $config ~~ /:i compare \s $<commit>=\S+ / {
@commits = $<commit>;
} else {
@commits = $config;
}
Expand Down

0 comments on commit 70e6fd3

Please sign in to comment.