2 posts tagged “git”
Now that more and more of the perl programming open source projects are either on git or planning to move, I'd like to start planning a git migration for my $work repositories. It's a good time for me to do it since I basically have a new team with no source control experience, meaning there's little in the way of existing workflows to mess up. Plus, from my end it's one less tool I need to remember how to use :) If I can get off of subversion for work, that means I ony have to remember how to use svk, git and cvs.
So, looking for recommendations for self hosting git. We've been using websvn for browser viewing of the repo, and I'd like something at least as good as that.
Please don't suggest migrating to one of the external providers, such as github. My local $work IT policy won't allow it.
thanks!
One thing which has come up from time to time on the Moose Type Constraint wish list is the ability to more easily define type parameters. For example, it would be great if we could very simple create an Integer type that is bound by a range. For example:
subtype Range,
as Dict[max=>Int, min=>Int],
where {
my $range = shift @_;
return $range->{max} > $range->{min};
};
subtype RangedInt,
as Dependent[Int, Range],
where {
my ($int,$range) = @_;
return ($int >= $range->{min} && $int <= $range->{max});
};
class MyClass {
has young_adult_age => ( is=>'ro', isa=>RangedInt[min=>18,max=>34] );
}
And you can instantiate this like so:
MyClass->new(young_adult_age=>20);
But the following will throw an exception:
MyClass->new(young_adult_age=>40);
This gives your Moose based Perl programming a bit more flexibility!
Right now this is not on CPAN, but you can see it, play with it (and help me shed light on any of the corner cases) at: https://jules.scsys.co.uk/gitweb/gitweb.cgi?p=gitmo/MooseX-Dependent.git;a=tree
At this point the code is shaping up, although there's a bit of ugly stuff in the type constraint code. Even coercions work as you might hope.
Pending responses to the above syntax, remaining things before CPAN is primarily some attribute traits so that we can expose $self to a dependent type in a class. This would allow something like:
class Person {
has people => (is=>'ro', isa=>PeopleResultSet, required=>1);
has id => (is=>'ro', is=>UniqueID[PeopleResultSet], traits=>['Dependent']);
}
The idea being that the attribute 'id' would be bound to the attribute 'people' so that you could not create a new Person that had a pre-existing ID. The attribute trait stuff is still pending and feedback, test cases / use cases and of course code are very welcome.
UPDATED: My apologies for rebranding the date to anyone who has a working aggregator, but seems that whatever the settings for the Ironman aggregator, it wasn't picking up my post. Maybe I'm supposed to say, "Perl Programming now..."