Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Update regex, and trim whitespace from input
Browse files Browse the repository at this point in the history
  • Loading branch information
HunterMeyer committed Jun 2, 2016
1 parent 8dcc1ed commit 94871fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/DDG/Spice/JrDevJobs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package DDG::Spice::JrDevJobs;

use strict;
use DDG::Spice;
use Text::Trim;

triggers startend => qw(jrdevjobs);

Expand All @@ -11,9 +12,9 @@ spice is_cached => 1;
spice wrap_jsonp_callback => 1;

handle remainder => sub {
s/(jobs?|developer)//i;
s/\b(jobs?|developer)\b//i;

return $_ if $_;
return trim($_) if $_;
return;
};

Expand Down
2 changes: 1 addition & 1 deletion t/JrDevJobs.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ddg_spice_test(
is_cached => 1
),
'web developer jrdevjobs' => test_spice(
'/js/spice/jr_dev_jobs/web%20',
'/js/spice/jr_dev_jobs/web',
call_type => 'include',
caller => 'DDG::Spice::JrDevJobs',
is_cached => 1
Expand Down

0 comments on commit 94871fe

Please sign in to comment.