[Bps-public-commit] r20009 - in RT-Extension-QuickResolve: inc/Module inc/Module/Install

jesse at bestpractical.com jesse at bestpractical.com
Wed Jun 17 18:36:25 EDT 2009


Author: jesse
Date: Wed Jun 17 18:36:25 2009
New Revision: 20009

Modified:
   RT-Extension-QuickResolve/html/RT-Extension-QuickResolve/Toggle
   RT-Extension-QuickResolve/inc/Module/Install.pm
   RT-Extension-QuickResolve/inc/Module/Install/Base.pm
   RT-Extension-QuickResolve/inc/Module/Install/Makefile.pm
   RT-Extension-QuickResolve/inc/Module/Install/Metadata.pm

Log:
 "toggle" referred to too many things

Modified: RT-Extension-QuickResolve/html/RT-Extension-QuickResolve/Toggle
==============================================================================
--- RT-Extension-QuickResolve/html/RT-Extension-QuickResolve/Toggle	(original)
+++ RT-Extension-QuickResolve/html/RT-Extension-QuickResolve/Toggle	Wed Jun 17 18:36:25 2009
@@ -11,9 +11,9 @@
 $id
 $toggle => 0
 </%args>
-<span id="toggle-<%$id%>">
+<span id="toggle-resolve-<%$id%>">
 % my $url = $RT::WebPath."/RT-Extension-QuickResolve/ToggleQuickResolve?id=".$id;
-<a align="right" href="<%$url|n%>" onClick="ahah('<%$url|n%>', 'toggle-<%$id|n%>'); return false;" >
+<a align="right" href="<%$url|n%>" onClick="ahah('<%$url|n%>', 'toggle-resolve-<%$id|n%>'); return false;" >
 % if ($ticket->Status ne 'resolved') {
 Quick Resolve
 % } else { 

Modified: RT-Extension-QuickResolve/inc/Module/Install.pm
==============================================================================
--- RT-Extension-QuickResolve/inc/Module/Install.pm	(original)
+++ RT-Extension-QuickResolve/inc/Module/Install.pm	Wed Jun 17 18:36:25 2009
@@ -28,7 +28,7 @@
 	# 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 = '0.91';
+	$VERSION = '0.85';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -353,7 +353,7 @@
 	if ( $] >= 5.006 ) {
 		open( FH, '<', $_[0] ) or die "open($_[0]): $!";
 	} else {
-		open( FH, "< $_[0]"  ) or die "open($_[0]): $!";
+		open( FH, "< $_[0]"  ) or die "open($_[0]): $!";	
 	}
 	my $string = do { local $/; <FH> };
 	close FH or die "close($_[0]): $!";
@@ -384,7 +384,7 @@
 	if ( $] >= 5.006 ) {
 		open( FH, '>', $_[0] ) or die "open($_[0]): $!";
 	} else {
-		open( FH, "> $_[0]"  ) or die "open($_[0]): $!";
+		open( FH, "> $_[0]"  ) or die "open($_[0]): $!";	
 	}
 	foreach ( 1 .. $#_ ) {
 		print FH $_[$_] or die "print($_[0]): $!";

Modified: RT-Extension-QuickResolve/inc/Module/Install/Base.pm
==============================================================================
--- RT-Extension-QuickResolve/inc/Module/Install/Base.pm	(original)
+++ RT-Extension-QuickResolve/inc/Module/Install/Base.pm	Wed Jun 17 18:36:25 2009
@@ -4,7 +4,7 @@
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.85';
 }
 
 # Suspend handler for "redefined" warnings
@@ -13,34 +13,42 @@
 	$SIG{__WARN__} = sub { $w };
 }
 
