Sophisticated Moose

Today in the Moose-pen I am going to play with the very familiar 33_condtions.t and this time I am going to solve another little API problem I know I am going to run into.

Part of my evil plan is to allow end users to add in conditions on the fly and I have made provision for that with the 'rw' 'conditions' attribute found on my DAD Role. Now I have to fix a minor oversight on my part can change the type on 'conditions' to be the same as the original in Accessors, so I changed this

–    isa     => 'ArrayRefofPredicates',
++    isa     => 'ArrayRefofConditions',
 
What I want to be able to do is allow my end users to do something like this

Perl 5 Porters Mailing List Summary: July 23rd-26th

Hey everyone,

Following is the p5p (Perl 5 Porters) mailing list summary for the past half week. Enjoy!

Alpine Perl Workshop 2016 - Cfp extended - Keynote speaker wanted


logo.png

Not able to manage it to get to YAPC?
or
You are going to YAPC and you need more Perl talks?

Come to Alpine Perl Workshop, come to Innsbruck.

Consider to submit a talk.

Call for papers is extended till Sunday, August 21.

Sparrowdo automation. Part 4. Managing users and groups.

Hi! These are the previous articles:

This one is going to be quite short. We will learn how to manage linux users and groups using sparrowdo.

Let's get back to our ubiquitous example of installing CPAN modules:

task_run  %(
  task => 'install 2 modules',
  plugin => 'cpan-package',
  parameters => %( 
    list => 'CGI DBI'
  ),
);   

If we run this one we will see that CGI and DBI CPAN modules get installed into system paths, which is ok.

Consider a following case though:

Late Night Moose

Well in today's Moose-pen I am still going to play about with good old 33_condtions.t , not the tests per-say but the API they are calling. In my last post I fixed the my API call by adding in the 'predicates' param to the 'conditions' param like this

...
 view =>'People' } ],
