r12152 - in /branches/upstream/libproc-invokeeditor-perl/current: Changes LICENSE MANIFEST META.yml Makefile.PL example.pl example2.pl examples/ examples/example.pl examples/example2.pl lib/Proc/InvokeEditor.pm t/03_pod.t t/04_pod_coverage.t

gwolf at users.alioth.debian.org gwolf at users.alioth.debian.org
Mon Jan 7 17:15:53 UTC 2008


Author: gwolf
Date: Mon Jan  7 17:15:53 2008
New Revision: 12152

URL: http://svn.debian.org/wsvn/?sc=1&rev=12152
Log:
[svn-upgrade] Integrating new upstream version, libproc-invokeeditor-perl (1.02)

Added:
    branches/upstream/libproc-invokeeditor-perl/current/LICENSE
    branches/upstream/libproc-invokeeditor-perl/current/META.yml
    branches/upstream/libproc-invokeeditor-perl/current/examples/
    branches/upstream/libproc-invokeeditor-perl/current/examples/example.pl
    branches/upstream/libproc-invokeeditor-perl/current/examples/example2.pl
    branches/upstream/libproc-invokeeditor-perl/current/t/03_pod.t
    branches/upstream/libproc-invokeeditor-perl/current/t/04_pod_coverage.t
Removed:
    branches/upstream/libproc-invokeeditor-perl/current/example.pl
    branches/upstream/libproc-invokeeditor-perl/current/example2.pl
Modified:
    branches/upstream/libproc-invokeeditor-perl/current/Changes
    branches/upstream/libproc-invokeeditor-perl/current/MANIFEST
    branches/upstream/libproc-invokeeditor-perl/current/Makefile.PL
    branches/upstream/libproc-invokeeditor-perl/current/lib/Proc/InvokeEditor.pm

Modified: branches/upstream/libproc-invokeeditor-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-invokeeditor-perl/current/Changes?rev=12152&op=diff
==============================================================================
--- branches/upstream/libproc-invokeeditor-perl/current/Changes (original)
+++ branches/upstream/libproc-invokeeditor-perl/current/Changes Mon Jan  7 17:15:53 2008
@@ -8,3 +8,10 @@
   - new version, incorporate feedback so $EDITOR = 'xemacs -nw'
     works, added more error checking when looping through editors
     , added editors_env and editors_prepend.
+
+1.01 13 Mar 2007
+  - Increase CPANTS score.
+
+1.02 16 Dec 2007
+  - Patches from Tim Booth tbooth at ceh.ac.uk to provide optional filename
+	suffix option.

Added: branches/upstream/libproc-invokeeditor-perl/current/LICENSE
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-invokeeditor-perl/current/LICENSE?rev=12152&op=file
==============================================================================
--- branches/upstream/libproc-invokeeditor-perl/current/LICENSE (added)
+++ branches/upstream/libproc-invokeeditor-perl/current/LICENSE Mon Jan  7 17:15:53 2008
@@ -1,0 +1,1 @@
+This module is released under the same terms as perl itself.

Modified: branches/upstream/libproc-invokeeditor-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-invokeeditor-perl/current/MANIFEST?rev=12152&op=diff
==============================================================================
--- branches/upstream/libproc-invokeeditor-perl/current/MANIFEST (original)
+++ branches/upstream/libproc-invokeeditor-perl/current/MANIFEST Mon Jan  7 17:15:53 2008
@@ -2,8 +2,12 @@
 lib/Proc/InvokeEditor.pm
 Makefile.PL
 MANIFEST
+LICENSE
 README
 t/01_require.t
 t/02_editor.t
-example.pl
-example2.pl
+t/03_pod.t
+t/04_pod_coverage.t
+examples/example.pl
+examples/example2.pl
+META.yml                                 Module meta-data (added by MakeMaker)

