Git::Wrapper::Plus::Support::RangeDictionary - A key -> range list mapping for support features
version 0.004010
The RangeDictionary associates tokens with RangeSets of Ranges that support that token.
RangeDictionary
RangeSet
Range
my $dict = Git::Wrapper::Plus::Support::RangeDictionary->new(); $dict->add_range('foo' => { min => '1.0', max => '2.0' }); $dict->add_range('bar' => { min => '3.0', max => '4.0' }); # Returns true on Git 3.5, False on 2.5 $dict->has_entry('bar') and $dict->entry_supports('bar', $version_object );
add_range
$dict->add_range( name => { min => 5, max => 6 }); $dict->add_range( name => { min => 7, max => 8 });
Is equivalent to:
$dict->dictionary->{name} = ::RangeSet->new( items => [ ::Range->new( min => 5, max => 6 ), ::Range->new( min => 7, max => 8 ), ], );
That is, this is a shorthand to say that for given token name, that the given parameters define an additional range of versions to incorporate as being considered "supported".
name
has_entry
Determines if a given name has associated data or not.
$dict->has_entry('name')
This method returning undef should indicate that a features support status is either unknown, or undocumented, and you should proceed with caution, assuming either support, or non support, based on preference.
undef
entries
Returns the list of features that ranges exist for
for my $entry ( $dict->entries ) { }
entry_supports
Determine if a given feature supports a given version
$dict->entry_supports( $name, $version_object );
For instance:
$dict->entry_supports('add', $gwp->versoins );
Kent Fredric <kentfredric@gmail.com>
This software is copyright (c) 2014 by Kent Fredric <kentfredric@gmail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Git::Wrapper::Plus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Git::Wrapper::Plus
CPAN shell
perl -MCPAN -e shell install Git::Wrapper::Plus
For more information on module installation, please visit the detailed CPAN module installation guide.