~ubuntu-branches/debian/sid/padre/sid

« back to all changes in this revision

Viewing changes to lib/Padre/HelpProvider/Perl.pm

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov, gregor herrmann, Damyan Ivanov
  • Date: 2009-11-18 17:48:27 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20091118174827-srz62scl23gdl88v
Tags: 0.50.ds1-1
[ gregor herrmann ]
* debian/control: change dependency on "libclass-xsaccessor-array-perl
  (>= 1.02)" to "libclass-xsaccessor-perl (>= 1.05-2) |
  libclass-xsaccessor-array-perl (>= 1.02)".

[ Damyan Ivanov ]
* New upstream release
  + copyright: add a new translator
    - describe share/doc/perlopref copyright and licensing
  + update patches:
    - refresh disable-tcp-server.patch
    - drop fix-man-whatis.patch and fix-pod.patch (merged upstream)
    - drop fix-helpprovider-with-no-perlopref.patch: no longer necessary
* repack.sh: in 0.49 padre.exe moved from script/ to bin/
  + perlopref is now properly licensed
* add perl (>= 5.10.1) as a preferred alternative to versioned (build)
  dependencies on libtest-simple-perl and libpod-simple-perl
* update debian/not-real-manual.list for 0.50 (one file added, two files
  changed in size)
* rules: remove cruft from padre.deb
  + license etc from perlopref directory (already present in d/copyright)
  + remove .po files from the .deb (there are .mo files installed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
use Padre::HelpProvider    ();
11
11
use Padre::DocBrowser::POD ();
12
12
use Padre::Pod2HTML        ();
 
13
use Padre::Util            ();
13
14
 
14
 
our $VERSION = '0.48';
 
15
our $VERSION = '0.50';
15
16
our @ISA     = 'Padre::HelpProvider';
16
17
 
17
18
#
143
144
sub _parse_perlopref {
144
145
        my $self = shift;
145
146
 
 
147
        my %index = ();
 
148
 
146
149
        # Open perlopref.pod for reading
147
 
        my $perlopref = Cwd::realpath( File::Spec->join( Padre::Util::sharedir('doc'), 'perlopref.pod' ) );
 
150
        my $perlopref = File::Spec->join( Padre::Util::sharedir('doc'), 'perlopref', 'perlopref.pod' );
148
151
        my $fh;
149
 
        open $fh, $perlopref;
150
 
 
151
 
        my %index = ();
152
 
 
153
 
        # Add PRECEDENCE to index
154
 
        until ( <$fh> =~ /=head1 PRECEDENCE/ ) { }
155
 
 
156
 
        my $line;
157
 
        while ( $line = <$fh> ) {
158
 
                last if ( $line =~ /=head1 OPERATORS/ );
159
 
                $index{PRECEDENCE} .= $line;
160
 
        }
161
 
 
162
 
        # Add OPERATORS to index
163
 
        my $op;
164
 
        while ( $line = <$fh> ) {
165
 
                if ( $line =~ /=head2\s+(.+)$/ ) {
166
 
                        $op = $1;
167
 
                        $index{$op} = $line;
168
 
                } elsif ($op) {
169
 
                        $index{$op} .= $line;
170
 
                }
171
 
        }
172
 
 
173
 
        # and we're done
174
 
        close $fh;
 
152
        if ( open $fh, $perlopref ) {
 
153
 
 
154
                # Add PRECEDENCE to index
 
155
                until ( <$fh> =~ /=head1 PRECEDENCE/ ) { }
 
156
 
 
157
                my $line;
 
158
                while ( $line = <$fh> ) {
 
159
                        last if ( $line =~ /=head1 OPERATORS/ );
 
160
                        $index{PRECEDENCE} .= $line;
 
161
                }
 
162
 
 
163
                # Add OPERATORS to index
 
164
                my $op;
 
165
                while ( $line = <$fh> ) {
 
166
                        if ( $line =~ /=head2\s+(.+)$/ ) {
 
167
                                $op = $1;
 
168
                                $index{$op} = $line;
 
169
                        } elsif ($op) {
 
170
                                $index{$op} .= $line;
 
171
                        }
 
172
                }
 
173
 
 
174
                # and we're done
 
175
                close $fh;
 
176
        } else {
 
177
                Padre::Util::debug("Cannot open perlopref.pod\n");
 
178
        }
175
179
 
176
180
        return \%index;
177
181
}