PrePAN

Sign in to PrePAN

Profile

User's Modules

Import::Base A base module for building base modules

This module makes it easier to build and manage a base set of imports. Rather than importing a dozen modules in each of your project's modules, you simply import one module and get all the other modules you want. This reduces your module boilerplate from 12 lines to 1.

This module also allows further layers of subclassing, so you can build a set of bases like:

  • My::Project::Base
  • My::Project::Class (extends My::Project::Base)
  • My::Project::App (extends My::Project::Class)

preaction@github 0 comments

App::YAML::Filter Filter a YAML stream (like jq but for YAML)

This command is meant to make it easy to manipulate and filter YAML streams using a simple filter language.

It takes its inspiration from jq. I feel YAML is a better language for working with documents on the command line. When possible, I will adhere to jq's filter language for interoperability.

Right now I only implement the filters I need, but there's lots of stuff that jq can do that I will want to do.

If there is a better name for this, I'm open to it. App::yq perhaps? App::YAML::Filter maybe?

preaction@github 3 comments

Test::Import Test that your module forces other things into the calling namespace

This module encapsulates a bunch of tests for testing base or boilerplate modules (e.g. modules that use Import::Into to force things into the calling namespace). These tests ensure that the base module imports what it says it imports.

preaction@github 0 comments

App::Cmd::Tester::Untied Capture the result of running an App::Cmd application using Capture::Tiny

One of the reasons that user-executed programs are so often poorly tested is that they are hard to test. App::Cmd::Tester is one of the tools App-Cmd provides to help make it easy to test App::Cmd-based programs.

App::Cmd::Tester::Untied modifies the original to use Capture::Tiny in those extremely rare cases where using tie() on STDOUT and STDERR breaks the application.

RATIONALE

or... Why use this module instead of App::Cmd::Tester?

See: https://gist.github.com/preaction/5550143

Git::Repository is a module for running git(1). It uses the System::Command module to run a Git command and capture all the output. Git's plumbing commands are ideal for scripting and automation, and Perl's text-processing utilities make it perfect for parsing and interpreting Git's plumbing command output.

When System::Command runs a command, it uses IPC::Open3 on Linux. IPC::Open3 will do some things to make sure that its environment is sane, one of which is to remove any tie() on STDOUT and STDERR.

App::Cmd::Tester does exactly what it sounds like: It tests App::Cmd apps. In order to get the most coverage, it tests from the front-end, localizing @ARGV, overriding exit(), and capturing the regular STDOUT and STDERR using IO::TieCombine, which again does exactly what it sounds like (uses tie() and combines multiple IO handles).

App::Cmd::Tester captures STDOUT and STDERR by tie(). IPC::Open3 removes tie() on STDOUT and STDERR. This breaks Git::Repository, causing it to think there is no .git directory, so it dies with an error.

Questions

  • Should I release this or try to get it merged into the main App::Cmd repository?

preaction@github 2 comments

CPAN::OfflineInstall Fetch a bunch of CPAN modules to be installed on a machine that can't reach the Internet

CPAN::OfflineInstall creates bundles of CPAN modules (and all their prerequisites) that can be copied to another system to be installed.

This makes it even less likely that someone refuses to use CPAN!

preaction@github 5 comments