Added: branches/upstream/libproc-invokeeditor-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-invokeeditor-perl/current/META.yml?rev=12152&op=file
==============================================================================
--- branches/upstream/libproc-invokeeditor-perl/current/META.yml (added)
+++ branches/upstream/libproc-invokeeditor-perl/current/META.yml Mon Jan  7 17:15:53 2008
@@ -1,0 +1,17 @@
+--- #YAML:1.0
+name:                Proc-InvokeEditor
+version:             1.02
+abstract:            Interface to external editor from perl
+license:             perl
+author:              
+    - Michael Stevens <mstevens at etla.org>
+generated_by:        ExtUtils::MakeMaker version 6.42
+distribution_type:   module
+requires:     
+    Carp::Assert:                  0.11
+    File::Spec:                    0.82
+    File::Temp:                    0.12
+    Test::More:                    0.08
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
+    version: 1.3

Modified: branches/upstream/libproc-invokeeditor-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-invokeeditor-perl/current/Makefile.PL?rev=12152&op=diff
==============================================================================
--- branches/upstream/libproc-invokeeditor-perl/current/Makefile.PL (original)
+++ branches/upstream/libproc-invokeeditor-perl/current/Makefile.PL Mon Jan  7 17:15:53 2008
@@ -17,4 +17,5 @@
     ($] >= 5.005 ?    ## Add these new keywords supported since 5.005
       (ABSTRACT => 'Interface to external editor from perl', 
        AUTHOR     => 'Michael Stevens <mstevens at etla.org>') : ()),
+    'LICENSE' => 'perl',
 );

Added: branches/upstream/libproc-invokeeditor-perl/current/examples/example.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-invokeeditor-perl/current/examples/example.pl?rev=12152&op=file
==============================================================================
--- branches/upstream/libproc-invokeeditor-perl/current/examples/example.pl (added)
+++ branches/upstream/libproc-invokeeditor-perl/current/examples/example.pl Mon Jan  7 17:15:53 2008
@@ -1,0 +1,13 @@
+#!/usr/local/bin/perl -w
+
+use strict;
+use Proc::InvokeEditor;
+
+my @result = Proc::InvokeEditor->edit("foo\nbar\nbaz\n");
+
+use Data::Dumper;
+print Dumper(@result);
+
+foreach my $line (@result) {
+  print "Line: $line\n";
+}

Added: branches/upstream/libproc-invokeeditor-perl/current/examples/example2.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-invokeeditor-perl/current/examples/example2.pl?rev=12152&op=file
==============================================================================
--- branches/upstream/libproc-invokeeditor-perl/current/examples/example2.pl (added)
+++ branches/upstream/libproc-invokeeditor-perl/current/examples/example2.pl Mon Jan  7 17:15:53 2008
@@ -1,0 +1,23 @@
+#!/usr/local/bin/perl -w
+
+use strict;
+use Proc::InvokeEditor;
+
+my $editor = new Proc::InvokeEditor(editors => [ '/usr/bin/emacs' ]);
+my $e = $editor->first_usable;
+print "Usable = " . $e->[0] . "\n";
+my @result = $editor->edit("foo\nbar\nbaz\n");
+
+foreach my $line (@result) {
+  print "Line: $line\n";
+}
+sleep 5;
+
+$editor->editors(['/usr/bin/vi']);
+$editor->editors_prepend(['/bin/ed']);
+$editor->editors_env(['TURNIP']);
+my $result = $editor->edit("something\nin\nvi\n");
+print $result;
+
+$e = $editor->first_usable;
+print "Usable = " . $e->[0] . "\n";

Modified: branches/upstream/libproc-invokeeditor-perl/current/lib/Proc/InvokeEditor.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-invokeeditor-perl/current/lib/Proc/InvokeEditor.pm?rev=12152&op=diff
==============================================================================
--- branches/upstream/libproc-invokeeditor-perl/current/lib/Proc/InvokeEditor.pm (original)
+++ branches/upstream/libproc-invokeeditor-perl/current/lib/Proc/InvokeEditor.pm Mon Jan  7 17:15:53 2008
@@ -27,10 +27,10 @@
 
 @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
 
