Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

convert to Dist::Zilla

  • Loading branch information...
commit da2b4621d15f0c6295693ff69e47677dd620e393 1 parent 99619c8
@haarg haarg authored
Showing with 260 additions and 127 deletions.
  1. +1 −0  .gitignore
  2. +0 −54 Build.PL
  3. +2 −0  Changes
  4. +1 −1  MANIFEST.SKIP
  5. +66 −0 dist.ini
  6. +189 −0 inc/Dist/Zilla/Plugin/WGDev.pm
  7. +1 −2  lib/WGDev.pm
  8. +0 −2  lib/WGDev/Asset.pm
  9. +0 −2  lib/WGDev/Command.pm
  10. +0 −2  lib/WGDev/Command/Base.pm
  11. +0 −2  lib/WGDev/Command/Base/Verbosity.pm
  12. +0 −2  lib/WGDev/Command/Build.pm
  13. +0 −2  lib/WGDev/Command/Commands.pm
  14. +0 −2  lib/WGDev/Command/Config.pm
  15. +0 −2  lib/WGDev/Command/Db.pm
  16. +0 −2  lib/WGDev/Command/Dist.pm
  17. +0 −2  lib/WGDev/Command/Edit.pm
  18. +0 −2  lib/WGDev/Command/Export.pm
  19. +0 −2  lib/WGDev/Command/Export/Branch.pm
  20. +0 −2  lib/WGDev/Command/For/Each.pm
  21. +0 −2  lib/WGDev/Command/Group.pm
  22. +0 −2  lib/WGDev/Command/Guid.pm
  23. +0 −2  lib/WGDev/Command/Help.pm
  24. +0 −2  lib/WGDev/Command/Import.pm
  25. +0 −2  lib/WGDev/Command/Intro.pm
  26. +0 −2  lib/WGDev/Command/Ls.pm
  27. +0 −2  lib/WGDev/Command/Mail.pm
  28. +0 −2  lib/WGDev/Command/Optimize.pm
  29. +0 −2  lib/WGDev/Command/Package.pm
  30. +0 −2  lib/WGDev/Command/Reset.pm
  31. +0 −2  lib/WGDev/Command/Run.pm
  32. +0 −2  lib/WGDev/Command/Self/Upgrade.pm
  33. +0 −2  lib/WGDev/Command/Setting.pm
  34. +0 −2  lib/WGDev/Command/Test.pm
  35. +0 −2  lib/WGDev/Command/User.pm
  36. +0 −2  lib/WGDev/Command/Util.pm
  37. +0 −2  lib/WGDev/Command/Version.pm
  38. +0 −2  lib/WGDev/Database.pm
  39. +0 −2  lib/WGDev/Help.pm
  40. +0 −2  lib/WGDev/Pod/Usage.pm
  41. +0 −2  lib/WGDev/Version.pm
  42. +0 −2  lib/WGDev/X.pm
  43. 0  t/01_perlcritic.at → xt/release/perlcritic.t