-#line 42
+### This is the ONLY module that shouldn't have strict on
+# use strict;
+
+#line 45
 
 sub new {
-	my $class = shift;
-	unless ( defined &{"${class}::call"} ) {
-		*{"${class}::call"} = sub { shift->_top->call(@_) };
-	}
-	unless ( defined &{"${class}::load"} ) {
-		*{"${class}::load"} = sub { shift->_top->load(@_) };
+	my ($class, %args) = @_;
+
+	foreach my $method ( qw(call load) ) {
+		next if defined &{"$class\::$method"};
+		*{"$class\::$method"} = sub {
+			shift()->_top->$method(@_);
+		};
 	}
-	bless { @_ }, $class;
+
+	bless( \%args, $class );
 }
 
-#line 61
+#line 66
 
 sub AUTOLOAD {
+	my $self = shift;
 	local $@;
-	my $func = eval { shift->_top->autoload } or return;
-	goto &$func;
+	my $autoload = eval {
+		$self->_top->autoload
+	} or return;
+	goto &$autoload;
 }
 
-#line 75
+#line 83
 
 sub _top {
 	$_[0]->{_top};
 }
 
-#line 90
+#line 98
 
 sub admin {
 	$_[0]->_top->{admin}
@@ -48,7 +56,7 @@
 	Module::Install::Base::FakeAdmin->new;
 }
 
-#line 106
+#line 114
 
 sub is_admin {
 	$_[0]->admin->VERSION;
@@ -75,4 +83,4 @@
 
 1;
 
-#line 154
+#line 162

Modified: RT-Extension-QuickResolve/inc/Module/Install/Makefile.pm
==============================================================================
--- RT-Extension-QuickResolve/inc/Module/Install/Makefile.pm	(original)
+++ RT-Extension-QuickResolve/inc/Module/Install/Makefile.pm	Wed Jun 17 18:36:25 2009
@@ -2,14 +2,14 @@
 package Module::Install::Makefile;
 
 use strict 'vars';
-use ExtUtils::MakeMaker   ();
-use Module::Install::Base ();
+use Module::Install::Base;
+use ExtUtils::MakeMaker ();
 
-use vars qw{$VERSION @ISA $ISCORE};
+use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.91';
-	@ISA     = 'Module::Install::Base';
+	$VERSION = '0.85';
 	$ISCORE  = 1;
+	@ISA     = qw{Module::Install::Base};
 }
 
 sub Makefile { $_[0] }

Modified: RT-Extension-QuickResolve/inc/Module/Install/Metadata.pm
==============================================================================
--- RT-Extension-QuickResolve/inc/Module/Install/Metadata.pm	(original)
+++ RT-Extension-QuickResolve/inc/Module/Install/Metadata.pm	Wed Jun 17 18:36:25 2009
@@ -2,17 +2,18 @@
 package Module::Install::Metadata;
 
 use strict 'vars';
-use Module::Install::Base ();
+use Module::Install::Base;
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
-	@ISA     = 'Module::Install::Base';
+	$VERSION = '0.85';
+	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }
 
 my @boolean_keys = qw{
 	sign
+	mymeta
 };
 
 my @scalar_keys = qw{
@@ -439,21 +440,21 @@
 	/ixms ) {
 		my $license_text = $1;
 		my @phrases      = (
-			'under the same (?:terms|license) as (?:perl|the perl programming language) itself' => 'perl', 1,
-			'GNU general public license'         => 'gpl',         1,
-			'GNU public license'                 => 'gpl',         1,
-			'GNU lesser general public license'  => 'lgpl',        1,
-			'GNU lesser public license'          => 'lgpl',        1,
-			'GNU library general public license' => 'lgpl',        1,
-			'GNU library public license'         => 'lgpl',        1,
-			'BSD license'                        => 'bsd',         1,
-			'Artistic license'                   => 'artistic',    1,
-			'GPL'                                => 'gpl',         1,
-			'LGPL'                               => 'lgpl',        1,
-			'BSD'                                => 'bsd',         1,
-			'Artistic'                           => 'artistic',    1,
-			'MIT'                                => 'mit',         1,
-			'proprietary'                        => 'proprietary', 0,
+			'under the same (?:terms|license) as perl itself' => 'perl',        1,
+			'GNU general public license'                      => 'gpl',         1,
+			'GNU public license'                              => 'gpl',         1,
+			'GNU lesser general public license'               => 'lgpl',        1,
+			'GNU lesser public license'                       => 'lgpl',        1,
+			'GNU library general public license'              => 'lgpl',        1,
+			'GNU library public license'                      => 'lgpl',        1,
+			'BSD license'                                     => 'bsd',         1,
+			'Artistic license'                                => 'artistic',    1,
+			'GPL'                                             => 'gpl',         1,
+			'LGPL'                                            => 'lgpl',        1,
+			'BSD'                                             => 'bsd',         1,
+			'Artistic'                                        => 'artistic',    1,
+			'MIT'                                             => 'mit',         1,
+			'proprietary'                                     => 'proprietary', 0,
 		);
 		while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
 			$pattern =~ s{\s+}{\\s+}g;
@@ -505,29 +506,17 @@
 	}
 }
 
