In the tradition of the Perl Advent Calendar, I have decided to write an Advent Calendar for C::Blocks, which is in pre-Beta. My plan is to release a new treat each day about the C::Blocks library. Today we will begin with the basics: what it is and how it works.
There's a problem that I've seen on every team I've worked with that uses git. Because at Tau Station we're fairly merciless about technical debt--which makes the code base pretty sweet to work with--we take all technical debt issues seriously on the theory that once we launch, it may be too late to clean up (a silly idea in theory, but a prevalent one in practice).
The following technical debt issue is actually causing us a problem, though it's more of a process problem than a technical one:
Wow! We have 272 branches? Most of those are are long merged or abandoned. We've discovered that there are a couple of them which got overlooked (I'm tempted to blame github's poor PM tooling, but it's a lousy craftsman who blames his tools). We tried asking devs to find all of their remote branches and review them and delete them, but that turned out to be a rather daunting task and they're still missing branches.
Now, with a simple Perl script, we have a solution.
Once I got though that problem I had with my last post, I quickly went through the last set of tests updating mostly the includes and the lib call and finally got the result above.
A long long time ago I've set up a web site called Perl TV where I used to collect Perl-related videos. It is now on the move and soon it will be integrated in the recently created Code And Talk site.
That's where you can find videos from Open Source related conferences.
This time however, instead of just having a site with videos, I've also create blasters. Each blaster is a newsletter in which you'll get curated, topic-specific videos.
This is the second in a series of articles, which we're writing to celebrate meta::hack, our first MetaCPAN hackathon, which is currently (Nov 17th through 21st) taking place in Chicago.
This hackathon was by invitation only, since it had a very specific goal: completing migration of the live service to MetaCPAN v1 (which includes a major Elasticsearch upgrade, from 0.20 to 2.4, or nearly 70 stable releases forward). Once that's done, any remaining time will be spent fixing bugs, and discussing what comes next. The attendees are Olaf Alders (founder of MetaCPAN), Mickey Nasriachi, Leo Lapworth, Tom Sibley, Joel Berger, Doug Bell, Brad Lhotsky and Zach Dykstra. Matt Trout is contributing remotely.
This post is brought to you by cPanel, a platinum sponsor for meta::hack.
cPanel are a well-known user and supporter of Perl,
and we're very grateful for their support. More about cPanel at the end of this article.
This week, I released a new version of Beam::Emitter. A lot has changed since the first releases, so here's some details on all the new features.
Beam::Emitter is a role for turning your classes into event emitters. Being an event emitter allows other classes to subscribe to important events from your object. Subscribers can use these events to perform additional tasks, transform your object's data, or otherwise extend and enhance your class. Beam::Emitter makes your class extensible by allowing you to provide specific places for custom code to run.
Since the 1.000 release last year, Beam::Emitter has gotten quite a few new features and bug fixes to make it easier to use and safer for your code.
You ever have one of those days. Your code just does not want to come together and gives you know end of grief. Well today was one of those days for me.
I left off yesterday with what I though was a solution for my problems with 't/30_view.t', by moving my 'Database::Accessor::Roles::DAD' out of Accessor.pm and into its own file. Seem I still had a problem as in the 'Database::Accessor::DAD::Test' I still had a 'use Database::Accessor;' present.
Now that was setting up a circular call to Accessor.pm, as well it was never my intention for some-one to use a DAD directly only as a call from Database::Accessor. In the next test case 't/31_elements.t' I got
RETRIEVE No Database::Accessor::Driver loaded for Data::Test Maybe you have to install a Database::Accessor::DAD::?? for it? at...
# Looks like your test exited with 2 just after 1.
Preamble: CPAN is great. This post in no way should be treated as Sparrow VS CPAN attempt. Sparrow is just an alternative method
to distribute your scripts. Ok, let's go.
Just when you think Dist-Pen is gone its back again.
Now that I have my Dist::Zilla mostly worked out with all sorts of test goodies it is time that I buckle down and finish off and or clean up all my 'Automated' level test. As an side note, the term 'Automated' tests was a little confusing for me. I eventually figured out that by automated they (however they may be?) mean test that CPANTS will run. Normally these are the test in your 't' dir.
Myself I guess I must just be old school as I always called these module tests and it wasn't until I embarked on my Dist::Zilla trip that I have come to see the advantage of splitting your tests that really have noting to do with the function or you module, POD, spelling, Kwalitee etc, into the hand 'xt' dir.
This week a small group of dedicated Perl developers are gathering in Chicago
for meta::hack,
the first MetaCPAN hackathon.
The primary goal is to complete the transition to Elasticsearch v2,
a major undertaking that was started more than a year ago.
Because all the participants are volunteers,
this was only possible with sponsorship.
Over the next few days we'll be sharing information about MetaCPAN and the work going on, and acknowledging some of the key sponsors.
This post is brought to you by FastMail, a gold sponsor for meta::hack. FastMail is a stalwart supporter of the Perl community — they also sponsored the QA Hackathon this year.
Last night I finally got to see The Martian. It was a fun movie, and it seems much of the science was solid. One thing that filmmakers still like to do is have computers spit out messages one-character-at-a-time as if they were arriving like telegrams. If you would like to read a file like this, I present the movie-file-reader. First, my very long-hand version:
In Perl 5.26, it will no longer be a safe assumption to assume . is in @INC. This is a good move towards a more secure Perl, but will break the installation of many CPAN modules. For those of you wondering why this was done, see this post for more information.
Many CPAN modules try to do things like: use inc::Module::Install; This depends on . being in @INC. If you invoke Makefile.PL without it, the script will not even run.
We have come up with several ways to mitigate and ultimately fix the problem:
Short Term
Perl 5.26 will support an environment variable "PERL_USE_UNSAFE_INC=1". If you set this, any perl script invoked will include . at the end of @INC. Tentatively, support for this environment variable will be immediately deprecated since long term, the CPAN modules need to simply take this into account.
This is the mother of all 'Author' test cases. This little chap wraps the 'Test::Code::TidyAll' case for you which will both tidy test and a validation test on you r code. Like TidyAll you can configure it to a very high degree. For my Database::Accessor project it is a nice to have so I will give it a good try. First you have to spend a half hour or so installing all the little parts of TidyAll, there are about twenty seven plug-ins plus other little bits. The plug-in requires that a config file is present, I just copied this one from
CPAN
. After getting that file all you need to do is add this to you '.ini' file
I've been listening for quite a few time that we should blog about the events we attend and love. I know it's good for multiple reasons, and I think it's a good advice. I've helped organize, attended and talked at the workshop and I knew I wanted to write about it, but it took me a few days before even thinking on actually do it.
In Perl, module loads have always attempted to look for the module you refer to in the current working directory (not necessarily the script location). It has always been this way in Perl. This goes back to the keyword "do" which precedes "require". When this was originally coded, it was also common to include . in your PATH.
Convention changed somewhere in the 90's. It is now considered a bad practice to include . in your PATH. Most languages also do not attempt to look for . in @INC. During my research earlier this year, I found that of all of the scripted languages, only Ruby used to have . in @INC and it was since removed.