Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 5 commits
  • 21 files changed
  • 0 commit comments
  • 3 contributors
Commits on Apr 05, 2012
Geoffrey Broadwell Proof of concept Dist::Zilla::Plugin::Git::GatherDir
It is based almost entirely on the original Dist::Zilla::Plugin::GatherDir,
tweaked to use 'git ls-files' via Git::Wrapper instead of searching with
File::Find::Rule
504386f
@rjbs rjbs tests for Git::GatherDir dafe876
Commits on Apr 06, 2012
@jquelin fix pod coverage d23c576
@jquelin v1.120970
 - new plugin GatherDir (geoffrey broadwell, ricardo signes)
bd3e36b
@jquelin Build results of bd3e36b (on master) 3f6fee7
View
9 Build.PL
@@ -16,7 +16,7 @@ my %module_build_args = (
"File::Which" => 0,
"File::pushd" => 0,
"Module::Build" => "0.3601",
- "Path::Class" => 0,
+ "Test::DZil" => 0,
"Test::Exception" => 0,
"Test::More" => "0.88"
},
@@ -28,7 +28,7 @@ my %module_build_args = (
"Jerome Quelin"
],
"dist_name" => "Dist-Zilla-Plugin-Git",
- "dist_version" => "1.120860",
+ "dist_version" => "1.120970",
"license" => "perl",
"module_name" => "Dist::Zilla::Plugin::Git",
"recommends" => {},
@@ -42,8 +42,11 @@ my %module_build_args = (
"Dist::Zilla::Role::AfterMint" => 0,
"Dist::Zilla::Role::AfterRelease" => 0,
"Dist::Zilla::Role::BeforeRelease" => 0,
+ "Dist::Zilla::Role::FileGatherer" => 0,
"Dist::Zilla::Role::PluginBundle" => 0,
"Dist::Zilla::Role::VersionProvider" => 0,
+ "File::HomeDir" => 0,
+ "File::Spec" => 0,
"File::Spec::Functions" => 0,
"File::Temp" => 0,
"File::chdir" => 0,
@@ -56,6 +59,8 @@ my %module_build_args = (
"MooseX::AttributeShortcuts" => 0,
"MooseX::Has::Sugar" => 0,
"MooseX::Types::Moose" => 0,
+ "MooseX::Types::Path::Class" => 0,
+ "Path::Class" => 0,
"Path::Class::Dir" => 0,
"String::Formatter" => 0,
"Version::Next" => 0,
View
3  Changes
@@ -1,5 +1,8 @@
Revision history for Dist::Zilla::Plugin::Git
+1.120970 2012-04-06 08:56:03 Europe/Paris
+ - new plugin GatherDir (geoffrey broadwell, ricardo signes)
+
1.120860 2012-03-26 12:18:38 Europe/Paris
- fix tag-signed.t test on windows (olivier mengué)
View
3  MANIFEST
@@ -20,6 +20,7 @@ corpus/commit/Changes
corpus/commit/dist.ini
corpus/dzp-git.pub
corpus/dzp-git.sec
+corpus/gatherdir/lib/DZT/Sample.pm
corpus/push-multi/Changes
corpus/push-multi/dist.ini
corpus/push/Changes
@@ -41,6 +42,7 @@ lib/Dist/Zilla/Plugin/Git.pm
lib/Dist/Zilla/Plugin/Git/Check.pm
lib/Dist/Zilla/Plugin/Git/Commit.pm
lib/Dist/Zilla/Plugin/Git/CommitBuild.pm
+lib/Dist/Zilla/Plugin/Git/GatherDir.pm
lib/Dist/Zilla/Plugin/Git/Init.pm
lib/Dist/Zilla/Plugin/Git/NextVersion.pm
lib/Dist/Zilla/Plugin/Git/Push.pm
@@ -56,6 +58,7 @@ t/commit-build.t
t/commit-dirtydir.t
t/commit-ws.t
t/commit.t
+t/gatherdir.t
t/lib/Dist/Zilla/Plugin/MyTestArchiver.pm
t/push-multi.t
t/push.t
View
35 META.json
@@ -34,8 +34,11 @@
"Dist::Zilla::Role::AfterMint" : "0",
"Dist::Zilla::Role::AfterRelease" : "0",
"Dist::Zilla::Role::BeforeRelease" : "0",
+ "Dist::Zilla::Role::FileGatherer" : "0",
"Dist::Zilla::Role::PluginBundle" : "0",
"Dist::Zilla::Role::VersionProvider" : "0",
+ "File::HomeDir" : "0",
+ "File::Spec" : "0",
"File::Spec::Functions" : "0",
"File::Temp" : "0",
"File::chdir" : "0",
@@ -48,6 +51,8 @@
"MooseX::AttributeShortcuts" : "0",
"MooseX::Has::Sugar" : "0",
"MooseX::Types::Moose" : "0",
+ "MooseX::Types::Path::Class" : "0",
+ "Path::Class" : "0",
"Path::Class::Dir" : "0",
"String::Formatter" : "0",
"Version::Next" : "0",
@@ -68,7 +73,7 @@
"File::Path" : "0",
"File::Which" : "0",
"File::pushd" : "0",
- "Path::Class" : "0",
+ "Test::DZil" : "0",
"Test::Exception" : "0",
"Test::More" : "0.88"
}
@@ -77,47 +82,51 @@
"provides" : {
"Dist::Zilla::Plugin::Git" : {
"file" : "lib/Dist/Zilla/Plugin/Git.pm",
- "version" : "1.120860"
+ "version" : "1.120970"
},
"Dist::Zilla::Plugin::Git::Check" : {
"file" : "lib/Dist/Zilla/Plugin/Git/Check.pm",
- "version" : "1.120860"
+ "version" : "1.120970"
},
"Dist::Zilla::Plugin::Git::Commit" : {
"file" : "lib/Dist/Zilla/Plugin/Git/Commit.pm",
- "version" : "1.120860"
+ "version" : "1.120970"
},
"Dist::Zilla::Plugin::Git::CommitBuild" : {
"file" : "lib/Dist/Zilla/Plugin/Git/CommitBuild.pm",
- "version" : "1.120860"
+ "version" : "1.120970"
+ },
+ "Dist::Zilla::Plugin::Git::GatherDir" : {
+ "file" : "lib/Dist/Zilla/Plugin/Git/GatherDir.pm",
+ "version" : "1.120970"
},
"Dist::Zilla::Plugin::Git::Init" : {
"file" : "lib/Dist/Zilla/Plugin/Git/Init.pm",
- "version" : "1.120860"
+ "version" : "1.120970"
},
"Dist::Zilla::Plugin::Git::NextVersion" : {
"file" : "lib/Dist/Zilla/Plugin/Git/NextVersion.pm",
- "version" : "1.120860"
+ "version" : "1.120970"
},
"Dist::Zilla::Plugin::Git::Push" : {
"file" : "lib/Dist/Zilla/Plugin/Git/Push.pm",
- "version" : "1.120860"
+ "version" : "1.120970"
},
"Dist::Zilla::Plugin::Git::Tag" : {
"file" : "lib/Dist/Zilla/Plugin/Git/Tag.pm",
- "version" : "1.120860"
+ "version" : "1.120970"
},
"Dist::Zilla::PluginBundle::Git" : {
"file" : "lib/Dist/Zilla/PluginBundle/Git.pm",
- "version" : "1.120860"
+ "version" : "1.120970"
},
"Dist::Zilla::Role::Git::DirtyFiles" : {
"file" : "lib/Dist/Zilla/Role/Git/DirtyFiles.pm",
- "version" : "1.120860"
+ "version" : "1.120970"
},
"Dist::Zilla::Role::Git::Repo" : {
"file" : "lib/Dist/Zilla/Role/Git/Repo.pm",
- "version" : "1.120860"
+ "version" : "1.120970"
}
},
"release_status" : "stable",
@@ -134,7 +143,7 @@
},
"x_MailingList" : "http://www.listbox.com/subscribe/?list_id=139292"
},
- "version" : "1.120860",
+ "version" : "1.120970",
"x_Dist_Zilla" : {
"plugins" : [
{
View
34 META.yml
@@ -12,7 +12,7 @@ build_requires:
File::Which: 0
File::pushd: 0
Module::Build: 0.3601
- Path::Class: 0
+ Test::DZil: 0
Test::Exception: 0
Test::More: 0.88
configure_requires:
@@ -27,37 +27,40 @@ name: Dist-Zilla-Plugin-Git
provides:
Dist::Zilla::Plugin::Git:
file: lib/Dist/Zilla/Plugin/Git.pm
- version: 1.120860
+ version: 1.120970
Dist::Zilla::Plugin::Git::Check:
file: lib/Dist/Zilla/Plugin/Git/Check.pm
- version: 1.120860
+ version: 1.120970
Dist::Zilla::Plugin::Git::Commit:
file: lib/Dist/Zilla/Plugin/Git/Commit.pm
- version: 1.120860
+ version: 1.120970
Dist::Zilla::Plugin::Git::CommitBuild:
file: lib/Dist/Zilla/Plugin/Git/CommitBuild.pm
- version: 1.120860
+ version: 1.120970
+ Dist::Zilla::Plugin::Git::GatherDir:
+ file: lib/Dist/Zilla/Plugin/Git/GatherDir.pm
+ version: 1.120970
Dist::Zilla::Plugin::Git::Init:
file: lib/Dist/Zilla/Plugin/Git/Init.pm
- version: 1.120860
+ version: 1.120970
Dist::Zilla::Plugin::Git::NextVersion:
file: lib/Dist/Zilla/Plugin/Git/NextVersion.pm
- version: 1.120860
+ version: 1.120970
Dist::Zilla::Plugin::Git::Push:
file: lib/Dist/Zilla/Plugin/Git/Push.pm
- version: 1.120860
+ version: 1.120970
Dist::Zilla::Plugin::Git::Tag:
file: lib/Dist/Zilla/Plugin/Git/Tag.pm
- version: 1.120860
+ version: 1.120970
Dist::Zilla::PluginBundle::Git:
file: lib/Dist/Zilla/PluginBundle/Git.pm
- version: 1.120860
+ version: 1.120970
Dist::Zilla::Role::Git::DirtyFiles:
file: lib/Dist/Zilla/Role/Git/DirtyFiles.pm
- version: 1.120860
+ version: 1.120970
Dist::Zilla::Role::Git::Repo:
file: lib/Dist/Zilla/Role/Git/Repo.pm
- version: 1.120860
+ version: 1.120970
requires:
Class::MOP: 0
Cwd: 0
@@ -67,8 +70,11 @@ requires:
Dist::Zilla::Role::AfterMint: 0
Dist::Zilla::Role::AfterRelease: 0
Dist::Zilla::Role::BeforeRelease: 0
+ Dist::Zilla::Role::FileGatherer: 0
Dist::Zilla::Role::PluginBundle: 0
Dist::Zilla::Role::VersionProvider: 0
+ File::HomeDir: 0
+ File::Spec: 0
File::Spec::Functions: 0
File::Temp: 0
File::chdir: 0
@@ -81,6 +87,8 @@ requires:
MooseX::AttributeShortcuts: 0
MooseX::Has::Sugar: 0
MooseX::Types::Moose: 0
+ MooseX::Types::Path::Class: 0
+ Path::Class: 0
Path::Class::Dir: 0
String::Formatter: 0
Version::Next: 0
@@ -94,7 +102,7 @@ resources:
homepage: http://search.cpan.org/dist/Dist-Zilla-Plugin-Git/
repository: git://github.com/jquelin/dist-zilla-plugin-git.git
x_MailingList: http://www.listbox.com/subscribe/?list_id=139292
-version: 1.120860
+version: 1.120970
x_Dist_Zilla:
plugins:
-
View
2  README
@@ -1,7 +1,7 @@
This archive contains the distribution Dist-Zilla-Plugin-Git,
-version 1.120860:
+version 1.120970:
update your git repository after release
View
11 corpus/gatherdir/lib/DZT/Sample.pm
@@ -0,0 +1,11 @@
+#
+# This file is part of Dist-Zilla-Plugin-Git
+#
+# This software is copyright (c) 2009 by Jerome Quelin.
+#
+# This is free software; you can redistribute it and/or modify it under
+# the same terms as the Perl 5 programming language system itself.
+#
+package
+ DZT::Sample;
+1;
View
4 lib/Dist/Zilla/Plugin/Git.pm
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Plugin::Git;
{
- $Dist::Zilla::Plugin::Git::VERSION = '1.120860';
+ $Dist::Zilla::Plugin::Git::VERSION = '1.120970';
}
# ABSTRACT: update your git repository after release
@@ -28,7 +28,7 @@ Dist::Zilla::Plugin::Git - update your git repository after release
=head1 VERSION
-version 1.120860
+version 1.120970
=head1 DESCRIPTION
View
4 lib/Dist/Zilla/Plugin/Git/Check.pm
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Plugin::Git::Check;
{
- $Dist::Zilla::Plugin::Git::Check::VERSION = '1.120860';
+ $Dist::Zilla::Plugin::Git::Check::VERSION = '1.120970';
}
# ABSTRACT: check your git repository before releasing
@@ -80,7 +80,7 @@ Dist::Zilla::Plugin::Git::Check - check your git repository before releasing
=head1 VERSION
-version 1.120860
+version 1.120970
=head1 SYNOPSIS
View
4 lib/Dist/Zilla/Plugin/Git/Commit.pm
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Plugin::Git::Commit;
{
- $Dist::Zilla::Plugin::Git::Commit::VERSION = '1.120860';
+ $Dist::Zilla::Plugin::Git::Commit::VERSION = '1.120970';
}
# ABSTRACT: commit dirty files
@@ -131,7 +131,7 @@ Dist::Zilla::Plugin::Git::Commit - commit dirty files
=head1 VERSION
-version 1.120860
+version 1.120970
=head1 SYNOPSIS
View
4 lib/Dist/Zilla/Plugin/Git/CommitBuild.pm
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Plugin::Git::CommitBuild;
{
- $Dist::Zilla::Plugin::Git::CommitBuild::VERSION = '1.120860';
+ $Dist::Zilla::Plugin::Git::CommitBuild::VERSION = '1.120970';
}
# ABSTRACT: checkin build results on separate branch
@@ -149,7 +149,7 @@ Dist::Zilla::Plugin::Git::CommitBuild - checkin build results on separate branch
=head1 VERSION
-version 1.120860
+version 1.120970
=head1 SYNOPSIS
View
168 lib/Dist/Zilla/Plugin/Git/GatherDir.pm
@@ -0,0 +1,168 @@
+#
+# This file is part of Dist-Zilla-Plugin-Git
+#
+# This software is copyright (c) 2009 by Jerome Quelin.
+#
+# This is free software; you can redistribute it and/or modify it under
+# the same terms as the Perl 5 programming language system itself.
+#
+package Dist::Zilla::Plugin::Git::GatherDir;
+{
+ $Dist::Zilla::Plugin::Git::GatherDir::VERSION = '1.120970';
+}
+# ABSTRACT: gather all tracked files in a Git working directory
+use Moose;
+use Moose::Autobox;
+use MooseX::Types::Path::Class qw(Dir File);
+with 'Dist::Zilla::Role::FileGatherer';
+
+
+use Git::Wrapper;
+use File::HomeDir;
+use File::Spec;
+use Path::Class;
+
+use namespace::autoclean;
+
+
+has root => (
+ is => 'ro',
+ isa => Dir,
+ lazy => 1,
+ coerce => 1,
+ required => 1,
+ default => sub { shift->zilla->root },
+);
+
+
+has prefix => (
+ is => 'ro',
+ isa => 'Str',
+ default => '',
+);
+
+
+has include_dotfiles => (
+ is => 'ro',
+ isa => 'Bool',
+ default => 0,
+);
+
+sub gather_files {
+ my ($self) = @_;
+
+ my $root = "" . $self->root;
+ $root =~ s{^~([\\/])}{File::HomeDir->my_home . $1}e;
+ $root = Path::Class::dir($root);
+
+ my $git = Git::Wrapper->new($root);
+
+ my @files;
+ FILE: for my $filename ($git->ls_files) {
+ unless ($self->include_dotfiles) {
+ my $file = file($filename)->relative($root);
+ next FILE if $file->basename =~ qr/^\./;
+ next FILE if grep { /^\.[^.]/ } $file->dir->dir_list;
+ }
+
+ push @files, $self->_file_from_filename($filename);
+ }
+
+ for my $file (@files) {
+ (my $newname = $file->name) =~ s{\A\Q$root\E[\\/]}{}g;
+ $newname = File::Spec->catdir($self->prefix, $newname) if $self->prefix;
+ $newname = Path::Class::dir($newname)->as_foreign('Unix')->stringify;
+
+ $file->name($newname);
+ $self->add_file($file);
+ }
+
+ return;
+}
+
+sub _file_from_filename {
+ my ($self, $filename) = @_;
+
+ return Dist::Zilla::File::OnDisk->new({
+ name => $filename,
+ mode => (stat $filename)[2] & 0755, # kill world-writeability
+ });
+}
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+1;
+
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Plugin::Git::GatherDir - gather all tracked files in a Git working directory
+
+=head1 VERSION
+
+version 1.120970
+
+=head1 DESCRIPTION
+
+This is a trivial variant of the L<GatherDir|Dist::Zilla::Plugin::GatherDir>
+plugin. It looks in the directory named in the L</root> attribute and adds all
+the Git tracked files it finds there (as determined by C<git ls-files>). If the
+root begins with a tilde, the tilde is replaced with the current user's home
+directory according to L<File::HomeDir>.
+
+Most users just need:
+
+ [Git::GatherDir]
+
+...and this will pick up all tracked files from the current directory into the
+dist. You can use it multiple times, as you can any other plugin, by providing
+a plugin name. For example, if you want to include external specification
+files into a subdir of your dist, you might write:
+
+ [Git::GatherDir]
+ ; this plugin needs no config and gathers most of your files
+
+ [Git::GatherDir / SpecFiles]
+ ; this plugin gets all tracked files in the root dir and adds them under ./spec
+ root = ~/projects/my-project/spec
+ prefix = spec
+
+=head1 ATTRIBUTES
+
+=head2 root
+
+This is the directory in which to look for files. If not given, it defaults to
+the dist root -- generally, the place where your F<dist.ini> or other
+configuration file is located.
+
+=head2 prefix
+
+This parameter can be set to gather all the files found under a common
+directory. See the L<description|DESCRIPTION> above for an example.
+
+=head2 include_dotfiles
+
+By default, files will not be included if they begin with a dot. This goes
+both for files and for directories relative to the C<root>.
+
+In almost all cases, the default value (false) is correct.
+
+=for Pod::Coverage gather_dir
+ gather_files
+
+=head1 AUTHOR
+
+Jerome Quelin
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2009 by Jerome Quelin.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
View
4 lib/Dist/Zilla/Plugin/Git/Init.pm
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Plugin::Git::Init;
{
- $Dist::Zilla::Plugin::Git::Init::VERSION = '1.120860';
+ $Dist::Zilla::Plugin::Git::Init::VERSION = '1.120970';
}
# ABSTRACT: initialize git repository on dzil new
@@ -88,7 +88,7 @@ Dist::Zilla::Plugin::Git::Init - initialize git repository on dzil new
=head1 VERSION
-version 1.120860
+version 1.120970
=head1 SYNOPSIS
View
4 lib/Dist/Zilla/Plugin/Git/NextVersion.pm
@@ -11,7 +11,7 @@ use warnings;
package Dist::Zilla::Plugin::Git::NextVersion;
{
- $Dist::Zilla::Plugin::Git::NextVersion::VERSION = '1.120860';
+ $Dist::Zilla::Plugin::Git::NextVersion::VERSION = '1.120970';
}
# ABSTRACT: provide a version number by bumping the last git release tag
@@ -99,7 +99,7 @@ Dist::Zilla::Plugin::Git::NextVersion - provide a version number by bumping the
=head1 VERSION
-version 1.120860
+version 1.120970
=head1 SYNOPSIS
View
4 lib/Dist/Zilla/Plugin/Git/Push.pm
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Plugin::Git::Push;
{
- $Dist::Zilla::Plugin::Git::Push::VERSION = '1.120860';
+ $Dist::Zilla::Plugin::Git::Push::VERSION = '1.120970';
}
# ABSTRACT: push current branch
@@ -60,7 +60,7 @@ Dist::Zilla::Plugin::Git::Push - push current branch
=head1 VERSION
-version 1.120860
+version 1.120970
=head1 SYNOPSIS
View
4 lib/Dist/Zilla/Plugin/Git/Tag.pm
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Plugin::Git::Tag;
{
- $Dist::Zilla::Plugin::Git::Tag::VERSION = '1.120860';
+ $Dist::Zilla::Plugin::Git::Tag::VERSION = '1.120970';
}
# ABSTRACT: tag the new version
@@ -99,7 +99,7 @@ Dist::Zilla::Plugin::Git::Tag - tag the new version
=head1 VERSION
-version 1.120860
+version 1.120970
=head1 SYNOPSIS
View
4 lib/Dist/Zilla/PluginBundle/Git.pm
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::PluginBundle::Git;
{
- $Dist::Zilla::PluginBundle::Git::VERSION = '1.120860';
+ $Dist::Zilla::PluginBundle::Git::VERSION = '1.120970';
}
# ABSTRACT: all git plugins in one go
@@ -66,7 +66,7 @@ Dist::Zilla::PluginBundle::Git - all git plugins in one go
=head1 VERSION
-version 1.120860
+version 1.120970
=head1 SYNOPSIS
View
4 lib/Dist/Zilla/Role/Git/DirtyFiles.pm
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Role::Git::DirtyFiles;
{
- $Dist::Zilla::Role::Git::DirtyFiles::VERSION = '1.120860';
+ $Dist::Zilla::Role::Git::DirtyFiles::VERSION = '1.120970';
}
# ABSTRACT: provide the allow_dirty & changelog attributes
@@ -77,7 +77,7 @@ Dist::Zilla::Role::Git::DirtyFiles - provide the allow_dirty & changelog attribu
=head1 VERSION
-version 1.120860
+version 1.120970
=head1 DESCRIPTION
View
4 lib/Dist/Zilla/Role/Git/Repo.pm
@@ -8,7 +8,7 @@
#
package Dist::Zilla::Role::Git::Repo;
{
- $Dist::Zilla::Role::Git::Repo::VERSION = '1.120860';
+ $Dist::Zilla::Role::Git::Repo::VERSION = '1.120970';
}
# ABSTRACT: Provide repository information for Git plugins
@@ -31,7 +31,7 @@ Dist::Zilla::Role::Git::Repo - Provide repository information for Git plugins
=head1 VERSION
-version 1.120860
+version 1.120970
=head1 DESCRIPTION
View
5 t/000-report-versions-tiny.t
@@ -56,6 +56,7 @@ eval { $v .= pmver('Dist::Zilla::Role::AfterBuild','any version') };
eval { $v .= pmver('Dist::Zilla::Role::AfterMint','any version') };
eval { $v .= pmver('Dist::Zilla::Role::AfterRelease','any version') };
eval { $v .= pmver('Dist::Zilla::Role::BeforeRelease','any version') };
+eval { $v .= pmver('Dist::Zilla::Role::FileGatherer','any version') };
eval { $v .= pmver('Dist::Zilla::Role::PluginBundle','any version') };
eval { $v .= pmver('Dist::Zilla::Role::Releaser','any version') };
eval { $v .= pmver('Dist::Zilla::Role::VersionProvider','any version') };
@@ -63,7 +64,9 @@ eval { $v .= pmver('Dist::Zilla::Tester','any version') };
eval { $v .= pmver('File::Copy','any version') };
eval { $v .= pmver('File::Copy::Recursive','any version') };
eval { $v .= pmver('File::Find','any version') };
+eval { $v .= pmver('File::HomeDir','any version') };
eval { $v .= pmver('File::Path','any version') };
+eval { $v .= pmver('File::Spec','any version') };
eval { $v .= pmver('File::Spec::Functions','any version') };
eval { $v .= pmver('File::Temp','any version') };
eval { $v .= pmver('File::Which','any version') };
@@ -79,9 +82,11 @@ eval { $v .= pmver('Moose::Role','any version') };
eval { $v .= pmver('MooseX::AttributeShortcuts','any version') };
eval { $v .= pmver('MooseX::Has::Sugar','any version') };
eval { $v .= pmver('MooseX::Types::Moose','any version') };
+eval { $v .= pmver('MooseX::Types::Path::Class','any version') };
eval { $v .= pmver('Path::Class','any version') };
eval { $v .= pmver('Path::Class::Dir','any version') };
eval { $v .= pmver('String::Formatter','any version') };
+eval { $v .= pmver('Test::DZil','any version') };
eval { $v .= pmver('Test::Exception','any version') };
eval { $v .= pmver('Test::More','0.88') };
eval { $v .= pmver('Version::Next','any version') };
View
70 t/gatherdir.t
@@ -0,0 +1,70 @@
+#!perl
+#
+# This file is part of Dist-Zilla-Plugin-Git
+#
+# This software is copyright (c) 2009 by Jerome Quelin.
+#
+# This is free software; you can redistribute it and/or modify it under
+# the same terms as the Perl 5 programming language system itself.
+#
+
+use strict;
+use warnings;
+
+use Dist::Zilla 1.093250;
+use Test::DZil;
+use File::pushd;
+use File::Temp qw{ tempdir };
+use Git::Wrapper;
+use Path::Class;
+use Test::More tests => 2;
+use Test::Exception;
+
+# Mock HOME to avoid ~/.gitexcludes from causing problems
+$ENV{HOME} = tempdir( CLEANUP => 1 );
+
+for my $test (
+ {
+ config => simple_ini('Git::GatherDir'),
+ files => [ qw(lib/DZT/Sample.pm tracked) ],
+
+ },
+ {
+ config => simple_ini([ 'Git::GatherDir', { include_dotfiles => 1 } ]),
+ files => [ qw(.tracked lib/DZT/Sample.pm tracked) ],
+ },
+) {
+ my $tzil = Builder->from_config(
+ { dist_root => dir('corpus/gatherdir')->absolute },
+ {
+ add_files => {
+ 'source/untracked' => "This is not tracked.\n",
+ 'source/tracked' => "This is tracked.\n",
+ 'source/.tracked' => "This is a tracked dotfile.\n",
+ 'source/.untracked' => "This is an untracked dotfile.\n",
+ 'source/dist.ini' => $test->{config},
+ },
+ },
+ );
+
+ for my $token (pushd( $tzil->tempdir->subdir('source') )) {
+ system "git init" and die "error initializing git repo";
+ }
+
+ my $git = Git::Wrapper->new( $tzil->tempdir->subdir('source') );
+ $git->config( 'user.name' => 'dzp-git test' );
+ $git->config( 'user.email' => 'dzp-git@test' );
+
+ # create initial .gitignore
+ # we cannot ship it in the dist, since PruneCruft plugin would trim it
+ $git->add( { force => 1 }, qw(lib tracked .tracked) );
+ $git->commit( { message=>'ignore file for git' } );
+
+ $tzil->build;
+
+ is_deeply(
+ [ sort map {; $_->name } @{ $tzil->files } ],
+ $test->{files},
+ "the right files were gathered",
+ );
+}

No commit comments for this range

Something went wrong with that request. Please try again.