conditions=>[{predicates=>[{left=>{name =>'last_name',
                                   view =>'People'},
...         
to me the above is a little wordy an error prone. The original API call I attempted

Comparing Perl, Python, and Ruby's test assertions

I've started a new series on my testing blog about the differences between Perl, Python, and Ruby's testing ecosystems and architectures. First article looking at the most basic assertions is done:

http://www.writemoretests.com/2016/07/perl-python-and-ruby-the-anatomy-of-a-testing-assertion.html

Perl 5 Porters Mailing List Summary: July 13th-22nd

Hey everyone,

Following is the p5p (Perl 5 Porters) mailing list summary for the past week and a half. Enjoy!

Announce: Rakudo Star Perl 6 Compiler Distribution Release 2016.07

Re-posted from http://rakudo.org/2016/07/22/announce-rakudo-star-release-2016-07/
The release was prepared by Steve 'stmuk' Mynott

On behalf of the Rakudo and Perl 6 development teams, I'm pleased to announce the July 2016 release of "Rakudo Star", a useful and usable production distribution of Perl 6. The tarball for the July 2016 release is available from http://rakudo.org/downloads/star/.

This is the third post-Christmas (production) release of Rakudo Star and implements Perl v6.c. It comes with support for the MoarVM backend (all module tests pass on supported platforms).

Please note that this release of Rakudo Star is not fully functional with the JVM backend from the Rakudo compiler. Please use the MoarVM backend only.

Not a Mousse Moose!

So in my last Moose-pen I ran into problem with my 33_conditions.t test case where it was giving me errors like this

# Compared $data->left # got : Does not exist …
Well after some playing about I saw the errors of my ways. Looking at the Database::Accessor::Condition class I remembered to load that properly I will have to pass in any conditions with the 'predicates' param. So I modified my$$in_hash to this;

Dancer2 0.201000 Released

Dancer 2 0.201000 is on its way to a CPAN mirror near you.

The Dancer Core Developers are sad to announce the retirement of David Golden (xdg) from the core team. Dancer2 was made much better by his many contributions, and we are extremely grateful for all he has done.

We’d also like to announce the addition of Peter Mottram (SysPete) to the core team. SysPete has been working quietly behind the scenes on a number of projects, but has been a valuable member of the core team for some time now, and we are happy to have him aboard.

The core developers would most importantly like to give thanks to our awesome community for the numerous contributions towards this release. You rock!

Adding profiling support to nqp-js

Currently the focus of the work on the js backend is on making nqp-js emit code that runs at a reasonable speed (so that compiling Rakudo and its setting doesn't take eons and I can iterate on it more easily). Being able to easily profile nqp-js code is very useful for that.

The js profilers I have tried didn't work out so well

  • devtools had trouble with native modules as it runs in
  • running directly inside chrome require webpacking
  • node-inspector didn't support console.profile/console.profileEnd and it's interface locked up while profiling
  • some other ones were bitrotted

berrybrew, the perlbrew for Windows; rewritten and enhanced

For the people who use Windows, I've released berrybrew v1.04.

This software was originally written by David Farrell. While I was writing Test::BrewBuild, I needed some additional features (particularly the --with option for exec, and better PATH management). I wrote a couple of PRs, but they were rejected (not by David, but by the new maintainer). Not long after that, the person who had taken over the project disappeared, so I decided to permanently fork it, and nearly completely rewrite the whole thing.

It does everything the original does, but now includes far more:

Just A Cute Moose

Well today in the Moose-pen I am still going to have a look at my 33_conditions.t test case. In my last post I got all the little bits working right up to the point when I want the DAD to return or at least crate this string

RETRIEVE-->View-->'People'-->Elements-->'People.first_name',
'People.last_name','People.user_id'-->Condtion->People.user_id=test-->AND-->
People.first_name=John

After sleeping on it and then playing a bit I came to the very wise conclusion to not to test my Accessor in this way. If I take this path then I am opening myself up to going down all sorts of test rabbit holes where there is nothing wrong with my Accessor but a problem in my Tests DAD. So what to do?

Well lets have a look at what I have to test:

  • coercion from a hash to a type works correctly
  • class attribute values passed into the DAD are correct

[Part 2] A Date With The Bug Queue or Let Me Help You Help Me Help You

Read this article on Perl6.Party

Be sure to read Part I of this series.

As I was tagging tickets in my bug ticket helper app, I was surprised by how often I was tagging tickets with this particular tag:

Needs core member decision

It may have been the most used tag of them all. And so, it made be think about...

PART II: The Experienced Contributor

I will be referring to "core developers," but this generally applies to any person who has great familarity with the project, how it should, does, and will work —The Experienced Contributor. When it comes to bug queues, can this type of people do more than just pick the bug they like the most and fix it?

LESSON 3: Many Tickets Can Be Fixed With A Single Comment

On my date with the bug queue, I found many tickets that looked relatively easy to fix, from a technological point of view, but I couldn't even begin working on them for a simple reason: I didn't know what the correct behaviour should be.

Sparrowdo automation. Part 3. Installing system packages.

HI! I continue blogging about sparrowdo - a simple perl6 configuration management tool.

This is what we've learned so far:

Installing packages

Consider out latest example with installing CPAN packages:

Perl 5 Porters Mailing List Summary: July 6th-12th

Hey everyone,

Following is the p5p (Perl 5 Porters) mailing list summary for the past week. Enjoy!

Best Moose Opening Line Ever

So today in the Moose-Pen I was going to get my 33_conditions.t test case working. New we left off in my last post with this call to Accessor

A Date With The Bug Queue or Let Me Help You Help Me Help You

Read this article on Perl6.Party

Recently, I decided to undertake a quick little journey down to the Perl 6's Bug Queue. A quest for fame and profit—some easy game to hunt for sport. There's plenty of tickets, so how hard can it be? The quick little journey turned out to be long and large, but I've learned a lot of good lessons in the process.

PART I: The Newbie Contributor

Right away, I hit a snag. Some tickets looked hard. On some, it wasn't clear what the correct goal was. And some looked easy, but I wasn't sure whether I wanted to work on them just yet. While the ticket queue has the tag system, I needed some personal tags. Something special just for me....

The Ticket Trakr

So I wrote a nice little helper app—Ticket Trakr. It fetches all the tickets from the bug queue onto one page and lets me tag each of them with any combination of:

Thames Valley Perl Mongers

Thames Valley Perl Mongers, aka TVPM, are now having monthly social meetings at various locations in the Thames Valley (in the UK).

Our next meeting is next Monday (18th July) at 8pm, at The Jam Factory in Oxford. We're not going for the jam, but the beers.

Pong in Perl 6 at MadMongers Tonight

Pong in Perl 6 at MadMongers Tonight

[From my blog.]

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.