[Bps-public-commit] rt-extension-tags branch, master, updated. 0.03-3-g6189771

Jim Brandt jbrandt at bestpractical.com
Mon Feb 20 10:52:38 EST 2017


The branch, master has been updated
       via  6189771c2db47fcdb54b42d3115e2960c9ca0248 (commit)
       via  703bb0f2672bdaa63c55caee39cb30cd540da9a7 (commit)
       via  c63a21364c6c7b9ba831935adf7eca0cc4eabc07 (commit)
      from  4f359c4ed371f87d1376e0fed3d44cb6bc49e55b (commit)

Summary of changes:
 Changes                             |  4 ++
 META.yml                            |  4 +-
 html/Elements/EditCustomFieldTags   | 10 +++--
 inc/Module/Install/RTx.pm           |  2 +-
 inc/Module/Install/ReadmeFromPod.pm | 76 +++++++++++++++++++++++++++++--------
 lib/RT/Extension/Tags.pm            |  2 +-
 6 files changed, 75 insertions(+), 23 deletions(-)

- Log -----------------------------------------------------------------
commit c63a21364c6c7b9ba831935adf7eca0cc4eabc07
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon Feb 20 10:38:39 2017 -0500

    Determine input name from Name or NamePrefix
    
    Determine the tag form field input name from the passed in Name
    or NamePrefix using the same evaluation as other custom field
    inputs, consistent with 4b21442ed.

diff --git a/html/Elements/EditCustomFieldTags b/html/Elements/EditCustomFieldTags
index e26993f..d679175 100644
--- a/html/Elements/EditCustomFieldTags
+++ b/html/Elements/EditCustomFieldTags
@@ -1,17 +1,18 @@
-<textarea name="<% $name %>-Values" id="<% $name %>-Values" class="CF-<%$CustomField->id%>-Edit"><% $Default || '' %></textarea>
+<textarea name="<% $name %>" id="<% $name %>" class="CF-<%$CustomField->id%>-Edit"><% $Default || '' %></textarea>
 <script type="text/javascript">
-var id = <% "$name-Values" |n,j%>;
+var id = <% "$name" |n,j%>;
 id = id.replace(/:/g,'\\:');
 jQuery('#'+id).tagit({
   autocomplete: {
-    source: <%RT->Config->Get('WebPath') |n,j%>+"/Helpers/Autocomplete/CustomFieldValues?"+<% $Context |n,j %>+<% "$name-Values" |n,u,j%>,
+    source: <%RT->Config->Get('WebPath') |n,j%>+"/Helpers/Autocomplete/CustomFieldValues?"+<% $Context |n,j %>+<% "$name" |n,u,j%>,
   },
   tagLimit: <% $CustomField->MaxValues+0 || "null" |n %>,
   singleFieldDelimiter: "\n"
 });
 </script>
 <%INIT>
-my $name = $NamePrefix . $CustomField->Id;
+my $name = $Name || $NamePrefix . $CustomField->Id . '-Values';
+
 if ( $Default && !$Multiple ) {
     $Default =~ s/\s*\r*\n\s*/ /g;
 }
@@ -35,4 +36,5 @@ $Values      => undef
 $Multiple    => undef
 $Rows        => undef
 $Cols        => undef
+$Name        => undef
 </%ARGS>

commit 703bb0f2672bdaa63c55caee39cb30cd540da9a7
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon Feb 20 10:50:39 2017 -0500

    Module::Install updates

diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index cb4cfde..80538d3 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -8,7 +8,7 @@ no warnings 'once';
 
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.37';
+our $VERSION = '0.38';
 
 use FindBin;
 use File::Glob     ();
diff --git a/inc/Module/Install/ReadmeFromPod.pm b/inc/Module/Install/ReadmeFromPod.pm
index b5e03c3..3634ee0 100644
--- a/inc/Module/Install/ReadmeFromPod.pm
+++ b/inc/Module/Install/ReadmeFromPod.pm
@@ -7,12 +7,41 @@ use warnings;
 use base qw(Module::Install::Base);
 use vars qw($VERSION);
 
