Commits

Toby Inkster committed fe05551

docs; pass tests

Comments (0)

Files changed (5)

 
 =item C<< question(text => $text, %arguments) >>
 
-Ask the user to answer a affirmative/negative question (i.e. OK/cancel,
+Ask the user to answer an affirmative/negative question (i.e. OK/cancel,
 yes/no) defaulting to affirmative. Returns boolean.
 
 The C<text> argument is the text of the question; the C<ok_label> argument
 
 See L<Ask::API> for documentation of API internals.
 
-Bundled API implementations are L<Ask::STDIO>, L<Ask::Zenity> and L<Ask::Tk>.
+Bundled Ask API backends:
+
+=over
+
+=item *
+
+L<Ask::Callback> - implementation for testing; redirects input and output to callback functions.
+
+=item *
+
+L<Ask::Fallback> - returns default answers; for scripts running unattended.
+
+=item *
+
+L<Ask::Gtk> - GUI using L<Gtk2>.
+
+=item *
+
+L<Ask::STDIO> - based on STDIN/STDOUT/STDERR
+
+=item *
+
+L<Ask::Tk> - GUI using L<Tk>.
+
+=item *
+
+L<Ask::Wx> - GUI using L<Wx>.
+
+=item *
+
+L<Ask::Zenity> - GUI using the C<< /usr/bin/zenity >> binary (part of GNOME)
+
+=back
 
 Similar modules: L<IO::Prompt>, L<IO::Prompt::Tiny> and many others.
 

lib/Ask/Callback.pm

 
 	sub is_usable {
 		my ($self) = @_;
-		    ref $self->output_callback eq 'CODE'
-		and ref $self->input_callback  eq 'CODE';
+		ref $self->output_callback eq 'CODE' and
+		ref $self->input_callback  eq 'CODE';
 	}
 
 	sub quality {

lib/Ask/Fallback.pm

 C<question>, C<file_selection>, etc, and croaks if no defaults are
 available.
 
+This backend is used if the C<PERL_MM_USE_DEFAULT> or C<AUTOMATED_TESTING>
+environemnt variables are set to true, or as a last resort if no other
+Ask backend can be used.
+
 =head1 BUGS
 
 Please report any bugs to
 use warnings;
 use Test::More;
 
-BEGIN { delete $ENV{PERL_ASK_BACKEND} };
+BEGIN { $ENV{PERL_ASK_BACKEND} = 'Ask::Callback' };
 
 use Ask;
 
 }
 
 my $ask = Ask->detect(
-	class           => 'Ask::Callback',
 	input_callback  => sub { shift @input },
 	output_callback => sub { push @output, $_[0] },
 );
 use warnings;
 use Test::More;
 
-BEGIN { delete $ENV{PERL_ASK_BACKEND} };
+BEGIN { $ENV{PERL_ASK_BACKEND} = 'Ask::Callback' };
 
 use Ask;
 
 }
 
 my $ask = Ask->detect(
-	class           => 'Ask::Callback',
 	traits          => ['AskX::Method::Password'],
 	input_callback  => sub { shift @input },
 	output_callback => sub { push @output, $_[0] },
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.