- @EXPORT = qw(
+ at EXPORT = qw(
 	
 );
-$VERSION = '0.02';
+$VERSION = '1.02';
 
 @DEFAULT_EDITORS = ( $ENV{'VISUAL'}, $ENV{'EDITOR'}, '/usr/bin/vi',
                      '/bin/vi', '/bin/ed'
@@ -101,6 +101,7 @@
 sub edit {
   my $self = shift;
   my $arg = shift;
+  my $suff = shift;
   # if the argument supplied is a reference to an array of lines,
   # join it together based on the input record separator
   if (ref($arg) eq 'ARRAY') {
@@ -108,9 +109,9 @@
   }
   my $result;
   if (ref($self)) {
-    $result = _edit($arg, $self->{'editors'}, $self->{'cleanup'});
+    $result = _edit($arg, $self->{'editors'}, $self->{'cleanup'}, $suff);
   } else {
-    $result = _edit($arg, \@DEFAULT_EDITORS, 1);
+    $result = _edit($arg, \@DEFAULT_EDITORS, 1, $suff);
   }
   if (wantarray) {
     my @result = split m|$/|, $result;
@@ -164,6 +165,8 @@
   my $string = shift;
   my $er = shift;
   my $unlink = shift;
+  my $suff = shift;
+
   assert(ref($er) eq 'ARRAY');
   assert(defined $unlink);
   my @editors = @$er; 
@@ -171,8 +174,11 @@
 
   my $chosen_editor = first_usable(undef, $er); 
 
+  my @suff;
+  @suff = (SUFFIX => $suff) if $suff;
+
   # get a temp file, and write the text to it
-  my ($fh, $filename) = tempfile(UNLINK => $unlink);
+  my ($fh, $filename) = tempfile(UNLINK => $unlink, @suff);
   print $fh $string;
   close $fh or die "Couldn't close tempfile [$filename]; $!";
   # start the editor
@@ -313,6 +319,14 @@
   $editor->cleanup(0);
   my $result = $editor->edit($string);
 
+A optional second argument is available $suff - example usage:
+
+	my $reuslt = Proc::InvokeEditor->edit($string, '.xml');
+
+This specifies a filename suffix to be used when the editor is launched - this
+can be useful if the data in the file is of a particular type and you want to
+trigger an editor's syntax highlighting mode.
+
 =head1 TODO
 
 =over 4
@@ -328,6 +342,8 @@
 Michael Stevens E<lt>mstevens at etla.orgE<gt>. Also incorporating
 suggestions and feedback from Leon Brocard and Phil Pennock.
 
+Patches supplied by Tim Booth.
+
 =head1 SEE ALSO
 
 L<perl>.

Added: branches/upstream/libproc-invokeeditor-perl/current/t/03_pod.t
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-invokeeditor-perl/current/t/03_pod.t?rev=12152&op=file
==============================================================================
--- branches/upstream/libproc-invokeeditor-perl/current/t/03_pod.t (added)
+++ branches/upstream/libproc-invokeeditor-perl/current/t/03_pod.t Mon Jan  7 17:15:53 2008
@@ -1,0 +1,4 @@
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+all_pod_files_ok();

Added: branches/upstream/libproc-invokeeditor-perl/current/t/04_pod_coverage.t
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-invokeeditor-perl/current/t/04_pod_coverage.t?rev=12152&op=file
==============================================================================
--- branches/upstream/libproc-invokeeditor-perl/current/t/04_pod_coverage.t (added)
+++ branches/upstream/libproc-invokeeditor-perl/current/t/04_pod_coverage.t Mon Jan  7 17:15:53 2008
@@ -1,0 +1,4 @@
+use Test::More;
+eval "use Test::Pod::Coverage 1.00";
+plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
+all_pod_coverage_ok();




More information about the Pkg-perl-cvs-commits mailing list