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

Bible: adding verse of the day #2936

Merged
merged 1 commit into from Aug 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/DDG/Spice/Bible.pm
Expand Up @@ -13,6 +13,9 @@ handle query_lc => sub {
if ($_ =~ /^bible\s+([a-z]+\s*?[0-9]+:[0-9]+)$/i || $_ =~ /^((?:genesis|exodus|leviticus|numbers|deuteronomy|joshua|judges|ruth|1 samuel|2 samuel|1 kings|2 kings|1 chronicles|2 chronicles|ezra|nehemiah|esther|job|psalm|proverbs|ecclesiastes|song of solomon|isaiah|jeremiah|lamentations|ezekiel|daniel|hosea|joel|amos|obadiah|jonah|micah|nahum|habakkuk|zephaniah|haggai|zechariah|malachi|matthew|mark|luke|john|acts|romans|1 corinthians|2 corinthians|galatians|ephesians|philippians|colossians|1 thessalonians|2 thessalonians|1 timothy|2 timothy|titus|philemon|hebrews|james|1 peter|2 peter|1 john|2 john|3 john|jude|revelation)\s+[0-9]+:[0-9]+)$/) {
return $1 if $1;
}
if ($_ =~ /^bible\s+(verse of the day|verse of today)$/i || $_ =~ /^verse\s+(of the day|of today)$/i) {
return 'votd';
}
return;
};

Expand Down
6 changes: 5 additions & 1 deletion share/spice/bible/triggers.txt
Expand Up @@ -64,4 +64,8 @@ ruth
song of solomon
titus
zechariah
zephaniah
zephaniah
bible verse of the day
verse of the day
bible verse of today
verse of today
16 changes: 16 additions & 0 deletions t/Bible.t
Expand Up @@ -20,6 +20,22 @@ ddg_spice_test(
'/js/spice/bible/genesis%2026%3A4',
caller => 'DDG::Spice::Bible',
),
'bible verse of the day' => test_spice(
'/js/spice/bible/votd',
caller => 'DDG::Spice::Bible',
),
'verse of the day' => test_spice(
'/js/spice/bible/votd',
caller => 'DDG::Spice::Bible',
),
'bible verse of today' => test_spice(
'/js/spice/bible/votd',
caller => 'DDG::Spice::Bible',
),
'verse of today' => test_spice(
'/js/spice/bible/votd',
caller => 'DDG::Spice::Bible',
),
);

done_testing;
Expand Down