[Bps-public-commit] RT-Extension-CustomFieldsOnUpdate branch, master, updated. 5c1e9a7201be40c285e48fd38868fa563280e403

Kevin Falcone falcone at bestpractical.com
Mon Apr 7 19:40:02 EDT 2014


The branch, master has been updated
       via  5c1e9a7201be40c285e48fd38868fa563280e403 (commit)
       via  e38f44865d199b3bc8caffe5f0b93a4adb9d42c6 (commit)
       via  60ab227c44296f6f92c3084bc811171d9aa0b665 (commit)
       via  186da62db29fde1d28879eb8ec01ba3b95374cca (commit)
       via  2569142da9d18af37248711019607fb183a6f5bb (commit)
       via  3722e3ef45dc14e1112d8848d8385758ac28829d (commit)
       via  a8bae56001d56929566738ff78245138637007b0 (commit)
      from  3b1c617cd3eb5fc062b052f407aa11f938833ef2 (commit)

Summary of changes:
 .gitignore                                         |  22 ++--
 Changes                                            |   7 ++
 MANIFEST                                           |   1 +
 META.yml                                           |   8 +-
 Makefile.PL                                        |   3 +-
 README                                             |  59 +++++++----
 .../Ticket/Update.html/AfterWorked                 |  15 ++-
 inc/Module/Install.pm                              |   6 +-
 inc/Module/Install/Base.pm                         |   2 +-
 inc/Module/Install/Can.pm                          |  85 ++++++++++++++--
 inc/Module/Install/Fetch.pm                        |   2 +-
 inc/Module/Install/Makefile.pm                     |  27 ++---
 inc/Module/Install/Metadata.pm                     |   2 +-
 inc/Module/Install/RTx.pm                          | 106 +++++++++----------
 inc/Module/Install/ReadmeFromPod.pm                | 112 +++++++++++++++++++--
 inc/Module/Install/Win32.pm                        |   2 +-
 inc/Module/Install/WriteAll.pm                     |   2 +-
 lib/RT/Extension/CustomFieldsOnUpdate.pm           |  67 ++++++++----
 18 files changed, 379 insertions(+), 149 deletions(-)
 create mode 100644 Changes

- Log -----------------------------------------------------------------
commit a8bae56001d56929566738ff78245138637007b0
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Apr 7 16:09:49 2014 -0400

    upgrade MI and MIRTx

diff --git a/META.yml b/META.yml
index 110060e..b5fe69e 100644
--- a/META.yml
+++ b/META.yml
@@ -3,12 +3,12 @@ abstract: "edit ticket's custom fields on reply/comment"
 author:
   - 'Ruslan Zakirov <ruz at bestpractical.com>'
 build_requires:
-  ExtUtils::MakeMaker: 6.42
+  ExtUtils::MakeMaker: 6.59
 configure_requires:
-  ExtUtils::MakeMaker: 6.42
+  ExtUtils::MakeMaker: 6.59
 distribution_type: module
 dynamic_config: 1
