~ubuntu-branches/ubuntu/precise/padre/precise

« back to all changes in this revision

Viewing changes to lib/Padre/Task/Browser.pm

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov
  • Date: 2010-12-11 20:56:34 UTC
  • mfrom: (1.3.1 upstream) (13.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20101211205634-sitpxguuf9cct47q
Tags: 0.76.ds1-1
* New upstream release

* bump liborlite (build-)dependency to 1.46
* bump libparse-errorstring-perl-perl (build-)dependency to 0.14
* bump libwx-perl-processstream-perl (build-)dependency to 0.29
* update the list of incomplete manuals

* Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package Padre::Task::Browser;
 
2
 
 
3
use 5.008;
 
4
use strict;
 
5
use warnings;
 
6
use threads;
 
7
use Padre::Task ();
 
8
 
 
9
our $VERSION = '0.76';
 
10
our @ISA     = 'Padre::Task';
 
11
 
 
12
sub prepare {
 
13
        my $self = shift;
 
14
        $self->{method} ||= 'error';
 
15
        return 0 if $self->{method} eq 'error';
 
16
        return 1;
 
17
}
 
18
 
 
19
sub run {
 
20
        my $self   = shift;
 
21
        my $method = $self->{method};
 
22
 
 
23
        require Padre::Browser;
 
24
        my $browser = Padre::Browser->new;
 
25
        unless ( $browser->can($method) ) {
 
26
                die "Browser does not support '$method'";
 
27
        }
 
28
 
 
29
        $self->{result} = $browser->$method(
 
30
                $self->{document},
 
31
                $self->{args}
 
32
        );
 
33
 
 
34
        return 1;
 
35
}
 
36
 
 
37
1;
 
38
 
 
39
# Copyright 2008-2010 The Padre development team as listed in Padre.pm.
 
40
# LICENSE
 
41
# This program is free software; you can redistribute it and/or
 
42
# modify it under the same terms as Perl 5 itself.