Skip to content

Commit

Permalink
Added G::Goal::should_output; bugfix in Scope
Browse files Browse the repository at this point in the history
Also:
- Removed unused deps
- Bumped version number to v0.0.11 TRIAL
- Removed some dependencies from Makefile.PL
  • Loading branch information
Chris White committed Feb 28, 2019
1 parent c5e6e72 commit b784d64
Show file tree
Hide file tree
Showing 24 changed files with 90 additions and 64 deletions.
1 change: 0 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,3 @@ for:

# Then, install cpanminus locally so it will be cached.
- which cpanm || (curl -L https://cpanmin.us | perl - App::cpanminus)

6 changes: 6 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Revision history for Data-Hopen

0.000011 2019-02-28
Bugfixes in Scope

0.000010 2019-02-14
Finished removing code now in App::hopen

0.000009 2019-02-13
Renamed from Build::Hopen to Data::Hopen

Expand Down
48 changes: 27 additions & 21 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use File::Spec;

my $VERSION_FROM = File::Spec->catfile(qw(lib Data Hopen.pm));
my $IS_TRIAL = check_trial();
my $secure_perl_path = get_perl_filename();
my @provides = ();

# Check if this is a TRIAL version {{{1
sub check_trial {
Expand All @@ -26,16 +28,18 @@ sub check_trial {
}
return 0;
} #check_trial()

# }}}1
# Module metadata {{{1
my $provides;
eval {
require Module::Metadata;
$provides = Module::Metadata->provides(version => '2', dir => 'lib');
@provides =
(provides => Module::Metadata->provides(version => '2', dir => 'lib'));
# Thanks to https://stackoverflow.com/a/28928985/2877364 by LEONT
# for the suggestion to use Module::Metadata
};
# }}}1

# }}}1
# Get the filename of the Perl interpreter running this. {{{1
# Modified from perlvar.
# The -x test is for cygwin or other systems where $Config{perlpath} has no
Expand All @@ -49,10 +53,9 @@ sub get_perl_filename {
($secure_perl_path =~ m/$Config{_exe}$/i);
}
return $secure_perl_path;
} # get_perl_filename() }}}1

my $secure_perl_path = get_perl_filename();
} # get_perl_filename()

# }}}1
# Makefile customization (MY) {{{1
{ package MY;

Expand Down Expand Up @@ -133,7 +136,9 @@ actually_uninstall_from_vendordirs ::
EOT

} #postamble()
} #package MY }}}1
} #package MY

# }}}1