-generated_by: 'Module::Install version 1.03'
+generated_by: 'Module::Install version 1.08'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index 7291c42..7680c84 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -31,7 +31,7 @@ BEGIN {
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '1.03';
+	$VERSION = '1.08';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -451,7 +451,7 @@ sub _version ($) {
 }
 
 sub _cmp ($$) {
-	_version($_[0]) <=> _version($_[1]);
+	_version($_[1]) <=> _version($_[2]);
 }
 
 # Cloned from Params::Util::_CLASS
@@ -467,4 +467,4 @@ sub _CLASS ($) {
 
 1;
 
-# Copyright 2008 - 2011 Adam Kennedy.
+# Copyright 2008 - 2012 Adam Kennedy.
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index 509dd98..3e63345 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -4,7 +4,7 @@ package Module::Install::Base;
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.03';
+	$VERSION = '1.08';
 }
 
 # Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index b0d3c41..93f248d 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -3,13 +3,12 @@ package Module::Install::Can;
 
 use strict;
 use Config                ();
-use File::Spec            ();
 use ExtUtils::MakeMaker   ();
 use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.03';
+	$VERSION = '1.08';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -29,7 +28,7 @@ sub can_use {
 	eval { require $mod; $pkg->VERSION($ver || 0); 1 };
 }
 
-# check if we can run some command
+# Check if we can run some command
 sub can_run {
 	my ($self, $cmd) = @_;
 
@@ -38,14 +37,88 @@ sub can_run {
 
 	for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
 		next if $dir eq '';
-		my $abs = File::Spec->catfile($dir, $_[1]);
+		require File::Spec;
+		my $abs = File::Spec->catfile($dir, $cmd);
 		return $abs if (-x $abs or $abs = MM->maybe_command($abs));
 	}
 
 	return;
 }
 
-# can we locate a (the) C compiler
+# Can our C compiler environment build XS files
+sub can_xs {
+	my $self = shift;
+
+	# Ensure we have the CBuilder module
+	$self->configure_requires( 'ExtUtils::CBuilder' => 0.27 );
+
+	# Do we have the configure_requires checker?
+	local $@;
+	eval "require ExtUtils::CBuilder;";
+	if ( $@ ) {
+		# They don't obey configure_requires, so it is
+		# someone old and delicate. Try to avoid hurting
+		# them by falling back to an older simpler test.
+		return $self->can_cc();
+	}
+
+	# Do we have a working C compiler
+	my $builder = ExtUtils::CBuilder->new(
+		quiet => 1,
+	);
+	unless ( $builder->have_compiler ) {
+		# No working C compiler
+		return 0;
+	}
+
+	# Write a C file representative of what XS becomes
+	require File::Temp;
+	my ( $FH, $tmpfile ) = File::Temp::tempfile(
+		"compilexs-XXXXX",
+		SUFFIX => '.c',
+	);
+	binmode $FH;
+	print $FH <<'END_C';
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+int main(int argc, char **argv) {
+    return 0;
+}
+
+int boot_sanexs() {
+    return 1;
+}
+
+END_C
+	close $FH;
+
+	# Can the C compiler access the same headers XS does
+	my @libs   = ();
+	my $object = undef;
+	eval {
+		local $^W = 0;
+		$object = $builder->compile(
+			source => $tmpfile,
+		);
+		@libs = $builder->link(
+			objects     => $object,
+			module_name => 'sanexs',
+		);
+	};
+	my $result = $@ ? 0 : 1;
+
+	# Clean up all the build files
+	foreach ( $tmpfile, $object, @libs ) {
+		next unless defined $_;
+		1 while unlink;
+	}
+
+	return $result;
+}
+
+# Can we locate a (the) C compiler
 sub can_cc {
 	my $self   = shift;
 	my @chunks = split(/ /, $Config::Config{cc}) or return;
@@ -78,4 +151,4 @@ if ( $^O eq 'cygwin' ) {
 
 __END__
 
-#line 156
+#line 236
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index 186fb1e..ecc0d53 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.03';
+	$VERSION = '1.08';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index dfc26e3..c0978a4 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.03';
+	$VERSION = '1.08';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -215,18 +215,22 @@ sub write {
 	require ExtUtils::MakeMaker;
 
 	if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) {
-		# MakeMaker can complain about module versions that include
-		# an underscore, even though its own version may contain one!
-		# Hence the funny regexp to get rid of it.  See RT #35800
-		# for details.
-		my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/;
-		$self->build_requires(     'ExtUtils::MakeMaker' => $v );
-		$self->configure_requires( 'ExtUtils::MakeMaker' => $v );
+		# This previous attempted to inherit the version of
+		# ExtUtils::MakeMaker in use by the module author, but this
+		# was found to be untenable as some authors build releases
+		# using future dev versions of EU:MM that nobody else has.
+		# Instead, #toolchain suggests we use 6.59 which is the most
+		# stable version on CPAN at time of writing and is, to quote
+		# ribasushi, "not terminally fucked, > and tested enough".
+		# TODO: We will now need to maintain this over time to push
+		# the version up as new versions are released.
+		$self->build_requires(     'ExtUtils::MakeMaker' => 6.59 );
+		$self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 );
 	} else {
 		# Allow legacy-compatibility with 5.005 by depending on the
 		# most recent EU:MM that supported 5.005.
-		$self->build_requires(     'ExtUtils::MakeMaker' => 6.42 );
-		$self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
+		$self->build_requires(     'ExtUtils::MakeMaker' => 6.36 );
+		$self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 );
 	}
 
 	# Generate the MakeMaker params
@@ -241,7 +245,6 @@ in a module, and provide its file path via 'version_from' (or
 'all_from' if you prefer) in Makefile.PL.
 EOT
 
-	$DB::single = 1;
 	if ( $self->tests ) {
 		my @tests = split ' ', $self->tests;
 		my %seen;
@@ -412,4 +415,4 @@ sub postamble {
 
 __END__
 
-#line 541
+#line 544
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index 8d034f3..e4112f8 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.03';
+	$VERSION = '1.08';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 73b9cda..00cf565 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -8,13 +8,13 @@ no warnings 'once';
 
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.29';
+our $VERSION = '0.33';
 
 use FindBin;
 use File::Glob     ();
 use File::Basename ();
 
-my @DIRS = qw(etc lib html bin sbin po var);
+my @DIRS = qw(etc lib html static bin sbin po var);
 my @INDEX_DIRS = qw(lib bin sbin);
 
 sub RTx {
@@ -62,10 +62,11 @@ sub RTx {
     unshift @INC, "$RT::LocalPath/lib" if $RT::LocalPath;
     unshift @INC, $lib_path;
 
-    $RT::LocalVarPath  ||= $RT::VarPath;
-    $RT::LocalPoPath   ||= $RT::LocalLexiconPath;
-    $RT::LocalHtmlPath ||= $RT::MasonComponentRoot;
-    $RT::LocalLibPath  ||= "$RT::LocalPath/lib";
+    $RT::LocalVarPath    ||= $RT::VarPath;
+    $RT::LocalPoPath     ||= $RT::LocalLexiconPath;
+    $RT::LocalHtmlPath   ||= $RT::MasonComponentRoot;
+    $RT::LocalStaticPath ||= $RT::StaticPath;
+    $RT::LocalLibPath    ||= "$RT::LocalPath/lib";
 
     my $with_subdirs = $ENV{WITH_SUBDIRS};
     @ARGV = grep { /WITH_SUBDIRS=(.*)/ ? ( ( $with_subdirs = $1 ), 0 ) : 1 }
@@ -129,23 +130,15 @@ install ::
 
     my %has_etc;
     if ( File::Glob::bsd_glob("$FindBin::Bin/etc/schema.*") ) {
-
-        # got schema, load factory module
         $has_etc{schema}++;
-        $self->load('RTxFactory');
-        $self->postamble(<< ".");
-factory ::
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name))"
-
-dropdb ::
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name drop))"
-
-.
     }
     if ( File::Glob::bsd_glob("$FindBin::Bin/etc/acl.*") ) {
         $has_etc{acl}++;
     }
     if ( -e 'etc/initialdata' ) { $has_etc{initialdata}++; }
+    if ( grep { /\d+\.\d+\.\d+.*$/ } glob('etc/upgrade/*.*.*') ) {
+        $has_etc{upgrade}++;
+    }
 
     $self->postamble("$postamble\n");
     unless ( $subdirs{'lib'} ) {
@@ -164,68 +157,69 @@ dropdb ::
         print "For first-time installation, type 'make initdb'.\n";
         my $initdb = '';
         $initdb .= <<"." if $has_etc{schema};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(schema))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(schema \$(NAME) \$(VERSION)))"
 .
         $initdb .= <<"." if $has_etc{acl};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(acl))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(acl \$(NAME) \$(VERSION)))"
 .
         $initdb .= <<"." if $has_etc{initialdata};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(insert))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(insert \$(NAME) \$(VERSION)))"
 .
         $self->postamble("initdb ::\n$initdb\n");
         $self->postamble("initialize-database ::\n$initdb\n");
