April 2018 Archives

Baby Moose Grows Strong

Back to Accessor.pm day here in the Moose-Pen.

Starting where I left off in my last post I needed to figure out some way to get the raw query results back from Accessor.pm. I gave this a little though as there are a number of things to consider. First I never want to expose the underlying DAD to the end user of Accessor.pm, Second I have to make the name of call generic in the same way the CRUD calls are. Finally as I see this used largely for debugging it should return more than just a string.

Still little Moose

More code than none day here t the Moose-Pen.

Not much got done in yesterday's post-ette and today just a little more me thinks. Well the first thing I had to get done to-day was start work on the Driver::DBI code a little and I started by importing the constants from Database::Accessor so here is what the Driver::DBI looks like;


package Database::Accessor::Driver::DBI;
# ABSTRACT: The DBI (SQL) driver for Database Accessor
# Dist::Zilla:…

Well Nothing at all today

Well its almost programming day here in the Moose-Pen

In my last post I at least got the first test to pass. Tough it really wasn't a test of much as Driver::DBI is basically empty. I did have some time today to have a snoop about and read trhough the DBD::DBM POD and see what is what.

I discovered that by default DBD::DBM uses something called DBI::SQL::Nano which is really just a sub sub set of SQL


   DROP TABLE [IF EXISTS] <table_name>
/users/byterock/2018/04/index.html

Moose Baby Runs

Well it is still fix that test day here in the Moose-pen

Not sure why I am calling today's post a Moose-Pen as there is very little Moose if any in it. Yesterday I left of with a little script that was suppose to init a table using 'DBD::DBM' and add a few records, next get a DBI handle to that database then pass it to the 'Test::DB::User' accessor class while doing a 'create' call.

Well on my first try on running this I got