View
1  .gitignore
@@ -12,3 +12,4 @@
/pm_to_blib
/wgd
/pod2htm*.tmp
+/.build
View
54 Build.PL
@@ -1,54 +0,0 @@
-use lib 'inc';
-use WGDev::Builder;
-my $build = WGDev::Builder->new(
- module_name => 'WGDev',
- license => 'perl',
- dynamic_config => 0,
- create_license => 1,
- create_makefile_pl => 'traditional',
- sign => 1,
- meta_merge => {
- resources => {
- bugtracker => 'http://github.com/haarg/wgdev/issues',
- repository => 'http://github.com/haarg/wgdev/tree',
- WebGUI => 'http://www.webgui.org/',
- },
- },
- requires => {
- 'perl' => '5.8.8',
- 'App::Prove' => 0,
- 'Config::JSON' => 0,
- 'Cwd' => 0,
- 'DBI' => 0,
- 'File::Copy' => 0,
- 'File::Find' => 0,
- 'File::Path' => 0,
- 'File::Spec' => 0,
- 'File::Temp' => 0.19,
- 'Getopt::Long' => 0,
- 'JSON' => '2.00',
- 'Pod::Html' => 0,
- 'Pod::Perldoc' => 0,
- 'Pod::Usage' => 0,
- 'Text::ParseWords' => 0,
- 'version' => 0,
- 'Exception::Class' => 0,
- 'Try::Tiny' => 0,
- },
-
- build_requires => {
- # for tests only
- 'Scope::Guard' => 0,
- 'Test::Builder::Module' => 0,
- 'Test::Exception' => 0,
- 'Test::MockObject::Extends' => 0,
- 'Test::MockObject' => 0,
- 'Test::More' => 0,
- 'Test::NoWarnings' => 0,
- 'Test::Warn' => 0,
- },
-
- recommends => { 'Term::ANSIColor' => 0, },
-);
-$build->create_build_script;
-
View
2  Changes
@@ -1,5 +1,7 @@
Change log for WGDev
+{{$NEXT}}
+
0.8.0 - Sep 01 2010
- self-upgrade no longer needs a WebGUI root
- Fix edit command for WebGUI 8
View
2  MANIFEST.SKIP
@@ -54,7 +54,7 @@
# Avoid archives of this distribution
\bWGDev-v?[\d\.\_]+
\bwgd-v?[\d\.\_]+
-\bwgd$
+^wgd$
# Don't include upgrade command in dist
^lib/WebGUI/Command/Self/Upgrade\.pm$
View
66 dist.ini
@@ -0,0 +1,66 @@
+name = WGDev
+version = 0.008
+author = Graham Knop <haarg@haarg.org>
+license = Perl_5
+copyright_holder = Graham Knop
+
+[GatherDir]
+[PruneCruft]
+[ManifestSkip]
+[MetaYAML]
+[License]
+[PkgVersion]
+[PodVersion]
+[PodCoverageTests]
+[PodSyntaxTests]
+[ExtraTests]
+[MakeMaker]
+[Manifest]
+[ExecDir]
+
+[Prereq]
+perl = 5.8.8
+App::Prove = 0
+Config::JSON = 0
+Cwd = 0
+DBI = 0
+File::Copy = 0
+File::Find = 0
+File::Path = 0
+File::Spec = 0
+File::Temp = 0.19
+Getopt::Long = 0
+JSON = 2.00
+Pod::Html = 0
+Pod::Perldoc = 0
+Pod::Usage = 0
+Text::ParseWords = 0
+version = 0
+Exception::Class = 0
+
+[Prereq / TestRequires]
+Scope::Guard = 0
+Test::Builder::Module = 0
+Test::Exception = 0
+Test::MockObject::Extends = 0
+Test::MockObject = 0
+Test::More = 0
+Test::NoWarnings = 0
+Test::Warn = 0
+
+[Prereq / RuntimeRecommends]
+Term::ANSIColor = 0
+
+[MetaResources]
+bugtracker.web = http://github.com/haarg/wgdev/issues
+repository.url = git://github.com/haarg/wgdev.git
+repository.web = http://github.com/haarg/wgdev
+repository.type = git
+
+[NextRelease]
+format = %-9v %{MMM dd yyyy}d
+
+[PruneFiles]
+filenames = dist.ini
+
+[=inc::Dist::Zilla::Plugin::WGDev]
View
189 inc/Dist/Zilla/Plugin/WGDev.pm
@@ -0,0 +1,189 @@
+package Dist::Zilla::Plugin::WGDev;
+use Moose;
+use namespace::autoclean;
+with 'Dist::Zilla::Role::BeforeArchive';
+with 'Dist::Zilla::Role::FileMunger';
+use Path::Class::Dir ();
+use Path::Class::File ();
+use File::Temp ();
+use File::Copy::Recursive qw(dircopy);
+use File::Spec::Functions qw(catdir);
+use Cwd qw(cwd);
+
+sub munge_file {
+ my $self = shift;
+ my $file = shift;
+ if ( $file->content !~ /\n$/ ) {
+ $file->content($file->content . "\n");
+ }
+}
+
+sub before_archive {
+ my $self = shift;
+ my $build_root = $self->zilla->ensure_built;
+
+ my $pack_temp = File::Temp->newdir;
+ my $pack_root = Path::Class::Dir->new($pack_temp->dirname);
+
+ dircopy(
+ $build_root->subdir('lib')->stringify,
+ $pack_root->subdir('lib')->stringify,
+ );
+
+ $self->regenerate_fatlib($pack_root);
+
+ my $dist_script = $self->zilla->root->file('wgd');
+ $dist_script->remove;
+ my $out_fh = $dist_script->openw;
+
+ print { $out_fh } <<'END_HEADER';
+#!/usr/bin/env perl
+
+END_HEADER
+
+ my $cwd = cwd;
+ chdir $pack_root;
+
+ open my $fh, '-|', 'fatpack', 'file'
+ or die "Can't run fatpack: $!";
+ while ( my $line = <$fh> ) {
+ # hack so we can extract the list later
+ $line =~ s/\bmy %fatpacked\b/our %fatpacked/;
+ print { $out_fh } $line;
+ }
+ close $fh;
+ chdir $cwd;
+ $fh = $build_root->file('bin', 'wgd')->openr;
+ while ( my $line = <$fh> ) {
+ print { $out_fh } $line;
+ }
+ close $fh;
+ close $out_fh;
+ chmod oct(755), $dist_script;
+}
+
+my %wg_deps = map { $_ => 1 } qw(
+ Apache2::Request
+ Archive::Tar
+ Archive::Zip
+ Class::InsideOut
+ Color::Calc
+ Compress::Zlib
+ Config::JSON
+ DBD::mysql
+ DBI
+ Data::Structure::Util
+ DateTime
+ DateTime::Format::Mail
+ DateTime::Format::Strptime
+ Digest::MD5
+ Finance::Quote
+ HTML::Highlight
+ HTML::Parser
+ HTML::TagCloud
+ HTML::TagFilter
+ HTML::Template
+ HTML::Template::Expr
+ HTTP::Headers
+ HTTP::Request
+ IO::Zlib
+ Image::Magick
+ JSON
+ LWP
+ List::Util
+ Locale::US
+ Log::Log4perl
+ MIME::Tools
+ Net::LDAP
+ Net::POP3
+ Net::SMTP
+ Net::Subnets
+ POE
+ POE::Component::Client::HTTP
+ POE::Component::IKC::Server
+ POSIX
+ Parse::PlainConfig
+ Pod::Coverage
+ SOAP::Lite
+ Test::Deep
+ Test::MockObject
+ Test::More
+ Text::Aspell
+ Text::Balanced
+ Text::CSV_XS
+ Tie::CPHash
+ Tie::IxHash
+ Time::HiRes
+ URI::Escape
+ Weather::Com::Finder
+ XML::RSSLite
+ XML::Simple
+);
+
+sub regenerate_fatlib {
+ my $self = shift;
+ my $pack_root = shift;
+
+ $pack_root->subdir('fatlib')->rmtree;
+ my $temp_script = File::Temp->new(UNLINK => 0);
+ my @deps = $self->zilla->prereqs->requirements_for('runtime', 'requires')->required_modules;
+ for my $module ( @deps ) {
+ if ($module eq 'perl') {
+ }
+ elsif ( $wg_deps{$module} ) {
+ }
+ else {
+ print {$temp_script} "use $module ();\n";
+ }
+ }
+ $temp_script->flush;
+ my (undef, $trace_file) = do { local $^W; File::Temp::tempfile(OPEN => 0) };
+ open my $oldout, '>&', \*STDOUT;
+ open my $olderr, '>&', \*STDERR;
+ open STDOUT, '>', File::Spec->devnull;
+ open STDERR, '>', File::Spec->devnull;
+ system 'fatpack', 'trace', '--to=' . $trace_file, $temp_script;
+ open STDOUT, '>&=', $oldout;
+ open STDERR, '>&=', $olderr;
+ open my $trace_fh, '<', $trace_file;
+ my @modules = <$trace_fh>;
+ close $trace_fh;
+ unlink $trace_file;
+ chomp @modules;
+ @modules = grep { /\.pm$/ } @modules;
+ open my $pack_fh, '-|', 'fatpack', 'packlists-for', @modules;
+ my @packlists = <$pack_fh>;
+ chomp @packlists;
+ my $cwd = cwd;
+ chdir $pack_root;
+ system 'fatpack', 'tree', @packlists;
+ chdir $cwd;
+ require Config;
+ $pack_root->subdir('fatlib', $Config::Config{archname})->rmtree;
+ $pack_root->subdir('fatlib')->recurse( callback => sub {
+ my $item = shift;
+ if (! $item->is_dir) {
+ if ( $item =~ /\.pm$/ ) {
+ my $fh = $item->open('+<');
+ seek $fh, -1, 2;
+ read $fh, my $last_char, 1;
+ if ($last_char !~ /\n/) {
+ print {$fh} "\n";
+ }
+ close $fh;
+ }
+ else {
+ $item->remove;
+ }
+ }
+ });
+}
+
+__PACKAGE__->meta->make_immutable;
+package inc::Dist::Zilla::Plugin::WGDev;
+use Moose;
+extends 'Dist::Zilla::Plugin::WGDev';
+__PACKAGE__->meta->make_immutable;
+
+1;
+
View
3  lib/WGDev.pm
@@ -1,10 +1,9 @@
package WGDev;
+# ABSTRACT: WebGUI Developer Utilities
use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.8.0';
-
use File::Spec ();
use Cwd ();
use WGDev::X ();
View
2  lib/WGDev/Asset.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.0.1';
-
use constant LINE_LENGTH => 78;
use WGDev;
View
2  lib/WGDev/Command.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.8.0';
-
use Getopt::Long ();
use File::Spec ();
use Cwd ();
View
2  lib/WGDev/Command/Base.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.8.0';
-
use WGDev::X ();
sub is_runnable {
View
2  lib/WGDev/Command/Base/Verbosity.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.2.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Build.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.2.0';
-
use WGDev::Command::Base::Verbosity;
BEGIN { our @ISA = qw(WGDev::Command::Base::Verbosity) }
View
2  lib/WGDev/Command/Commands.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.0.1';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Config.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.1.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Db.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.2.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Dist.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.1.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Edit.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.2.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Export.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.2.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Export/Branch.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.0.1';
-
use WGDev::Command::Base::Verbosity;
BEGIN { our @ISA = qw(WGDev::Command::Base::Verbosity) }
View
2  lib/WGDev/Command/For/Each.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.0.2';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Group.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.2.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Guid.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.2.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Help.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.2.0';
-
use WGDev::Command::Base ();
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Import.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.1.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Intro.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.0.2';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Ls.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.1.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Mail.pm
@@ -4,8 +4,6 @@ use warnings;
use 5.008008;
use Carp;
-our $VERSION = '0.2.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Optimize.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.2.0';
-
use WGDev::Command::Base::Verbosity;
BEGIN { our @ISA = qw(WGDev::Command::Base::Verbosity) }
View
2  lib/WGDev/Command/Package.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.3.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Reset.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.3.0';
-
use WGDev::Command::Base::Verbosity;
BEGIN { our @ISA = qw(WGDev::Command::Base::Verbosity) }
View
2  lib/WGDev/Command/Run.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.0.1';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Self/Upgrade.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.0.1';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
use WGDev::X;
View
2  lib/WGDev/Command/Setting.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.2.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Test.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.1.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/User.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.2.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Command/Util.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.1.0';
-
use WGDev::Command::Base::Verbosity;
BEGIN { our @ISA = qw(WGDev::Command::Base::Verbosity) }
View
2  lib/WGDev/Command/Version.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.2.0';
-
use WGDev::Command::Base;
BEGIN { our @ISA = qw(WGDev::Command::Base) }
View
2  lib/WGDev/Database.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.0.1';
-
use WGDev::X ();
sub username { return shift->{username} }
View
2  lib/WGDev/Help.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.1.0';
-
use WGDev::X ();
use File::Spec ();
View
2  lib/WGDev/Pod/Usage.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.0.1';
-
use constant OPTION_INDENT => 4;
use constant OPTION_TEXT_INDENT => 24;
View
2  lib/WGDev/Version.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.1.0';
-
use File::Spec;
use WGDev::X ();
View
2  lib/WGDev/X.pm
@@ -3,8 +3,6 @@ use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.0.1';
-
use Exception::Class (
'WGDev::X' => { description => 'A general WGDev error', },
'WGDev::X::CommandLine' => {
View
0  t/01_perlcritic.at → xt/release/perlcritic.t
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.