+        if ($has_etc{upgrade}) {
+            print "To upgrade from a previous version of this extension, use 'make upgrade-database'\n";
+            my $upgradedb = qq|\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(upgrade \$(NAME) \$(VERSION)))"\n|;
+            $self->postamble("upgrade-database ::\n$upgradedb\n");
+            $self->postamble("upgradedb ::\n$upgradedb\n");
+        }
     }
 }
 
-sub RTxInit {
-    unshift @INC, substr( delete( $INC{'RT.pm'} ), 0, -5 ) if $INC{'RT.pm'};
-    require RT;
-    RT::LoadConfig();
-    RT::ConnectToDatabase();
-
-    die "Cannot load RT" unless $RT::Handle and $RT::DatabaseType;
-}
-
-# stolen from RT::Handle so we work on 3.6 (cmp_versions came in with 3.8)
-{ my %word = (
-    a     => -4,
-    alpha => -4,
-    b     => -3,
-    beta  => -3,
-    pre   => -2,
-    rc    => -1,
-    head  => 9999,
-);
-sub cmp_version($$) {
-    my ($a, $b) = (@_);
-    my @a = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
-        split /([^0-9]+)/, $a;
-    my @b = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
-        split /([^0-9]+)/, $b;
-    @a > @b
-        ? push @b, (0) x (@a- at b)
-        : push @a, (0) x (@b- at a);
-    for ( my $i = 0; $i < @a; $i++ ) {
-        return $a[$i] <=> $b[$i] if $a[$i] <=> $b[$i];
-    }
-    return 0;
-}}
 sub requires_rt {
     my ($self,$version) = @_;
 
     # if we're exactly the same version as what we want, silently return
     return if ($version eq $RT::VERSION);
 
-    my @sorted = sort cmp_version $version,$RT::VERSION;
+    _load_rt_handle();
+    my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
 
     if ($sorted[-1] eq $version) {
         # should we die?
-        warn "\nWarning: prerequisite RT $version not found. Your installed version of RT ($RT::VERSION) is too old.\n\n";
+        die "\nWarning: prerequisite RT $version not found. Your installed version of RT ($RT::VERSION) is too old.\n\n";
+    }
+}
+
+sub rt_too_new {
+    my ($self,$version,$msg) = @_;
+    $msg ||= "Your version %s is too new, this extension requires a release of RT older than %s\n";
+
+    _load_rt_handle();
+    my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
+
+    if ($sorted[0] eq $version) {
+        die sprintf($msg,$RT::VERSION,$version);
+    }
+}
+
+# RT::Handle runs FinalizeDatabaseType which calls RT->Config->Get
+# On 3.8, this dies.  On 4.0/4.2 ->Config transparently runs LoadConfig.
+# LoadConfig requires being able to read RT_SiteConfig.pm (root) so we'd
+# like to avoid pushing that on users.
+# Fake up just enough Config to let FinalizeDatabaseType finish, and
+# anyone later calling LoadConfig will overwrite our shenanigans.
+sub _load_rt_handle {
+    unless ($RT::Config) {
+        require RT::Config;
+        $RT::Config = RT::Config->new;
+        RT->Config->Set('DatabaseType','mysql');
     }
+    require RT::Handle;
 }
 
 1;
 
 __END__
 