-$VERSION = '0.22';
+$VERSION = '0.26';
+
+{
+
+    # these aren't defined until after _require_admin is run, so
+    # define them so prototypes are available during compilation.
+    sub io;
+    sub capture(&;@);
+
+#line 28
+
+    my $done = 0;
+
+    sub _require_admin {
+
+	# do this once to avoid redefinition warnings from IO::All
+	return if $done;
+
+	require IO::All;
+	IO::All->import( '-binary' );
+
+	require Capture::Tiny;
+	Capture::Tiny->import ( 'capture' );
+
+	return;
+    }
+
+}
 
 sub readme_from {
   my $self = shift;
   return unless $self->is_admin;
 
+  _require_admin;
+
   # Input file
   my $in_file  = shift || $self->_all_from
     or die "Can't determine file to make readme_from";
@@ -50,6 +79,8 @@ sub readme_from {
     $out_file = $self->_readme_htm($in_file, $out_file, $options);
   } elsif ($format eq 'man') {
     $out_file = $self->_readme_man($in_file, $out_file, $options);
+  } elsif ($format eq 'md') {
+    $out_file = $self->_readme_md($in_file, $out_file, $options);
   } elsif ($format eq 'pdf') {
     $out_file = $self->_readme_pdf($in_file, $out_file, $options);
   }
@@ -67,10 +98,10 @@ sub _readme_txt {
   $out_file ||= 'README';
   require Pod::Text;
   my $parser = Pod::Text->new( @$options );
-  open my $out_fh, '>', $out_file or die "Could not write file $out_file:\n$!\n";
+  my $io = io->file($out_file)->open(">");
+  my $out_fh = $io->io_handle;
   $parser->output_fh( *$out_fh );
   $parser->parse_file( $in_file );
-  close $out_fh;
   return $out_file;
 }
 
@@ -79,11 +110,14 @@ sub _readme_htm {
   my ($self, $in_file, $out_file, $options) = @_;
   $out_file ||= 'README.htm';
   require Pod::Html;
-  Pod::Html::pod2html(
-    "--infile=$in_file",
-    "--outfile=$out_file",
-    @$options,
-  );
+  my ($o) = capture {
+    Pod::Html::pod2html(
+      "--infile=$in_file",
+      "--outfile=-",
+      @$options,
+    );
+  };
+  io->file($out_file)->print($o);
   # Remove temporary files if needed
   for my $file ('pod2htmd.tmp', 'pod2htmi.tmp') {
     if (-e $file) {
@@ -99,7 +133,10 @@ sub _readme_man {
   $out_file ||= 'README.1';
   require Pod::Man;
   my $parser = Pod::Man->new( @$options );
-  $parser->parse_from_file($in_file, $out_file);
+  my $io = io->file($out_file)->open(">");
+  my $out_fh = $io->io_handle;
+  $parser->output_fh( *$out_fh );
+  $parser->parse_file( $in_file );
   return $out_file;
 }
 
@@ -111,11 +148,20 @@ sub _readme_pdf {
     or die "Could not generate $out_file because pod2pdf could not be found\n";
   my $parser = App::pod2pdf->new( @$options );
   $parser->parse_from_file($in_file);
-  open my $out_fh, '>', $out_file or die "Could not write file $out_file:\n$!\n";
-  select $out_fh;
-  $parser->output;
-  select STDOUT;
-  close $out_fh;
+  my ($o) = capture { $parser->output };
+  io->file($out_file)->print($o);
+  return $out_file;
+}
+
+sub _readme_md {
+  my ($self, $in_file, $out_file, $options) = @_;
+  $out_file ||= 'README.md';
+  require Pod::Markdown;
+  my $parser = Pod::Markdown->new( @$options );
+  my $io = io->file($out_file)->open(">");
+  my $out_fh = $io->io_handle;
+  $parser->output_fh( *$out_fh );
+  $parser->parse_file( $in_file );
   return $out_file;
 }
 
@@ -134,5 +180,5 @@ sub _all_from {
 
 __END__
 
-#line 254
+#line 316
 

commit 6189771c2db47fcdb54b42d3115e2960c9ca0248
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon Feb 20 10:52:13 2017 -0500

    Prep for 0.04 release

diff --git a/Changes b/Changes
index 9ac258f..0a932f6 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for RT-Extension-Tags
 
+0.04 2017-02-20
+
+ - Update tag input elements to be consistent with usage in RT 4.2, 4.4
+
 0.03 2016-08-08
 
  - Create a new RT custom field type for tags to use in place of
diff --git a/META.yml b/META.yml
index ffc8ee6..7a3a341 100644
--- a/META.yml
+++ b/META.yml
@@ -25,7 +25,7 @@ requires:
 resources:
   license: http://opensource.org/licenses/gpl-license.php
   repository: https://github.com/bestpractical/rt-extension-tags
-version: '0.03'
-x_module_install_rtx_version: '0.37'
+version: '0.04'
+x_module_install_rtx_version: '0.38'
 x_requires_rt: 4.0.0
 x_rt_too_new: 4.6.0
diff --git a/lib/RT/Extension/Tags.pm b/lib/RT/Extension/Tags.pm
index 10d9c75..f0d0a34 100644
--- a/lib/RT/Extension/Tags.pm
+++ b/lib/RT/Extension/Tags.pm
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 package RT::Extension::Tags;
 
-our $VERSION = '0.03';
+our $VERSION = '0.04';
 
 
 require RT::CustomField;

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list