Group
Extension

Matches 3

App-Critique ( S/ST/STEVAN/App-Critique-0.05.tar.gz, STEVAN, 2017; MetaCPAN )
App-Critique/lib/App/Critique.pm ( view source; MetaCPAN )
package App::Critique;

use strict;
use warnings;

use File::HomeDir ();
use JSON::MaybeXS ();

our $VERSION   = '0.05';
our $AUTHORITY = 'cpan:STEVAN';

# load our CONFIG first, ...

our %CONFIG;
BEG
QUE_DATA_DIR'}  || '.critique';
    $CONFIG{'DATA_FILE'} = $ENV{'CRITIQUE_DATA_FILE'} || 'session.json';
    $CONFIG{'COLOR'}     = $ENV{'CRITIQUE_COLOR'}     // 1;
    $CONFIG{'DEBUG'}     = $ENV{'CR
NV{'ANSI_COLORS_DISABLED'} = ! $CONFIG{'COLOR'};
}

# ... then gloablly used stuff, ....

our $JSON = JSON::MaybeXS->new->utf8->pretty->canonical;

# ... then load the app and plugins

use App::Cmd::S
App-Critique ( S/ST/STEVAN/App-Critique-0.05.tar.gz, STEVAN, 2017; MetaCPAN )
App-Critique/lib/App/Critique/Command/init.pm ( view source; MetaCPAN )
d line options, and will look
something like this:

  ~/.critique/<git-repo>/<git-branch>/session.json

The value of C<git-repo> will be surmised from the C<git-work-tree>
which itself defaults to fin
App-Critique ( S/ST/STEVAN/App-Critique-0.05.tar.gz, STEVAN, 2017; MetaCPAN )
App-Critique/lib/App/Critique/Session.pm ( view source; MetaCPAN )
ath->is_file;

    my $file = Path::Tiny::path( $path );
    my $json = $file->slurp;
    my $data = $App::Critique::JSON->decode( $json );

    return $class->unpack( $data );
}

sub store {
    my (
 = $self->{_path};
    my $data = $self->pack;

    eval {
        # JSON might die here ...
        my $json = $App::Critique::JSON->encode( $data );

        # if the file does not exist
        # t
>parent->mkpath unless -e $file;

        # now try and write out the JSON
        my $fh = $file->openw;
        $fh->print( $json );
        $fh->close;

        1;
    } or do {
        Carp::confe

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.