-#line 348
+#line 362
diff --git a/inc/Module/Install/ReadmeFromPod.pm b/inc/Module/Install/ReadmeFromPod.pm
index 348531e..b5e03c3 100644
--- a/inc/Module/Install/ReadmeFromPod.pm
+++ b/inc/Module/Install/ReadmeFromPod.pm
@@ -7,29 +7,119 @@ use warnings;
 use base qw(Module::Install::Base);
 use vars qw($VERSION);
 
-$VERSION = '0.12';
+$VERSION = '0.22';
 
 sub readme_from {
   my $self = shift;
   return unless $self->is_admin;
 
-  my $file = shift || $self->_all_from
+  # Input file
+  my $in_file  = shift || $self->_all_from
     or die "Can't determine file to make readme_from";
-  my $clean = shift;
 
-  print "Writing README from $file\n";
+  # Get optional arguments
+  my ($clean, $format, $out_file, $options);
+  my $args = shift;
+  if ( ref $args ) {
+    # Arguments are in a hashref
+    if ( ref($args) ne 'HASH' ) {
+      die "Expected a hashref but got a ".ref($args)."\n";
+    } else {
+      $clean    = $args->{'clean'};
+      $format   = $args->{'format'};
+      $out_file = $args->{'output_file'};
+      $options  = $args->{'options'};
+    }
+  } else {
+    # Arguments are in a list
+    $clean    = $args;
+    $format   = shift;
+    $out_file = shift;
+    $options  = \@_;
+  }
+
+  # Default values;
+  $clean  ||= 0;
+  $format ||= 'txt';
+
+  # Generate README
+  print "readme_from $in_file to $format\n";
+  if ($format =~ m/te?xt/) {
+    $out_file = $self->_readme_txt($in_file, $out_file, $options);
+  } elsif ($format =~ m/html?/) {
+    $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 'pdf') {
+    $out_file = $self->_readme_pdf($in_file, $out_file, $options);
+  }
 
-  require Pod::Text;
-  my $parser = Pod::Text->new();
-  open README, '> README' or die "$!\n";
-  $parser->output_fh( *README );
-  $parser->parse_file( $file );
   if ($clean) {
-    $self->clean_files('README');
+    $self->clean_files($out_file);
   }
+
   return 1;
 }
 
