[Bps-public-commit] RTx-TakeScreenshots branch, master, updated. 674358a51376d62ee84daeabd196b1c421502d7c
Thomas Sibley
trs at bestpractical.com
Thu Apr 5 11:11:27 EDT 2012
The branch, master has been updated
via 674358a51376d62ee84daeabd196b1c421502d7c (commit)
via 9dfce81e1aceaf23acc956078f834b94b5fbbc0e (commit)
via a4b1099972430d586fb33d51d90d6e4ded2189c9 (commit)
via b12a45aa1d89a50b8b9c5cf90f3b98e86d496442 (commit)
from 08646c5eaecab73c7a72e56e7b2f4451e927d442 (commit)
Summary of changes:
META.yml | 9 +++-
Makefile.PL | 1 +
bin/clean-slate | 4 +-
bin/selenium-server-standalone-2.0b3.jar | Bin 21485611 -> 0 bytes
bin/start-selenium | 2 -
bin/take-screenshots | 70 ++++++++++++++++++++++++++++--
etc/initialdata | 24 +++++++++-
inc/Module/Install.pm | 6 +-
inc/Module/Install/Base.pm | 2 +-
inc/Module/Install/Can.pm | 2 +-
inc/Module/Install/Fetch.pm | 2 +-
inc/Module/Install/Makefile.pm | 11 ++---
inc/Module/Install/Metadata.pm | 29 ++++++++-----
inc/Module/Install/RTx.pm | 42 +++++++++++++++++-
inc/Module/Install/Win32.pm | 2 +-
inc/Module/Install/WriteAll.pm | 2 +-
16 files changed, 167 insertions(+), 41 deletions(-)
delete mode 100644 bin/selenium-server-standalone-2.0b3.jar
delete mode 100755 bin/start-selenium
- Log -----------------------------------------------------------------
commit b12a45aa1d89a50b8b9c5cf90f3b98e86d496442
Author: Thomas Sibley <trs at bestpractical.com>
Date: Thu Apr 5 10:11:13 2012 -0400
The RT_DBA_USER test was not working consistently for me
diff --git a/bin/clean-slate b/bin/clean-slate
index 939b64a..f40c6ef 100755
--- a/bin/clean-slate
+++ b/bin/clean-slate
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/bin/bash
EXT=`pwd`
RT=${RTHOME:-~/bps/rt}
-if [ "${RT_DBA_USER}x" == "x" ]; then
+if [[ "${RT_DBA_USER}x" == "x" ]]; then
echo "You must set RT_DBA_USER";
exit 1;
fi
commit a4b1099972430d586fb33d51d90d6e4ded2189c9
Author: Thomas Sibley <trs at bestpractical.com>
Date: Thu Apr 5 10:47:09 2012 -0400
Shoot some toggled prefs to show what they do
This has been sitting in my repo uncommitted for a long time now.
diff --git a/bin/take-screenshots b/bin/take-screenshots
index 00f7aa6..9a1ae08 100755
--- a/bin/take-screenshots
+++ b/bin/take-screenshots
@@ -2,6 +2,7 @@
use strict;
use warnings;
+use List::Util qw(first);
use Path::Class qw(file);
use WWW::Selenium;
use WWW::Selenium::Util qw/server_is_running/;
@@ -111,6 +112,19 @@ for my $subscribe (grep { $_->[1] =~ /Dashboards\/Subscription/ } @pages) {
$firefox->open($RT);
}
+# Show some tweakable prefs
+{
+ shoot_pref(
+ pref => 'DeferTransactionLoading',
+ page => 'ticket_basics',
+ );
+
+ shoot_pref(
+ pref => 'SimplifiedRecipients',
+ page => 'ticket_update',
+ );
+}
+
my $resized = 0;
# Capture the pages we want
@@ -132,6 +146,25 @@ for my $page (@pages) {
$firefox->stop;
+sub shoot_pref {
+ my %args = ( vals => [1,0], @_ );
+ my $pref = $args{'pref'};
+ my $shot = $args{'page'};
+ my ($on, $off) = @{$args{'vals'}};
+
+ my $name = "pref$pref";
+ $name =~ s/([a-z])([A-Z])/$1_\L$2\E/g;
+
+ $firefox->open("$RT/Prefs/Other.html?Update=1;$pref=$on");
+ $firefox->open(map { $RT . $_->[1] } first { $_->[0] eq $shot } @pages);
+ $firefox->wait_for_page_to_load(5000);
+ print "Screenshotting $name\n";
+ $firefox->capture_entire_page_screenshot("$output/$name.png");
+ $firefox->open("$RT/Prefs/Other.html?Update=1;$pref=$off");
+
+ $firefox->open($RT);
+}
+
sub resize_window {
my ($window, $w, $h) = @_;
$window->run_script("window.moveTo(0,0); window.resizeTo($w, $h);");
diff --git a/etc/initialdata b/etc/initialdata
index 6b1d521..54432eb 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -35,7 +35,7 @@
Name => $_,
EmailAddress => "$_\@bestpractical.com",
Password => 'password',
- }} qw/trs/
+ }} qw/tom alex kevin ruslan sunnavy jim/
);
@CustomFields = (
@@ -85,7 +85,7 @@ our @Tickets = (
{
Queue => 'Office',
Subject => 'Office has run out of coffee!',
- Requestor => 'trs',
+ Requestor => 'tom',
Owner => 'jesse',
Status => 'open',
CF => { 'Operating System' => 'Filterfresh' },
@@ -117,12 +117,30 @@ RFP sent out to the vendors.
Queue => 'General',
Subject => 'Evaluate responses to RFP for coffee roasts',
Requestor => 'jesse',
- Owner => 'trs',
+ Owner => 'tom',
},
);
@Final = (
sub {
+ # Add hackers as an Office watcher so preview scrips has data
+ my $hackers = RT::Group->new( RT->SystemUser );
+ $hackers->LoadUserDefinedGroup('RT hackers');
+ for my $person (map { $_->{'Name'} } @Users) {
+ my $principal = RT::User->new( RT->SystemUser );
+ $principal->Load($person);
+ my ($ok, $msg) = $hackers->AddMember( $principal->Id );
+ warn "AddMember: $msg" unless $ok;
+ }
+
+ my $queue = RT::Queue->new( RT->SystemUser );
+ $queue->Load('Office');
+ $queue->AddWatcher(
+ Type => 'AdminCc',
+ PrincipalId => $hackers->Id,
+ );
+ },
+ sub {
# Bookmark ticket #4 and turn root into jesse
my $user = RT::User->new( RT->SystemUser );
$user->Load('root');
commit 9dfce81e1aceaf23acc956078f834b94b5fbbc0e
Author: Thomas Sibley <trs at bestpractical.com>
Date: Thu Apr 5 11:10:33 2012 -0400
Spawn a selenium server with Alien::SeleniumRC
diff --git a/META.yml b/META.yml
index 6e5443a..3ce25f4 100644
--- a/META.yml
+++ b/META.yml
@@ -17,6 +17,8 @@ no_index:
directory:
- etc
- inc
+recommends:
+ Alien::SeleniumRC: 0
requires:
Path::Class: 0
WWW::Selenium: 0
diff --git a/Makefile.PL b/Makefile.PL
index ad5f812..323d5e1 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -5,5 +5,6 @@ all_from('lib/RTx/TakeScreenshots.pm');
requires 'Path::Class';
requires 'WWW::Selenium';
+recommends 'Alien::SeleniumRC';
&WriteAll;
diff --git a/bin/selenium-server-standalone-2.0b3.jar b/bin/selenium-server-standalone-2.0b3.jar
deleted file mode 100644
index d512a9e..0000000
Binary files a/bin/selenium-server-standalone-2.0b3.jar and /dev/null differ
diff --git a/bin/start-selenium b/bin/start-selenium
deleted file mode 100755
index 0a6bf75..0000000
--- a/bin/start-selenium
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-java -jar bin/selenium-server-standalone-2.0b3.jar "$@"
diff --git a/bin/take-screenshots b/bin/take-screenshots
index 9a1ae08..e5da89d 100755
--- a/bin/take-screenshots
+++ b/bin/take-screenshots
@@ -7,22 +7,51 @@ use Path::Class qw(file);
use WWW::Selenium;
use WWW::Selenium::Util qw/server_is_running/;
-unless (server_is_running) {
- die "Please start a Selenium server first.\n";
-}
-
use Getopt::Long;
my $RT = 'http://localhost:8008';
my $output = $ENV{PWD};
+my $verbose = 0;
GetOptions(
'url=s' => \$RT,
'output=s' => \$output,
+ 'verbose' => \$verbose,
);
unless ($RT) {
die "Usage: $0 --url http://localhost:8008 --output .\n";
}
+my $PID;
+unless (server_is_running) {
+ eval { require Alien::SeleniumRC; 1; }
+ or die "Please start a Selenium server first, or install Alien::SeleniumRC so I can do it for you.\n";
+
+ $PID = fork();
+ die if $PID == -1;
+ if ($PID) {
+ # parent
+ sleep 5; # time for java to find it's pants
+ } else {
+ # child
+ unless ($verbose) {
+ close *STDERR;
+ close *STDOUT;
+ }
+ $ENV{PATH} = "$ENV{PATH}:/usr/lib/firefox:/usr/lib/mozilla-firefox";
+ print STDERR "started selenium server [$$]\n" if $verbose;
+ local $SIG{TERM} = sub { exit 0 };
+ my $jarfile = Alien::SeleniumRC::find_jar_location();
+ exec "java -jar $jarfile" or die "couldn't exec! $!\n";
+ }
+}
+
+END {
+ if ($PID) {
+ print STDERR "killing $PID\n" if $verbose;
+ kill(15, $PID);
+ }
+}
+
# Convert output to absolute path for selenium
$output = file($output)->absolute;
commit 674358a51376d62ee84daeabd196b1c421502d7c
Author: Thomas Sibley <trs at bestpractical.com>
Date: Thu Apr 5 11:11:11 2012 -0400
Update M::I
diff --git a/META.yml b/META.yml
index 3ce25f4..cc34d5d 100644
--- a/META.yml
+++ b/META.yml
@@ -3,11 +3,12 @@ abstract: 'RT TakeScreenshots Extension'
author:
- 'Thomas Sibley C<< <trs at bestpractical.com> >>'
build_requires:
- ExtUtils::MakeMaker: 6.42
+ ExtUtils::MakeMaker: 6.36
configure_requires:
- ExtUtils::MakeMaker: 6.42
+ ExtUtils::MakeMaker: 6.36
distribution_type: module
-generated_by: 'Module::Install version 1.00'
+dynamic_config: 1
+generated_by: 'Module::Install version 1.04'
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 8ee839d..c685ca4 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.00';
+ $VERSION = '1.04';
# 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 - 2010 Adam Kennedy.
+# Copyright 2008 - 2011 Adam Kennedy.
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index b55bda3..b520616 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.00';
+ $VERSION = '1.04';
}
# Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index 71ccc27..a162ad4 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -9,7 +9,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.00';
+ $VERSION = '1.04';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index ec1f106..a412576 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.00';
+ $VERSION = '1.04';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index 5dfd0e9..035cef2 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.00';
+ $VERSION = '1.04';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -219,14 +219,14 @@ sub write {
# 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+)/;
+ my ($v) = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/;
$self->build_requires( 'ExtUtils::MakeMaker' => $v );
$self->configure_requires( 'ExtUtils::MakeMaker' => $v );
} 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 +241,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 +411,4 @@ sub postamble {
__END__
-#line 541
+#line 540
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index cfe45b3..31c953e 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.00';
+ $VERSION = '1.04';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -151,15 +151,21 @@ sub install_as_site { $_[0]->installdirs('site') }
sub install_as_vendor { $_[0]->installdirs('vendor') }
sub dynamic_config {
- my $self = shift;
- unless ( @_ ) {
- warn "You MUST provide an explicit true/false value to dynamic_config\n";
- return $self;
+ my $self = shift;
+ my $value = @_ ? shift : 1;
+ if ( $self->{values}->{dynamic_config} ) {
+ # Once dynamic we never change to static, for safety
+ return 0;
}
- $self->{values}->{dynamic_config} = $_[0] ? 1 : 0;
+ $self->{values}->{dynamic_config} = $value ? 1 : 0;
return 1;
}
+# Convenience command
+sub static_config {
+ shift->dynamic_config(0);
+}
+
sub perl_version {
my $self = shift;
return $self->{values}->{perl_version} unless @_;
@@ -170,7 +176,7 @@ sub perl_version {
# Normalize the version
$version = $self->_perl_version($version);
- # We don't support the reall old versions
+ # We don't support the really old versions
unless ( $version >= 5.005 ) {
die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
}
@@ -515,6 +521,7 @@ sub __extract_license {
'GNU Free Documentation license' => 'unrestricted', 1,
'GNU Affero General Public License' => 'open_source', 1,
'(?:Free)?BSD license' => 'bsd', 1,
+ 'Artistic license 2\.0' => 'artistic_2', 1,
'Artistic license' => 'artistic', 1,
'Apache (?:Software )?license' => 'apache', 1,
'GPL' => 'gpl', 1,
@@ -550,9 +557,9 @@ sub license_from {
sub _extract_bugtracker {
my @links = $_[0] =~ m#L<(
- \Qhttp://rt.cpan.org/\E[^>]+|
- \Qhttp://github.com/\E[\w_]+/[\w_]+/issues|
- \Qhttp://code.google.com/p/\E[\w_\-]+/issues/list
+ https?\Q://rt.cpan.org/\E[^>]+|
+ https?\Q://github.com/\E[\w_]+/[\w_]+/issues|
+ https?\Q://code.google.com/p/\E[\w_\-]+/issues/list
)>#gx;
my %links;
@links{@links}=();
@@ -581,7 +588,7 @@ sub bugtracker_from {
sub requires_from {
my $self = shift;
my $content = Module::Install::_readperl($_[0]);
- my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
+ my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg;
while ( @requires ) {
my $module = shift @requires;
my $version = shift @requires;
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index d8ab04c..73b9cda 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.28';
+our $VERSION = '0.29';
use FindBin;
use File::Glob ();
@@ -186,8 +186,46 @@ sub RTxInit {
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;
+
+ 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";
+ }
+}
+
1;
__END__
-#line 304
+#line 348
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index edc18b4..99d9631 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.00';
+ $VERSION = '1.04';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index d0f6599..86bb25e 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.00';
+ $VERSION = '1.04';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list