-sub test_requires_from {
-	my $self     = shift;
-	my $content  = Module::Install::_readperl($_[0]);
-	my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
-	while ( @requires ) {
-		my $module  = shift @requires;
-		my $version = shift @requires;
-		$self->test_requires( $module => $version );
-	}
-}
-
 # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
 # numbers (eg, 5.006001 or 5.008009).
 # Also, convert double-part versions (eg, 5.8)
 sub _perl_version {
 	my $v = $_[-1];
-	$v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;
+	$v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;	
 	$v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;
 	$v =~ s/(\.\d\d\d)000$/$1/;
 	$v =~ s/_.+$//;
 	if ( ref($v) ) {
-		# Numify
-		$v = $v + 0;
+		$v = $v + 0; # Numify
 	}
 	return $v;
 }
@@ -537,58 +526,23 @@
 
 
 ######################################################################
-# MYMETA Support
+# MYMETA.yml Support
 
 sub WriteMyMeta {
 	die "WriteMyMeta has been deprecated";
 }
 
-sub write_mymeta_yaml {
+sub write_mymeta {
 	my $self = shift;
+	
+	# If there's no existing META.yml there is nothing we can do
+	return unless -f 'META.yml';
 
 	# We need YAML::Tiny to write the MYMETA.yml file
 	unless ( eval { require YAML::Tiny; 1; } ) {
 		return 1;
 	}
 
-	# Generate the data
-	my $meta = $self->_write_mymeta_data or return 1;
-
-	# Save as the MYMETA.yml file
-	print "Writing MYMETA.yml\n";
-	YAML::Tiny::DumpFile('MYMETA.yml', $meta);
-}
-
-sub write_mymeta_json {
-	my $self = shift;
-
-	# We need JSON to write the MYMETA.json file
-	unless ( eval { require JSON; 1; } ) {
-		return 1;
-	}
-
-	# Generate the data
-	my $meta = $self->_write_mymeta_data or return 1;
-
-	# Save as the MYMETA.yml file
-	print "Writing MYMETA.json\n";
-	Module::Install::_write(
-		'MYMETA.json',
-		JSON->new->pretty(1)->canonical->encode($meta),
-	);
-}
-
-sub _write_mymeta_data {
-	my $self = shift;
-
-	# If there's no existing META.yml there is nothing we can do
-	return undef unless -f 'META.yml';
-
-	# We need Parse::CPAN::Meta to load the file
-	unless ( eval { require Parse::CPAN::Meta; 1; } ) {
-		return undef;
-	}
-
 	# Merge the perl version into the dependencies
 	my $val  = $self->Meta->{values};
 	my $perl = delete $val->{perl_version};
@@ -604,7 +558,7 @@
 	}
 
 	# Load the advisory META.yml file
-	my @yaml = Parse::CPAN::Meta::LoadFile('META.yml');
+	my @yaml = YAML::Tiny::LoadFile('META.yml');
 	my $meta = $yaml[0];
 
 	# Overwrite the non-configure dependency hashs
@@ -618,7 +572,9 @@
 		$meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
 	}
 
-	return $meta;
+	# Save as the MYMETA.yml file
+	print "Writing MYMETA.yml\n";
+	YAML::Tiny::DumpFile('MYMETA.yml', $meta);	
 }
 
 1;


More information about the Bps-public-commit mailing list