+
+sub _readme_txt {
+  my ($self, $in_file, $out_file, $options) = @_;
+  $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";
+  $parser->output_fh( *$out_fh );
+  $parser->parse_file( $in_file );
+  close $out_fh;
+  return $out_file;
+}
+
+
+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,
+  );
+  # Remove temporary files if needed
+  for my $file ('pod2htmd.tmp', 'pod2htmi.tmp') {
+    if (-e $file) {
+      unlink $file or warn "Warning: Could not remove file '$file'.\n$!\n";
+    }
+  }
+  return $out_file;
+}
+
+
+sub _readme_man {
+  my ($self, $in_file, $out_file, $options) = @_;
+  $out_file ||= 'README.1';
+  require Pod::Man;
+  my $parser = Pod::Man->new( @$options );
+  $parser->parse_from_file($in_file, $out_file);
+  return $out_file;
+}
+
+
+sub _readme_pdf {
+  my ($self, $in_file, $out_file, $options) = @_;
+  $out_file ||= 'README.pdf';
+  eval { require App::pod2pdf; }
+    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;
+  return $out_file;
+}
+
+
 sub _all_from {
   my $self = shift;
   return unless $self->admin->{extensions};
@@ -44,5 +134,5 @@ sub _all_from {
 
 __END__
 
-#line 112
+#line 254
 
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index d39951d..e529382 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.03';
+	$VERSION = '1.08';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index eff6504..2c74308 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.03';
+	$VERSION = '1.08';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

commit 3722e3ef45dc14e1112d8848d8385758ac28829d
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Apr 7 16:10:34 2014 -0400

    Switch to our standard language
    
    This means we get normal installation instructions and actually have a
    link to the bugtracker, as well as putting a copyright on it.
    I have no idea why this didn't use our standards.

diff --git a/README b/README
index 33d4530..307b6ee 100644
--- a/README
+++ b/README
@@ -6,32 +6,55 @@ DESCRIPTION
     This extension adds often requested feature - update of ticket's custom
     fields on reply and comment.
 
-    This is for RT 4.0.x, solutions for older versions available on the
-    wiki, start from CustomFieldsOnUpdate page [1].
-
-    [1] http://requesttracker.wikia.com/wiki/CustomFieldsOnUpdate
+RT VERSION
+    This is for RT 4, solutions for older versions are available on the wiki
+    linked from the CustomFieldsOnUpdate page.
+    http://requesttracker.wikia.com/wiki/CustomFieldsOnUpdate
 
 INSTALLATION
-    It's sad but RT 4.0.0 - 4.0.2 miss a tiny feature, so you have to apply
-    patches/RT-4.0.0-2-edit-ticket-custom-fields-in-table.patch. This change
-    is part of RT 4.0.3.
+    "perl Makefile.PL"
+    "make"
+    "make install"
+        May need root permissions
+
+    Edit your /opt/rt4/etc/RT_SiteConfig.pm
+        If you are using RT 4.2 or greater, add this line:
+
+            Plugin('RT::Extension::CustomFieldsOnUpdate');
+
+        For RT 4.0, add this line:
 
-    Otherwise installation is common:
+            Set(@Plugins, qw(RT::Extension::CustomFieldsOnUpdate));
 
-        perl Makefile.PL
-        make
-        make install
+        or add "RT::Extension::CustomFieldsOnUpdate" to your existing
+        @Plugins line.
 
-    Register 'RT::Extension::CustomFieldsOnUpdate' in the site config;
+    Patch your RT
+        If you are running RT 4.0.0 - 4.0.2 you need to apply
+        patches/RT-4.0.0-2-edit-ticket-custom-fields-in-table.patch. This
+        change is part of RT 4.0.3 and later.
 
-        Set(@Plugins, qw(
-            RT::Extension::CustomFieldsOnUpdate
-            ... other plugins you may have ...
-        ));
+            patch -p1 < /path/to/RT-4.0.0-2-edit-ticket-custom-fields-in-table.patch
+
+    Clear your mason cache
+            rm -rf /opt/rt4/var/mason_data/obj
+
+    Restart your webserver
 
 AUTHOR
-    Ruslan Zakirov <ruz at bestpractical.com>
+    Ruslan Zakirov <ruz at bestpractical.com> Kevin Falcone
+    <falcone at bestpractical.com>
+
+BUGS
+    All bugs should be reported via email to
+    bug-RT-Extension-CustomFieldsOnUpdate at rt.cpan.org
+    <mailto:bug-RT-Extension-CustomFieldsOnUpdate at rt.cpan.org> or via the
+    web at rt.cpan.org
+    <http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-CustomFie
+    ldsOnUpdate>.
+
+LICENSE AND COPYRIGHT
+    This software is Copyright (c) 2014 by Best Practical Solutions
 
-LICENSE
     Under the same terms as perl itself.
 
diff --git a/lib/RT/Extension/CustomFieldsOnUpdate.pm b/lib/RT/Extension/CustomFieldsOnUpdate.pm
index 5d0e7f3..ae45f70 100644
--- a/lib/RT/Extension/CustomFieldsOnUpdate.pm
+++ b/lib/RT/Extension/CustomFieldsOnUpdate.pm
@@ -15,37 +15,66 @@ RT::Extension::CustomFieldsOnUpdate - edit ticket's custom fields on reply/comme
 This extension adds often requested feature - update of ticket's custom fields on
 reply and comment.
 
-This is for RT 4.0.x, solutions for older versions available on the wiki,
-start from CustomFieldsOnUpdate page [1].
+=head1 RT VERSION
 
-[1] http://requesttracker.wikia.com/wiki/CustomFieldsOnUpdate
+This is for RT 4, solutions for older versions are available on the wiki linked from the CustomFieldsOnUpdate page.
+http://requesttracker.wikia.com/wiki/CustomFieldsOnUpdate
 
-=head1 INSTALLATION
+=head1 INSTALLATION 
 
-It's sad but RT 4.0.0 - 4.0.2 miss a tiny feature, so you have to apply
+=over
+
+=item C<perl Makefile.PL>
+
+=item C<make>
+
+=item C<make install>
+
+May need root permissions
+
+=item Edit your F</opt/rt4/etc/RT_SiteConfig.pm>
+
+If you are using RT 4.2 or greater, add this line:
+
+    Plugin('RT::Extension::CustomFieldsOnUpdate');
+
+For RT 4.0, add this line:
+
+    Set(@Plugins, qw(RT::Extension::CustomFieldsOnUpdate));
+
+or add C<RT::Extension::CustomFieldsOnUpdate> to your existing C<@Plugins> line.
+
+=item Patch your RT
+
+If you are running RT 4.0.0 - 4.0.2 you need to apply
 F<patches/RT-4.0.0-2-edit-ticket-custom-fields-in-table.patch>. This change
-is part of RT 4.0.3.
+is part of RT 4.0.3 and later.
 
-Otherwise installation is common:
+    patch -p1 < /path/to/RT-4.0.0-2-edit-ticket-custom-fields-in-table.patch
 
-    perl Makefile.PL
-    make
-    make install
+=item Clear your mason cache
 
-Register 'RT::Extension::CustomFieldsOnUpdate' in the site config;
+    rm -rf /opt/rt4/var/mason_data/obj
 
-    Set(@Plugins, qw(
-        RT::Extension::CustomFieldsOnUpdate
-        ... other plugins you may have ...
-    ));
+=item Restart your webserver
 
-=cut
+=back
 
 =head1 AUTHOR
 
-Ruslan Zakirov E<lt>ruz at bestpractical.comE<gt>
+Ruslan Zakirov <ruz at bestpractical.com>
+Kevin Falcone <falcone at bestpractical.com>
+
+=head1 BUGS
+
+All bugs should be reported via email to
+L<bug-RT-Extension-CustomFieldsOnUpdate at rt.cpan.org|mailto:bug-RT-Extension-CustomFieldsOnUpdate at rt.cpan.org>
+or via the web at
+L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-CustomFieldsOnUpdate>.
+
+=head1 LICENSE AND COPYRIGHT
 
-=head1 LICENSE
+This software is Copyright (c) 2014 by Best Practical Solutions
 
 Under the same terms as perl itself.
 

commit 2569142da9d18af37248711019607fb183a6f5bb
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Apr 7 16:11:38 2014 -0400

    This only works on 4.0.0 or greater, so flag it in Makefile.PL

diff --git a/Makefile.PL b/Makefile.PL
index dc5bfce..6f1f069 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -4,5 +4,6 @@ RTx         'RT-Extension-CustomFieldsOnUpdate';
 all_from    'lib/RT/Extension/CustomFieldsOnUpdate.pm';
 readme_from 'lib/RT/Extension/CustomFieldsOnUpdate.pm';
 
+requires_rt('4.0.0');
 
-WriteAll();
\ No newline at end of file
+WriteAll();

commit 186da62db29fde1d28879eb8ec01ba3b95374cca
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Apr 7 16:13:00 2014 -0400

    change to the normal gitignore

diff --git a/.gitignore b/.gitignore
index f2f8440..31ef851 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,14 @@
+blib*
 Makefile
-Makefile.bak
 Makefile.old
-Makefile.new
-MYMETA.*
-pm_to_blib
-blib/
-MANIFEST.bak
-MANIFEST.new
-MANIFEST.old
-cover_db/
-nytprof/
+pm_to_blib*
 *.tar.gz
-*.sw[po]
+.lwpcookies
+cover_db
+pod2htm*.tmp
+/RT-Extension-CustomFieldsOnUpdate*
+*.bak
+*.swp
+/MYMETA.*
+/t/tmp
+/xt/tmp

commit 60ab227c44296f6f92c3084bc811171d9aa0b665
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Apr 7 16:27:20 2014 -0400

    Fix 4.2 deprecation warnings
    
    We can't just switch to /Elements/EditCustomFields and remain 4.0
    compatible, so we have some shenanigans to figure out what version
    we're on.  /Elements/EditCustomFields didn't exist in 4.0 which makes it
    easier.
    
    Reported by Carlos Fuentes and Martin Budsjo

diff --git a/html/Callbacks/CustomFieldsOnUpdate/Ticket/Update.html/AfterWorked b/html/Callbacks/CustomFieldsOnUpdate/Ticket/Update.html/AfterWorked
index 30b148c..401f3c7 100644
--- a/html/Callbacks/CustomFieldsOnUpdate/Ticket/Update.html/AfterWorked
+++ b/html/Callbacks/CustomFieldsOnUpdate/Ticket/Update.html/AfterWorked
@@ -1,8 +1,17 @@
-<& /Ticket/Elements/EditCustomFields,
-    TicketObj => $Ticket,
+<%INIT>
+my $comp = '/Elements/EditCustomFields';
+my %obj_args = ( Object => $Ticket );
+
+if (!$m->comp_exists('/Elements/EditCustomFields')) {
+    $comp = '/Ticket/Elements/EditCustomFields';
+    %obj_args = ( TicketObj => $Ticket );
+}
+</%INIT>
+<& $comp,
+    %obj_args,
     InTable => 1,
     DefaultsFromTopArguments => 0,
 &>
 <%ARGS>
 $Ticket
-</%ARGS>
\ No newline at end of file
+</%ARGS>

commit e38f44865d199b3bc8caffe5f0b93a4adb9d42c6
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Apr 7 16:29:29 2014 -0400

    Add a standard changes file

diff --git a/Changes b/Changes
new file mode 100644
index 0000000..724498d
--- /dev/null
+++ b/Changes
@@ -0,0 +1,7 @@
+Revision history for RT-Extension-CustomFieldsOnUpdate
+
+0.02 2014-04-07
+ - 4.2 compatibility
+
+0.01 2013-10-22
+ - Initial version
diff --git a/MANIFEST b/MANIFEST
index b78a081..a97c7d9 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,3 +1,4 @@
+Changes
 html/Callbacks/CustomFieldsOnUpdate/Ticket/Update.html/AfterWorked
 html/Callbacks/CustomFieldsOnUpdate/Ticket/Update.html/BeforeUpdate
 inc/Module/Install.pm

commit 5c1e9a7201be40c285e48fd38868fa563280e403
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Apr 7 16:30:59 2014 -0400

    bump version for 0.02

diff --git a/META.yml b/META.yml
index b5fe69e..f71da2d 100644
--- a/META.yml
+++ b/META.yml
@@ -22,4 +22,4 @@ requires:
   perl: 5.8.3
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.01
+version: 0.02
diff --git a/lib/RT/Extension/CustomFieldsOnUpdate.pm b/lib/RT/Extension/CustomFieldsOnUpdate.pm
index ae45f70..2079f1f 100644
--- a/lib/RT/Extension/CustomFieldsOnUpdate.pm
+++ b/lib/RT/Extension/CustomFieldsOnUpdate.pm
@@ -4,7 +4,7 @@ use warnings;
 
 package RT::Extension::CustomFieldsOnUpdate;
 
-our $VERSION = '0.01';
+our $VERSION = '0.02';
 
 =head1 NAME
 

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



More information about the Bps-public-commit mailing list