Permalink
Browse files

Deprecated goodie test

  • Loading branch information...
1 parent a846344 commit a8cd7e48043dc0dee73fc808c4d00fcdf6535399 @Getty Getty committed Jun 7, 2012
Showing with 8 additions and 91 deletions.
  1. +2 −87 lib/App/DuckPAN/Cmd/Goodie.pm
  2. +6 −4 lib/App/DuckPAN/Help.pm
@@ -17,93 +17,8 @@ sub run {
exit 1;
}
if ($args[0] eq 'test') {
- print "\n[WARNING] Please use duckpan query to cover all plugins!\n";
- shift @args;
- if (defined $args[0] and $args[0] eq 'all') {
- my $finder = Module::Pluggable::Object->new(
- search_path => ['DDG::Goodie'],
- );
- @args = $finder->plugins;
- unless (@args) {
- print "\n[ERROR] No DDG::Goodie::* packages found\n";
- print "\nHint: The 'all' parameter does not automatically include your lib path.\n\n";
- exit 1;
- }
- } elsif (!@args) {
- my $finder = Module::Pluggable::Object->new(
- search_path => ['lib/DDG/Goodie'],
- );
- @args = $finder->plugins;
- @args = map {
- $_ =~ s!/!::!g;
- my @parts = split('::',$_);
- shift @parts;
- join('::',@parts);
- } @args;
- require lib;
- lib->import('lib');
- }
- unless (@args) {
- print "\n[ERROR] No DDG::Goodie::* packages found\n";
- print "\nHint: You must be in the root of your repository so that this works.\n\n";
- exit 1;
- }
- print "\nUsing the following DDG::Goodie plugins:\n\n";
- for (@args) {
- load_class($_);
- print " - ".$_;
- print " (".$_->triggers_block_type.")\n";
- }
- my %blocks_plugins;
- for (@args) {
- unless ($blocks_plugins{$_->triggers_block_type}) {
- $blocks_plugins{$_->triggers_block_type} = [];
- }
- push @{$blocks_plugins{$_->triggers_block_type}}, $_;
- }
- my @blocks;
- for (keys %blocks_plugins) {
- my $block_class = 'DDG::Block::'.$_;
- load_class($block_class);
- push @blocks, $block_class->new( plugins => $blocks_plugins{$_} );
- }
- load_class('DDG::Request');
- print "\n(Empty query for ending test)\n";
- while (my $query = $self->app->term->get_reply( prompt => 'Query: ' ) ) {
- my $request = DDG::Request->new( query_raw => $query );
- my $hit;
- for (@blocks) {
- my ($result) = $_->request($request);
- if ($result) {
- $hit = 1;
- print "\n";
- p($result);
- print "\n";
- last;
- }
- }
- unless ($hit) {
- print "\nSorry, no hit on your goodies\n\n";
- }
- }
- print "\n\n\\_o< Thanks for testing!\n\n";
- exit 0;
- } elsif ($args[0] eq 'new') {
- unless ($self->app->get_config) {
- print "\n[ERROR] Please run 'duckpan setup' first\n\n";
- exit 1;
- }
- shift @args;
- if (scalar @args != 1) {
- print "\n[ERROR] You need to give the name of your Goodie (no spaces allowed, please uppercase first letter)\n\n";
- exit 1;
- }
- my $name = shift @args;
- $name = ucfirst($name);
- my $package = 'DDG::Goodie::'.$name;
- my $dir = 'p5-ddg-goodie-'.lc($name);
- print "\nGenerating ".$package." in ".$dir." ...\n\n";
- exit 0;
+ print "\n[DEPRECATED] Please use \"duckpan query\"!\n";
+ exit 1;
}
}
print $self->app->help->goodie;
View
@@ -29,14 +29,16 @@ duckpan check
Check if you fulfill all requirements for the development
environment (will automatically gets fired on setup)
+duckpan installdeps
+-------------
+ Install all requirements of the specific DuckDuckHack project (if
+ possible), like zeroclickinfo-spice, zeroclickinfo-goodie, duckduckgo
+ or community-platform
+
duckpan query
-------------
Test your plugins if they match a specific query (interactive)
-duckpan goodie
---------------
- More help there about DDG::Goodie
-
duckpan release
---------------
Release the project of the current directory to DuckPAN [TODO]

0 comments on commit a8cd7e4

Please sign in to comment.