Today in the Moose-Pen I am going to have a quick look at some very Moosish behavior when playing with types. I known you must be getting tired for Moose Types, but I think today you will see something that may save you time if you ever go deeply into Moose Types and coercion.
So to set this up say I have a look a new test I added to the 33_condtions.t test case
I uploaded my 20th distribution to CPAN yesterday, a little bit premature of CPAN day but that doesn't matter. It will require an update since odd things are happening in the tests, so there will be a release today. The module is Net::AMQP::RabbitMQ::PP, a pure perl version of Net::AMQP::RabbitMQ.
I didn't write the module but when updating various libs and our version of perl here i noticed it had found its way into our stack and when cpanm didn't find the distribution i had to go hunting. It turned out the module existed on github but never made it to CPAN, so how it got into our stack i don't know.
Finally I decided not to use Test::More and Perl Test-Harness in Outthentic anymore.
These are the great tools proven in many many testing projects. But Outthentic tends to be more general purpose framework to run ANY scripts, rather than being a test framework only. Some testing facilitates are still here, but they poorly use a Test::More/Test-Harness entities, so I decided to rewrite story runner to get an asserts execution results in free style - so no TAP indeed is required.
If you're following tech stuff, you probably know by now about the folks
at Rust land working on some totally awesome error reporting
capabilities. Since
Perl 6 is also known for its Awesome Errors,
mst inquired for some examples to show
off to the rustaceans, and unfortunately I drew a blank...
Errors are something I try to avoid and rarely read in full. So I figured I'll
hunt down some cool examples of Awesome Errors and write about them. While
I could just bash my head on the keyboard and paste the output, that'd be quite
boring to read, so I'll talk about some of the tricky errors that might not
be obvious to beginners, and how to fix them.
So carrying on from where I was yesterday in the Moose-Pen I played with a few ideas today on how to solve my problem of not being able to get dynamic attributes down to the DAD from my DA.
In my last post I had the example of a canned 'client' that I wanted to do this to
my $client_da = Data::Tier::Clients->new();
$client_da->add_conditions(...
$client_da->retieve($mongo,$into);
$client_da->retieve($dbh,$into);
I did play about with loading All the DADs at once so and I could accomplish this by do this by storing all the DADs in a new attribute, then I creates a 'add_conditions' sub where I passed these conditions down into the underlying DADs.
Dancer2 0.202000 is on its way to a CPAN mirror near you, and brings several important bug fixes and enhancements.
Plugins may now easily call the application’s DSL using $self->dsl. For example, logging a debugging message is as easy as $self->dsl->debug( “I’m in your plugin!” ); Plugins can now also call the syntax of plugins that they have loaded. Consider this example:
Your Dancer2 application (MyApp) uses plugin Foo. Plugin Foo uses plugin Bar. Plugin Bar adds baz() to the DSL. Plugin Foo can now access baz() (just like the DSL in Dancer2 works), however, baz() is only accessible to the Foo plugin, notMyApp.
Please keep in mind that if plugin Bar adds any hooks, those hooks are added to MyApp, but Bar’s DSL is not available to MyApp.
The parameter methods in Dancer2 (body_parameters(), etc.) were not decoding Unicode values passed to them. All parameter methods are now decoding Unicode characters.
Disclaimer: I'm sure this functionality exists elsewhere, but this was a fun little thing for me to work on. Also, you'll need a minimum of git 2.7 for this to work.
Often, when I'm working locally I like to bounce right over to a GitHub repository url to check something. I ended up writing a bit of code to make this easier. While I was at it, I decided it would be nice to have the same thing for Travis URLs. So, I've released this as part of Git::Helpers.
When you're inside a Git repository, you can use
gh-open
to open a browser window with the GitHub URL of your repository.
gh-open
also accepts an origin name as an argument, so
gh-open upstream
would open a tab in your default browser containing your upstream's URL, assuming you have an origin by that name. Don't specify a remote name and it will assume
origin
:
gh-open
It doesn't currently care which branch you're on, but patches welcome (in the kindest sense of the expression).
If you want to check your Travis page for the repository then
travis-open
will do the same kind of thing. It also accepts an origin name, just as
gh-open
does:
For my Moose-pen today I am going to have to put my thinking moose and get out of my class, type, attribute and coercion rut that I have been and and look at how my Accessor will be used by other programmers.
Fortunetly I have not done a good deal of work in this area. So far I have only the retrieve and my 'BUILD' sub that I use to load in the DAD that might be out test. Now this is where I am getting into problems as the way it stands not thing will work fine with static Accessor but I will have problems with adding in dynamic attributes.
To illustrate this lets start with a simple example of two joined tables.
I am a subscriber to module-authors@perl.org and thought I’d repost something written there for the wider community.
Chris Bogart, a postdoc at Carnegie Mellon, is interested in studying how different language-level package managers and repositories handle breaking changes. He has observed that different package management systems have made “very different design choices from each other,” and he would “like to know what the impact of [CPAN’s] design choices are on how you negotiate breaking changes among CPAN module developers when the packages depend on each other.”
If you have released modules on CPAN, and especially if you have thought about making breaking changes to your module, or have made breaking changes to your module, I’m sure you’re ideas would be helpful. If you have had to deal with an upstream author’s breaking changes, I’m sure that would be helpful, too.
CPAN Day marks the day when the first distribution was recorded as being uploaded to CPAN. That was 16th August 1995, so we've been uploading modules for 21 years now!
On CPAN Day you could release something to CPAN, send a pull request on someone else's distribution, blog about Perl, or just head to the pub with fellow Perl hackers.
Just a short note for the Moose-Pen toady, I am going to clean finish off my Moose droppings by looking at the Expression.
Well all I really have to do is do a search and replace on the word function in my last post and and then past is here but that would be cheating. If I did do that I would at least see if anyone is reading these apart from Gabor.
So I will be working the
14_predicate.t
and adding in the following;
Mojolicious::Plugin::OpenAPI is close to being stable so i figured it was time to migrate from our use of Mojolicious::Plugin::Swagger2. Here's the differences i found, with the observation that perhaps some of these were down to having an older version of Swagger2 (0.79, although Changes log suggests that might not be the case):
Today in the Moose-Pen I am going to cleanup up more Moose droppings. Now I already added in the Function and Expression class and came up with a few modest tests case for them '19_function_expression.t'.
Not that is fine and good for a unit test on that class but the problem is these two classes will never be used as stand alone classes they will always be used inside other objects typically in the same place I would use a Param or Element class and most of the time in a Predicate object.
The best place to basic unit tests of both Function and Expression is in the predicate unit tests case '
14_predicate.t
' so in there I add firsts added;
I like to keep my perl modules lean when it comes to dependencies. But then again, CPAN is just so wonderful with all the helpful packages available. So there are always dependencies.
When writing perl modules, more often than not a few dependencies creep in … which makes it a whee bit awkward when developing the module, because I then have to somehow install these dependencies, and I would rather not get them all over the place but neatly in the module directory so that I have at least a semblance of a stable development environment.
So here goes my solution: A little postamble method for my Makefile.PL.
Portable GitHub system "GitPrep 2.3" is released at 2016-08-06.
Finally, "issues" system is added. You can use "Bug tracking" on GitPrep.
And contain bug fixing, added features.
support issues system
support markdown table
support markdown foo_bar_baz
At first, Let's try GitPrep example. You will find GitPrep is real portable GitHub system.
The features of GitPrep
I introduce the featrues of GitPrep for people who see GitPrep for the first time.
Github clone: GitPrep has the same interface as GitHub.
Support issue system
Portable: You can install GitPrep on your own Unix/Linux server.
Only needs Perl 5.10.1+.
Smart HTTP support: you can pull and push repository via HTTP.
Built-in web server, and reverse proxy support.
CGI support.
SSL support.
Public key authentication support
Installation is very easy. You run only two commands. Difficult settings is unnecessary.
Even if you have troubles by your mistake, for example "git push -f origin master", you can access all of your git repositories directory and fix them.