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.
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.
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.
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;
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:
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.
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;
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.
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 look at something new 'Native Delegations' on attributes or to say it another less wordy way 'Traits'
Native Delegation
is a way to let you treat standard Perl data structure as if they where objects. So to take an example from my test cases say you have this
foreach my $index2 (0..(scalar(@{$predicates[$index]->predicates()})-1)) {
that (scalar(@{$predicates[$index]->predicates()})-1)) is not very readable. Now suppose we could just have this
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.
Well more testing and re-factoring with just a little Moose in the Moose-Pen today. So I spend a good deal of time getting my tests cases all in a row. Now just a few interesting details on that, I created a number of generic utility tests that can be reused in my test cases. What I did was take the 'cmp_deeply' test like this on in
33_constants.t
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.
i'm using padre editor with strawberry perl bundled in
dwimperl
i have multiple files open, then when i click on one of the
tabs to close 1 file, padre crashes without an error message,
the application just closes.
this also happens when i save the session.
kinda frustrating.
do you discuss padre here or am i in the wrong forum?
thank a bunch in advance
Imagine you were playing with Perl 6 and you came across a buglet
or you were having some fun with the Perl 6 bug
queue—you'd like to debug a particular core
subroutine or method, so where's the source for it at?
Asked such a question, you might be told it's in Rakudo compiler's
GitHub repository. Depending on how deep
down the rabbit hole you wish to go, you may also stop by NQP's
repo, which is a subset of Perl 6 that's used
in Rakudo, or the MoarVM's repo, which
is the leading virtual machine Perl 6 runs on.
The answer is fine, but we can do better. We'd like to know exactly where
da sauce is.
Stick to The Basics
The most obvious way is to just use grep command in the source repository.
The code is likely in src/ directory, or src/core more specifically.
We'll use a regex that catches sub, method, and multi keywords. For
example, here's our search for path sub or method: