So, in my most recent careering of things, I'm doing QA/Special Projects work for a startup in California. (Cytobank, if you're curious. I have rarely worked with more splendid folks, I have to say.)
Under the 'Special Projects' umbrella is a crusty little batch testing tool I'm cobbling together. Nothing spectacular (and in deep need of refactor already, I keep seeing stuff that needs work), but it's nice to get back into an editor and actually see code I wrote do work.
It's also pretty nice to think about the possible long-term implications. The mail monitoring system I wrote over a decade ago, Matriarch, is still in use as far as I know. Now, I've got Octypus: We have Sauce, we have Selenium, and Octypus gets tentacular in both of 'em. We tell it what to run, tell it what platforms to run it on, and it makes the runs requested happen. Boom boom boom.
I'm still working on the reporting features it needs, but oh, I have missed this stuff. I really, really have. It's good to be back in the text editor, y'know? Maybe I'm waxing a little too ecstatic, but it's the day after my nhhhhmpth birthday, and I feel the elation of ten years ago. That's something to remember, at least for me. :D
Well nearing the end of my test now, I have done the basic stuff in this post,the api parts here, the validation bits in this one and the instance bits with my last one. So to carry on I think it would be prudent to test this in a composed setting though I doubt anyone would use it like that.
So will name this one 40-composit and I start as usual with my testing boilerplate and my three little roles
This blog post is just for sharing a simple script.
Like many Perl programmers, I have a mini CPAN mirror locally on my hard drive (I put mine in /cpan). Aside from installing CPAN modules offline using cpanminus, I also sometimes want to peek into a dist's files (especially the contents of the t/). So what's a quick way to get the path of a module's tarball, or to extract it?
Normally cpanminus can do this, via cpanm --mirror /cpan --mirror-only --look Module::Name, but it doesn't work on my setup (both on the PC and laptop). So I turn to CPAN.
There are at least three libraries on CPAN that deal with this. Parse::CPAN::Packages is a huge library that does many things, but is very heavy on startup (loads 110k+ source code lines and over 300 files, takes 0.5s just to load the module on my laptop). To get the path of a single module requires almost 8s!
Well going on with my revised tests from my last post I am now going to look at the instance usage of my little MooseX.
Well normally I have been using this MooseX with Classes that use Moose::Util to install new roles so that is what I going to test in this next .t, so lets start with
#!perl -T
use Test::More tests => 3;
use Test::Moose::More;
use_ok('MooseX::AuthorizedMethodRoles');
use Moose::Uti;
...
Jenkins (a.k.a. Hudson) is a continuous automation system that can be leveraged for system crons, dev builds, testing, deployments, monitoring, and much more. It has Perl plug-ins and Perl is tremendo
I think this was a great suggestion of Yanick because it provides an opportunity to introduce a Perl developer a week without too much work.
GitTip is great. It provides a very easy way to people to give a little weekly reminder to someone, that their work is appreciated. Without even the need to talk to that person...
It you are listed in the GitTip Perl community, and/or on the CPAN Tip mashup, it would be great if you could add a few more words about yourself to your GitTip profile. E.g. a link to your MetaCPAN profile. A link to your blog.
A Dozen is one of those great numbers that goes way back to the Assyrian empire so today was just a little writing up what I though would be my last .t for my new MooseX and then put this project to bed by throwing it up on CPAN. I was wrong.
Well it seems I have a little bug in my .t files. I was happily doing today's .t and about half way though I ran into this
Math::Prime::Util, and the optional Math::Prime::Util::GMP back end, are a set of modules for number theory in Perl, with a large overlap of functionality with PARI/GP. This is an update on some of the things that were new in the April release (0.40 of MPU, 0.19 of MPU::GMP).
The usual speed improvements in various areas, some approximation improvements, and new functions. Primality testing benchmarks also show Perl has state of the art solutions.
Looking at the list of REST Interfaces listed on Mongo's site, there isn't a Perl solution. Well this just won't stand. So after looking at the python program to see if I missed something about what this would entail, I hacked out this gist.
After languishing in a dark eddy for several years since it was spun out of Template Toolkit core, I have adopted the Template::Plugin::Autoformat module and just released version 2.75 to CPAN.
The biggest change is how you USE it in your templates. The new version switches to initial cap 'Autoformat' instead of the previous lowercase 'autoformat'. This switch follows the Plugin convention used elsewhere, and fixes the long-standing bug where case-sensitive file systems failed to find the .pm file. (And shouldn't all filesystems be case-sensitive? I'm looking at you, HFS.)
Well still milking this one for all its worth and today I will do another .t file.
This time round I am going to test the API validation. You might remember that I did add a little validation code and this is one that really should be tested. Many is the time where a lovely API has been created but no validation so one was able to enter all sorts of nu-sanitized data and commands against the API.
So in my little API I want to check for at least one of my API keys and that if a key is present it points to an Array-Ref.
So here is what I came up with again very simple which I always find best
mop can't weaken attribute variable from outside. mop have weaken feature, but this is defined in only class and this work only when value is set. We can't weaken attribute from outside. This is not useful and some problems will occur.
# Hash base object
my $point = Point->new;
my $foo = {bar => 1};
$point->foo($foo);
weaken $point->{foo};
# mop
# We can't weaken attribute variable from outside of object.
Perl garbage collection is reference-count type. This mean if objects is referenced each other(A -> B -> A) or circle(A -> B -> C ->A), object is not released. so we should be able to weaken any object freely.
Welcome to Planet Moose, a brief write up on what's been happening in the world of Moose in the past month, for the benefit of those of you who don't have their eyes permanently glued to the #moose IRC channel, or the MetaCPAN recent uploads page.
Apologies for being a little late delivering the news this month. If you'd like to contribute some news for next month's issue, you can do so on the wiki.
Moose
Version 2.1205 is a minor update containing a small bug fix and an improved test case. One interesting new addition is the is_role function in Moose::Util.