DBD::DBM::db do failed: Couldn't parse at /usr/local/lib/perl/5.18.2/DBI/DBD/SqlEngine.pm line 339.
[…

Bigger Baby Moose Steps

So back to test case day here in the Moose-Pen

So in my last post I was successfully passing my first test case 00_load.t now before I move on to my next test case I have to do a little planning.

I have to keep in mind my end goal, pass in a $dbh (a DBI Database Handle) to one of the CRUD functions on an instantiated Database::Accessor calss, parse the various Accessor, attributes convert that to the…

Bigger Baby Moose

So it is write a little code day here at the Moose-Pen.

I now have my first test case checked in thanks to yesterdays post and a few min setting up a new GitHub repo.

I also found my first bug as I used the code from this post as a template for my first crack at 'Database::Accessor::Driver::DBI'. After hanging out the name-space from SQL to DBI I ran my test and got


first argument should be a role at C:/Dwimperl/perl/site/lib/MooseX/Test/Role.pm line …

Baby-Step-Moose

It is almost programing day here in the Moose-Pen

I left off form my last post with a name-space change from 'SQL' to 'DBI' and the first think I have to do today is come up with an initial test case to work against. The usual first test is you simple does it load test like 00_load.t


#!perl
use Test::More tests => 1;
BEGIN {
    use_ok('Database::Accessor') || print "Bail out!";
}
1;
that I used in Database::Accessor. Now for my Driver I and…

Well Not Really Much Today

Well it is another planning day here in the Moose-pen

In my last post I did manage to get the change of name-space 'DAD' to 'Driver' done rather easily, thanks test suite, but I did leave an question open to me once I made the change. Have I the right name-space for my 'SQL' driver.

My plan so far was that I expected a DBI handle (DBI::db) was going to be passed into my Driver as some point. So would it not be better to call this driver 'Driver::DBI' than what I was originally thinking 'Driver::SQL'

Taking one step back I also want to make a 'Driver::Mongo' as well …

Fail the Moose Test

It is start something new day here in the Moose-Pen

Today I wanted to start writing up my first Database::Accessor::Driver, so I quickly came up with this


package Database::Accessor::Driver::SQL;

BEGIN {
$Database::Accessor::Driver::SQL::VERSION = "0.01";
}
use Moose;
with(qw( Database::Accessor::Roles::Driver));

sub execute {
my $self = shift;
my ( $type, $conn, $container, $opt ) = @_;

$container->{dad} = $self;
$container->{type} = $type;

}

sub DB…

Nail that Moose

Well it back to the Moose-Pen for me.

Seems I have kinda drifted far from my original intent of all this blogging get a useable version of my Database::Accessor module out on CPAN. Though the last little while has been a very good learning experience for me it is time I get back on track to make sure I get a version out by Christmas.

In my first round of Moose-Pen post I gave a good example of how test driven development really does work well. The very short cycle of write a small test for requirement, write a little code, pass the test, reactor the code if needed and re…

Dist::Zilla Its a Wrap VI

Last one I promis in the Dist-Pen

The go of my Dist::Zilla~Pod::Weaver round up.

Dist::Zilla Gets More Legal

Went back to law school in this post. Has a look at three section plugs ins [Legal::Complicated], [Legal::Supplemented] and
[Legal…

Dist::Zilla Its a Wrap V



Well another ten to do. Getting close to the end! This is the spot where I start my series of going over most of the available Section plugins.


Dist::Zilla Ready and Available

The first post of many looking at the various section plug-ins that are left over. The [Avaliability] plug-in is one works closely with Dist::Zilla and I also le…

Dist::Zilla Its a Wrap IV

Well still a few more of these in the Dist-Pen

Time to nock off another ten posts!

Dist::Zilla Tempate

In this post I decided to dig deeper into the Pod::Weaver template well really I just explain that the 'weaver.ini' file is the template/

Dist::Zilla On Style
This post I go a little deeper into the varios differnt template bundles out that and show the template works a in a little more depth…

Dist::Zilla Its a Wrap III

Another less than insipred day here at the Dist-Pen.

Well ten more posts to look at.

Dist::Zilla Plan
In this post I sat down with my Database::Accessor code base and ran it though dzil test to make sure it was all working.

Very Little Dist::Zilla
Well went off on a tangent with this post. I had problems with this test case ="h…

Dist::Zilla Its a Wrap II

Well it not a very creative day today in the old Dist-pen

So careering on from my las post here it the next bunch of posts to do with Dist-Zilla.

Dist::Zilla Takes Instructions

Another chore post this time creating the README file.

Dist::Zilla VCS Opps!
In this post I had a go at linking up my distribution to my VCS which in this case was GitHub. Though I am quite sure I did things…

Dist::Zilla Its a wrap!

The great Dist-Pen wrap up part the first.

So has it been really sixty days of blogging about Dist::Zilla and Pod::Weaver? Yes it has so here is a quick round up of what is where.

For the first few post in this series I had a look at the basic install using Dist::Zilla

No Such thing as Moose-Zilla!

In this post I try my hand at building a distribution with Dist::Zilla. Here I found out about some of the required attributes that Dist::Zilla needs and how to use my first plug-i…

Dist::Zilla Disclaims

Well it is section end day here in the Dist-pen.

Today I am looking at the I think the last section plug-in the [WarrantyDisclaimer] plug-in. This is your standard blurb type plug-in that will dump a bunch of legal words that is suppose to cover your arse if someone uses you code to control a self-driving car that goes berserk and crashes into a children's hospital causing a fire as the cute puppy store.

This plug-in has a number of subclasses that you can use to match up the license you are using to the correct subclass. So far there are six sub-clases

  • Def…

Dist::Zilla Templated

Well it 'T' day here at the Dist-Pen

Getting near the end of the section plug-ins I am looking at the [Template] plug-in. This one is much like the [GenerateSection] plug-in I had a look at in this post.

To use this plug-in to generate the same section I created in the other post above


=head3 Database…

Dist::Zilla No See

It is the big 'S' round-up here on the Dist-pen today.

Well just a post-ette today as I am a little hard pressed to find things to blog about. I am going to have a quick look at the three remaining section plug-ins that start with 'S'

  • [SQL]
  • [SourceGitHub]
  • [Source::DefaultGitHub]

SQL

This is a neat little plug-in that I might find useful when I go the write up my DAD::SQL. If you wrap any sql in you POD like this


=sql

SELECT * FROM records where id =1

Dist::Zilla Looks Elsewhere

Well it is look elsewhere day here in the Dist-Pen today

Getting closer to the end of the road for Pod::Weaver::Section plug-ins I only have a few more to look at so I am going to look first at the ones I might find useful and then do a final wrap up of all the left overs.

Today I am going to look at the [SeeAlso] section plug-in. Fort my Database::Accessor project this might be a good one to have in there. As I will have a number of extra content I might want listed someplace, like links to the tutorial a…

Dist::Zilla Needs Support The Second

So part two of support day here in the Dist-Pen

In my last post I had a look at the [Support] section plug-in and now I am going to have a closer look to see if I can create my own custom version of it.

The first thing I want to do is get rid of the 'perldoc' blurb and I can accomplish that by simply making that attribute false (0) in my 'weaver.ini' file


[Support]
/users/byterock/2018/04/index.html

Dist::Zilla Needs Support The first

It is support day here at the Dist-Pen

Today I am going to look a the [Support] section plug-in. This is one of the more fancy plug-in that I have looked as so far as it tries to add in not one section but up to four all under the 'Support' section.
The four are 'Perl Doc', 'Websites', 'Bugs / Feature Requests' and 'Source Code'

Obviously this plug-in will be very useful on large projects that may need for all four of the sections or perhaps the lazy programer who wants to cover off a number of thing…

Dist::Zilla Gets Used

Post-ette day here in the Dist-Pen

Today I am going to have a quick look at the [Requires] section plug-in. As the name implies this plug-in will add in a 'Requires' section in your POD. It will snoop though your '.pm' and '.pl' files with 'Module::Extract::Use' and lists these out.

Now I do have large number of uses in my code so I gave it a quick go by first installing the plug-in and then adding


[Gen…

Dist::Zilla Gets More Legal

It is Legal day again here in the Dist-Pen.

So a quick look today at three section plug-ins all dealing with the LEGAL section of you pod. All three offer the same basic output as the [Legal] sections we saw in this post, buit each adds a little.

So to start lets have a look at [Legal::Complicated] the name is a little misleading as the plug-in is easy to use and by complicated it meas that the license holder is more complicated th…

Dist::Zilla Re-Generates

Still stuck in weaver land here in the Dist-pen

Today I am going to look at [GenerateSection] section plug-in. This one look very interesing to me as it lets on generate a section from with-in the 'weaver.ini' file.

Now in my case I would love to have a common header and footer for my Tutorial pod without having to add the same section over and over again in each POD doc. I am hoping that this plug-in will get most if not all of what I need.

Right now I am just going to go for a simple all t…

Dist::Zilla Consumes Even More

Back to do some more Sections here in the Dist-pen today.

Today I am going to look at three plug-ins the very simple [Extends] the equally simple [MooseExtends] the little different [MooseConsumes]

The first two do what you would expect. Create an 'EXTENDS' section in your POD that lists all the modules that your '.pm' file is based on.

The first one [E…

Dist::Zilla Moose Weaver

So it is Moose day here in the Dist-Pen

So I am finally back to Moose after many many days with Dist::Zilla and Pod::Weaver as to today I am going to see how I can use the Moose::MOP, Dist:Zill and Pod::Weaver all together.

What I am look at today is the [Consumes] section plug-in which is suppose to run out read the meta-classes of my Moose objects and then print out all the Roles that a class consumes. I am not sure what results I will get…

Dist::Zilla In C

It is C round up day today in the Dist-Pen.

In my last post I had a look at [Contributors] section plug-in and today I am going to look at not one but three plug-ins

  • CommentString
  • CollectWithAutoDoc and
  • CollectWithIntro

CommentString
This simple plug-in lets you do your own 'Comment' sections like we have seen with [Name] and [Contributors]. It works in much the same way as the [Collect] plug-in, you supply the 'name' …

Dist::Zilla Gives Back

Still stuck in Section mode here at the Dist-Pen

Carrying from my last post today I am going to look at the [Contributors] section plug-in. This particular plug-in is of little value so for to my 'Database::Accessor' project as I have no other people working on it with me but one can always dream big that I may have some helpers as time goes on. So it is is work a l…

Dist::Zilla Hates PEEPS

It boy scout day here in the Dist-Pen.

In may last post I had final look the various [Bug] section plug-ins so today I am going to look at Merit-badges. I am really talking about that great feeling you had when you earned your first badge in Cubs, Brownies or Young Pioneers. You know the ones I mean the ones for learning to build a fire, sew on a badges, help an old man across the street or showing true will in conforming with the collective.

You can get the same feeling all over again in th…

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations