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

Commit 4053bd5

Browse files
committed
Merge pull request #499 from gdrooid/capitalize
Renamed Capitalize as Uppercase (issue #489)
2 parents 154f75f + f2b4c95 commit 4053bd5

File tree

6 files changed

+48
-43
lines changed

6 files changed

+48
-43
lines changed

lib/DDG/Goodie/Capitalize.pm

Lines changed: 0 additions & 23 deletions
This file was deleted.

lib/DDG/Goodie/TitleCase.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package DDG::Goodie::TitleCase;
22

33
use DDG::Goodie;
44

5-
triggers startend => 'titlecase', 'ucfirst', 'title case';
5+
triggers startend => 'titlecase', 'ucfirst', 'title case', 'capitalize';
66

77
primary_example_queries 'titlecase test';
88
description 'return the query in title case';

lib/DDG/Goodie/Uppercase.pm

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package DDG::Goodie::Uppercase;
2+
3+
use DDG::Goodie;
4+
5+
triggers startend => 'uppercase', 'upper case', 'allcaps', 'all caps';
6+
7+
zci is_cached => 1;
8+
zci answer_type => "uppercase";
9+
10+
primary_example_queries 'uppercase this';
11+
secondary_example_queries 'upper case that';
12+
13+
name 'Uppercase';
14+
description 'Make a string uppercase.';
15+
code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/Uppercase.pm';
16+
category 'conversions';
17+
topics 'programming';
18+
19+
attribution twitter => 'crazedpsyc',
20+
cpan => 'CRZEDPSYC' ;
21+
22+
handle remainder => sub { uc ($_) };
23+
24+
1;

t/Capitalize.t

Lines changed: 0 additions & 19 deletions
This file was deleted.

t/TitleCase.t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ ddg_goodie_test(
1616
'titlecase this is a walk in the park' => test_zci('This Is a Walk in the Park'),
1717
'titlecase a good day to die hard' => test_zci('A Good Day to Die Hard'),
1818
'titlecase here i am testing-hyphenated-words' => test_zci('Here I Am Testing-Hyphenated-Words'),
19+
'capitalize this should be capitalized' => test_zci('This Should Be Capitalized'),
1920
'titlecase test' => test_zci('Test'),
2021
);
2122

t/Uppercase.t

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env perl
2+
3+
use strict;
4+
use warnings;
5+
use Test::More;
6+
use DDG::Test::Goodie;
7+
8+
zci answer_type => 'uppercase';
9+
zci is_cached => 1;
10+
11+
ddg_goodie_test(
12+
[qw(
13+
DDG::Goodie::Uppercase
14+
)],
15+
'upper case this' => test_zci('THIS'),
16+
'uppercase that' => test_zci('THAT'),
17+
'allcaps this string' => test_zci('THIS STRING'),
18+
'that string all caps' => test_zci('THAT STRING'),
19+
'is this uppercase, sir?' => undef,
20+
);
21+
22+
done_testing;

0 commit comments

Comments
 (0)