# Main options for EUMM
my %opts = (
Expand All @@ -154,6 +159,8 @@ my %opts = (

# In the following, if a specific version is listed, but no explanation
# is given, that means we want that version for bugfixes it includes.
# Prereqs commented out with "##" were used at one time but no longer
# appear to be.
CONFIGURE_REQUIRES => {
'Config' => '0',
'ExtUtils::MakeMaker' => '0',
Expand All @@ -172,7 +179,7 @@ my %opts = (
'rlib' => '0',
'Scalar::Util' => '0',
'Test::Deep' => '0.084', # for superhashof
'Test::Directory' => '0.02', # for subdirs
## 'Test::Directory' => '0.02', # for subdirs
'Test::More' => '0',
# Test::TempDir::Tiny? If so, remove Test::Directory dependency?
},
Expand All @@ -193,31 +200,30 @@ my %opts = (
#'Class::Method::Modifiers' => '1.05', # version nums from Antlers
#'Role::Tiny' => '1.000000',

'Class::XPath' => '1.4',
## 'Class::XPath' => '1.4',
'Config' => '0',
'Cwd' => '0',
#'Cwd' => '0',

'constant' => '0',
'Data::Dumper' => '0',
'Deep::Hash::Utils' => '0.03', # For correct metadata
## 'Deep::Hash::Utils' => '0.03', # For correct metadata
'experimental' => '0.009', # For support on perl < 5.15.7
'Exporter' => '0',
'feature' => '0',
# 'File::Find::Rule' => '0', # - might be nice for finding files
'File::Glob' => '0',
#'File::Glob' => '0',
#'File::Globstar' => '0.5', # Fewer dependencies
'File::Path::Tiny' => '0.9',
## 'File::Path::Tiny' => '0.9',
'File::Spec' => '0',
'File::stat' => '0',
'File::Which' => '1.22', # for msys2 support
## 'File::stat' => '0',
## 'File::Which' => '1.22', # for msys2 support
'Hash::Merge' => '0.299',
'Hash::Ordered' => '0.011',
## 'Hash::Ordered' => '0.011',
'Import::Into' => '0',
'IO::Handle' => '0',
'Getargs::Mixed' => '1.04', # For -undef_ok option
'Getopt::Long' => '2.5', # For long option bugfix
'Graph' => '0.9704', # For latest multiedged support
'List::MoreUtils' => '0.428',
## 'List::MoreUtils' => '0.428',

# 'Module::Find' => '0.12', # For bugfixes
# - Use for finding plugins to load.
Expand All @@ -230,7 +236,7 @@ my %opts = (

'overload' => '0',

'Package::Alias' => '0.12',
## 'Package::Alias' => '0.12',

# 'Parse::RecDescent' => '1.967015',
# - Use for parsing Lua tables as inline config data?
Expand All @@ -241,7 +247,7 @@ my %opts = (
# precedence in P::RD grammars.

'Path::Class' => '0.37',
'Pod::Usage' => '0',
## 'Pod::Usage' => '0',
# 'Probe::Perl' => '0', # For perl interpreter file location or other info.
# Alternative: Padre::Perl

Expand Down Expand Up @@ -280,7 +286,7 @@ my %opts = (
},
},

$provides ? (provides => $provides) : (),
@provides,

}, #META_MERGE

Expand Down
2 changes: 1 addition & 1 deletion lib/Data/Hopen.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use Data::Hopen::Util::NameSet;
use Getargs::Mixed;
use Storable ();

our $VERSION = '0.000010';
our $VERSION = '0.000011'; # TRIAL

# Docs {{{1

Expand Down
2 changes: 1 addition & 1 deletion lib/Data/Hopen/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package Data::Hopen::Base;
use parent 'Exporter';
use Import::Into;

our $VERSION = '0.000010';
our $VERSION = '0.000011'; # TRIAL

# Pragmas
use 5.014;
Expand Down
2 changes: 1 addition & 1 deletion lib/Data/Hopen/G/CollectOp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package Data::Hopen::G::CollectOp;
use Data::Hopen::Base;

our $VERSION = '0.000010';
our $VERSION = '0.000011'; # TRIAL

use parent 'Data::Hopen::G::Op';
use Class::Tiny {
Expand Down
2 changes: 1 addition & 1 deletion lib/Data/Hopen/G/DAG.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package Data::Hopen::G::DAG;
use Data::Hopen::Base;

our $VERSION = '0.000010';
our $VERSION = '0.000011'; # TRIAL

use parent 'Data::Hopen::G::Op';
use Class::Tiny {
Expand Down
2 changes: 1 addition & 1 deletion lib/Data/Hopen/G/Entity.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package Data::Hopen::G::Entity;
use Data::Hopen;
use Data::Hopen::Base;

our $VERSION = '0.000010';
our $VERSION = '0.000011'; # TRIAL

sub name;

Expand Down
22 changes: 18 additions & 4 deletions lib/Data/Hopen/G/Goal.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
package Data::Hopen::G::Goal;
use Data::Hopen::Base;

our $VERSION = '0.000010';
our $VERSION = '0.000011'; # TRIAL

use parent 'Data::Hopen::G::Op';
#use Class::Tiny qw(_passthrough);
use Class::Tiny {
should_output => true, # if true, forward the goal's inputs as
# its outputs.
};

use Data::Hopen;
use Data::Hopen::Util::Data qw(forward_opts);
Expand All @@ -23,19 +26,30 @@ is reserved for the root goal. Goals usually appear at the end of the build
graph, but this is not required --- Goal nodes can appear anywhere in the
graph.
=head1 MEMBERS
=head2 should_output
Boolean, default true. If false, the goal's outputs are always C<{}> (empty).
If true, the goal's inputs are passed through as outputs.
=head1 FUNCTIONS
=head2 run
Wraps a L<Data::Hopen::G::CollectOp>'s run function.
Passes through the inputs if L</should_output> is set.
=cut

# }}}1

sub _run {
my ($self, %args) = getparameters('self', [qw(; phase generator)], @_);
hlog { Goal => $self->name };
hlog { Goal => $self->name, ($self->should_output ? 'with' : 'without'),
'outputs' };

return {} unless $self->should_output;

return $self->passthrough(-nocontext=>1, -levels => 'local',
forward_opts(\%args, {'-'=>1}, qw[phase generator]));
} #_run()
Expand Down
11 changes: 5 additions & 6 deletions lib/Data/Hopen/G/GraphBuilder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ use Exporter 'import';

our @EXPORT; BEGIN { @EXPORT=qw(make_GraphBuilder); }

our $VERSION = '0.000010';
our $VERSION = '0.000011'; # TRIAL

use Class::Tiny {
name => sub { 'ANON' }, # Name is optional; it's here so the
# constructor won't croak if you use one.

dag => undef,
node => undef,
name => 'ANON', # Name is optional; it's here so the
# constructor won't croak if you use one.
dag => undef, # The current G::DAG instance
node => undef, # The last node added
};

use Class::Method::Modifiers qw(install_modifier);
Expand Down
2 changes: 1 addition & 1 deletion lib/Data/Hopen/G/Link.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package Data::Hopen::G::Link;
use Data::Hopen::Base;

our $VERSION = '0.000010';
our $VERSION = '0.000011'; # TRIAL

use parent 'Data::Hopen::G::Runnable';
use Class::Tiny {
Expand Down
2 changes: 1 addition & 1 deletion lib/Data/Hopen/G/Node.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package Data::Hopen::G::Node;
use Data::Hopen;
use Data::Hopen::Base;

our $VERSION = '0.000010';
our $VERSION = '0.000011'; # TRIAL

sub outputs;

Expand Down
2 changes: 1 addition & 1 deletion lib/Data/Hopen/G/Op.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package Data::Hopen::G::Op;
use Data::Hopen;
use Data::Hopen::Base;

our $VERSION = '0.000010';
our $VERSION = '0.000011'; # TRIAL

use parent 'Data::Hopen::G::Node';
use Class::Tiny;
Expand Down
2 changes: 1 addition & 1 deletion lib/Data/Hopen/G/Runnable.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package Data::Hopen::G::Runnable;
use Data::Hopen::Base;

our $VERSION = '0.000010';
our $VERSION = '0.000011'; # TRIAL

use Data::Hopen;
use Data::Hopen::Scope::Hash;
Expand Down
Loading

0 comments on commit b784d64

Please sign in to comment.