Group
Extension

Matches 35358

Business-Cart-Generic ( R/RS/RSAVAGE/Business-Cart-Generic-0.85.tgz, RSAVAGE, 2012; MetaCPAN )
Business-Cart-Generic/lib/Business/Cart/Generic/View/Order.pm ( view source; MetaCPAN )
package Business::Cart::Generic::View::Order;

use strict;
use warnings;

use JSON::XS;

use Moose;

use Text::Xslate 'mark_raw';

extends 'Business::Cart::Generic::View::Base';

use namespace::autocl
ss="red">$message</span>|,
		div_name    => 'order_message_div',
		order_count => 0,
	};

	return JSON::XS -> new -> utf8 -> encode($output);

} # End of cancel_order.

# -----------------------------
country_id == $$config{default_country_id})
	{
		$min_id = $$config{default_zone_id};
	}

	return JSON::XS -> new -> utf8 -> encode({menu => $self -> build_special_select($zone_map, $min_id, 'zone_id'
WWW-SEOmoz ( A/AJ/AJCT/WWW-SEOmoz-0.02.tar.gz, AJCT, 2012; MetaCPAN )
WWW-SEOmoz/lib/WWW/SEOmoz.pm ( view source; MetaCPAN )
z;


use Moose;
use namespace::autoclean;

use LWP::UserAgent;
use DateTime;
use URI::Escape;
use JSON;
use Carp        qw( croak );
use Digest::SHA qw( hmac_sha1_base64 );

use WWW::SEOmoz::URLMetric
uired';

    my $res = $self->ua->get( $url );

    if ( $res->is_success ) {
        return from_json $res->content;
    }

    croak $res->content;

}


sub url_metrics {
    my $self = shift;
    m
Dancer-Plugin-Res ( I/IR/IRONCAMEL/Dancer-Plugin-Res-0.0003.tar.gz, IRONCAMEL, 2012; MetaCPAN )
Dancer-Plugin-Res/lib/Dancer/Plugin/Res.pm ( view source; MetaCPAN )
ets' => sub {
        return res 400 => to_json { err => 'name is required' }
            unless param 'name';
        # ...
        return res 201 => to_json { widget => $widget };
    };
    dance;
IPC-Transit ( D/DI/DIEDERICH/IPC-Transit-0.3.tar.gz, DIEDERICH, 2012; MetaCPAN )
IPC-Transit/lib/IPC/Transit/Test/Example.pm ( view source; MetaCPAN )
ransit::Test::Example;

use strict;use warnings;
use Data::Dumper;
use IPC::Transit;
use POE;
use JSON;
use File::Slurp;

sub
import {
    my $self = shift;
    my ($callpack, $callfile, $callline) = 
utes.json') or die "get_routes: routes.json not found\n";
    my $routes;
    eval {
        $routes = decode_json($routes_text) or die "returned false\n";
    };
    die "get_routes: decode_json() fa
Metabase-Backend-SQL ( D/DA/DAGOLDEN/Metabase-Backend-SQL-1.000.tar.gz, DAGOLDEN, 2012; MetaCPAN )
Metabase-Backend-SQL/lib/Metabase/Archive/SQL.pm ( view source; MetaCPAN )
:Bulk::Array;
use Data::Stream::Bulk::DBI;
use Data::Stream::Bulk::Filter;
use File::Temp ();
use JSON 2      ();
use List::AllUtils qw/uniq/;
use Metabase::Fact;
use SQL::Abstract;
use SQL::Translato
,
  };

  my $json = eval { JSON->new->utf8->encode($fact) };
  Carp::confess "Couldn't convert to JSON: $@"
  unless $json;

#  if ( $self->compressed ) {
#    $json    = compress($json);
#  }


  tr
f->dbis->insert($self->_table_name, {
        guid => $self->_munge_guid($guid),
        fact => $json,
      });
    $self->dbis->commit;
  }
  catch {
    $self->dbis->rollback;
    Carp::confess("E
App-mymeta_requires ( D/DA/DAGOLDEN/App-mymeta_requires-0.003.tar.gz, DAGOLDEN, 2012; MetaCPAN )
App-mymeta_requires/lib/App/mymeta_requires.pm ( view source; MetaCPAN )
t;
  my @candidates = $self->opt->get_file
    ? ($self->opt->get_file)
    : qw/MYMETA.json MYMETA.yml META.json META.yml/;
  for my $f ( @candidates ) {
    next unless -r $f;
    my $mymeta = eval 
Metabase-Backend-MongoDB ( D/DA/DAGOLDEN/Metabase-Backend-MongoDB-1.000.tar.gz, DAGOLDEN, 2012; MetaCPAN )
Metabase-Backend-MongoDB/lib/Metabase/Archive/MongoDB.pm ( view source; MetaCPAN )
use Compress::Zlib 2 qw(compress uncompress);
use Data::Stream::Bulk::Callback;
use JSON 2 qw/encode_json decode_json/;
use Metabase::Fact;
use Try::Tiny;


use Moose;

with 'Metabase::Backend::MongoD
o GUID set for fact\n";
    }

    my $json = compress(encode_json($fact_struct));

    # g for guid; d for data
    $self->coll->insert( { g => $guid, d => $json }, {safe => 1} );

    return $guid;
:Cursor::slave_okay = 1;
    my $obj = $self->coll->find_one( { g => $guid } );
    return decode_json(uncompress($obj->{d}));
}

# DO NOT lc() GUID
sub delete {
    my ( $self, $guid ) = @_;
    retu
Dancer-Logger-ConsoleAggregator ( W/WW/WWOLF/Dancer-Logger-ConsoleAggregator-0.005.tar.gz, WWOLF, 2012; MetaCPAN )
Dancer-Logger-ConsoleAggregator/lib/Dancer/Logger/ConsoleAggregator.pm ( view source; MetaCPAN )
er::Logger::ConsoleAggregator::VERSION = '0.005';
}
use Dancer::Hook;
use DateTime;
use JSON qw(to_json from_json);
use Try::Tiny;

use base 'Dancer::Logger::Abstract';

# ABSTRACT: Dancer Console Log
        $obj = ref $ev_res ? $ev_res : undef;
    };
    try {
        # If its json stringified
        $obj = from_json($message);
    } if !$obj;

    # If its just a string
    push( @$strings, $m
ERR _to_json($log_message) ."\n";
    }
    ($log_message, $strings) = ({}, []);
}

sub init {
    Dancer::Hook->new( 'after', sub {
        try { flush }
        catch { print STDERR _to_json({ LOG_E
Metabase ( D/DA/DAGOLDEN/Metabase-1.001.tar.gz, DAGOLDEN, 2012; MetaCPAN )
Metabase/lib/Metabase/Archive/Filesystem.pm ( view source; MetaCPAN )
::Fact;
use Carp ();
use Data::Stream::Bulk::Callback;
use Data::GUID ();
use File::Slurp ();
use JSON 2 ();
use MooseX::Types::Path::Class;

with 'Metabase::Archive';

has 'root_dir' => (
    is => '
File::Slurp::write_file(
        $self->_guid_path( $guid ),
        {binmode => ':raw'},
        JSON->new->ascii->encode($fact_struct),
    );

    return $guid;
}

# given guid, retrieve it and ret
($guid) );
}

sub _extract_file {
  my ($self, $file) = @_;
  # read the fact
  my $fact_struct = JSON->new->ascii->decode(
    File::Slurp::read_file( $file, { binmode => ':raw' } ),
  );
  return $f
Metabase ( D/DA/DAGOLDEN/Metabase-1.001.tar.gz, DAGOLDEN, 2012; MetaCPAN )
Metabase/lib/Metabase/Librarian.pm ( view source; MetaCPAN )
Data::Stream::Bulk::Filter ();
use Metabase::Archive;
use Metabase::Index;
use Data::GUID ();
use JSON 2 ();

has 'archive' => (
    is => 'ro',
    isa => 'Metabase::Archive',
    required => 1,
);

->facts ) {
        push @fact_guids, $self->store( $f );
      }
      $fact_struct->{content} = JSON->new->ascii->encode(\@fact_guids);
    }

    if ( $self->archive->store( $fact_struct )
      &&
 rjbs, 2009-06-24
    if ($class->isa('Metabase::Report')) {
      my @facts;
      my $content = JSON->new->ascii->decode( $fact_struct->{content} );
      for my $g ( @$content ) {
        # XXX no 
Metabase ( D/DA/DAGOLDEN/Metabase-1.001.tar.gz, DAGOLDEN, 2012; MetaCPAN )
Metabase/lib/Metabase/Index/FlatFile.pm ( view source; MetaCPAN )
lk::Array;
use Fcntl ':flock';
use IO::File ();
use List::AllUtils qw/any all/;
use JSON 2 qw/encode_json decode_json/;
use Regexp::SQL::LIKE 0.001 qw/to_regexp/;
use Tie::File;
use MooseX::Types::Pat
" ) unless $fact->guid;

    my $metadata = $self->clone_metadata( $fact );
    my $line = encode_json($metadata);
    my $filename = $self->index_file;
    my $fh = IO::File->new( $filename, "a+" )
 
   flock $fh, LOCK_SH;
    {
        while ( my $line = <$fh> ) {
            my $parsed = decode_json($line);
            push @matches, $parsed if $query->{-where}->($parsed);
        }
    }
    $f
Metabase-Backend-AWS ( D/DA/DAGOLDEN/Metabase-Backend-AWS-1.000.tar.gz, DAGOLDEN, 2012; MetaCPAN )
Metabase-Backend-AWS/lib/Metabase/Archive/S3.pm ( view source; MetaCPAN )
se Metabase::Fact;
use Carp       ();
use Data::GUID ();
use Data::Stream::Bulk::Filter 0.08;
use JSON 2 ();
use Net::Amazon::S3;
use Path::Class ();
use Compress::Zlib 2 qw(compress uncompress);

wit
n $client->$method( name => $self->bucket );
    }
);

has '_json' => (
  is => 'ro',
  required => 1,
  lazy => 1,
  default => sub { JSON->new->ascii },
);

sub initialize {}

# given fact, store it
 store: no GUID set for fact\n";
    }

    my $json = $self->_json->encode($fact_struct);

    if ( $self->compressed ) {
        $json = compress($json);
    }

    my $s3_object = $self->s3_bucket-
Business-Cart-Generic ( R/RS/RSAVAGE/Business-Cart-Generic-0.85.tgz, RSAVAGE, 2012; MetaCPAN )
Business-Cart-Generic/lib/Business/Cart/Generic/View/Product.pm ( view source; MetaCPAN )
package Business::Cart::Generic::View::Product;

use strict;
use warnings;

use JSON::XS;

use Moose;

use Text::Xslate 'mark_raw';

extends 'Business::Cart::Generic::View::Base';

use namespace::auto
Dancer-Logger-ConsoleAggregator ( W/WW/WWOLF/Dancer-Logger-ConsoleAggregator-0.005.tar.gz, WWOLF, 2012; MetaCPAN )
Dancer-Logger-ConsoleAggregator/README.pod ( view source; MetaCPAN )
use this log module.  Then you can debug like this:

    debug { field1 => "data" };
    debug to_json({ field2 => "data" });
    debug "Raw Data";

And this module will log something like this:

    
CPAN-Testers-Metabase ( D/DA/DAGOLDEN/CPAN-Testers-Metabase-1.999002.tar.gz, DAGOLDEN, 2012; MetaCPAN )
CPAN-Testers-Metabase/lib/CPAN/Testers/Metabase/Demo.pm ( view source; MetaCPAN )
$data_dir->mkpath or die "coudln't make path to $data_dir";

  my $index = $data_dir->file('index.json');
  $index->touch;

  my $archive = $data_dir->file('archive.sqlite');

  return Metabase::Libra
Business-Cart-Generic ( R/RS/RSAVAGE/Business-Cart-Generic-0.85.tgz, RSAVAGE, 2012; MetaCPAN )
Business-Cart-Generic/lib/Business/Cart/Generic/View/Base.pm ( view source; MetaCPAN )
 'order_message_div',
		content => $self -> templater -> render('error.tx', $param),
	};

	return JSON::XS -> new -> utf8 -> encode($output);

} # End of format_errors.

# ----------------------------
> 'order_message_div',
		content => $self -> templater -> render('note.tx', $param),
	};

	return JSON::XS -> new -> utf8 -> encode($output);

} # End of format_note.

# ------------------------------
ns a JSON and utf8 encoded block of text (usually of error messages) suitable for sending to the client.

=head2 format_note($note)

$note is a hashref of information for the user.

Returns a JSON and
Business-Cart-Generic ( R/RS/RSAVAGE/Business-Cart-Generic-0.85.tgz, RSAVAGE, 2012; MetaCPAN )
Business-Cart-Generic/lib/Business/Cart/Generic/View/Search.pm ( view source; MetaCPAN )
package Business::Cart::Generic::View::Search;

use strict;
use warnings;

use JSON::XS;

use Moose;

extends 'Business::Cart::Generic::View::Base';

use namespace::autoclean;

our $VERSION = '0.85';
Net-YAR ( R/RH/RHANDOM/Net-YAR-1.083.tar.gz, RHANDOM, 2012; MetaCPAN )
Net-YAR/lib/Net/YAR.pm ( view source; MetaCPAN )
Agent;
use HTTP::Request;
use HTTP::Headers;
use vars qw(
    $AUTOLOAD
    $VERSION
    $JSON_ENCODE
    $JSON_DECODE
    $DEFAULT_RETRY_MAX
    $DEFAULT_RETRY_INTERVAL
);

$VERSION = sprintf "%d.%03

sub serialize_type {
    return shift->{'serialize_type'} ||=
          eval { require JSON }            ? 'json'
        : eval { require YAML::Syck }      ? 'yaml'
        : eval { require YAML }  
a::URIEncode } ? 'uri'
        : die "Can't find a module that can encode and decode (need one of JSON, YAML::Syck, YAML, Data::URIEncode, XML::Simple)";
}

###----------------------------------------
MediaWiki-API ( E/EX/EXOBUZZ/MediaWiki-API-0.39.tar.gz, EXOBUZZ, 2012; MetaCPAN )
MediaWiki-API/lib/MediaWiki/API.pm ( view source; MetaCPAN )
rnings;
use strict;

# our required modules

use LWP::UserAgent;
use URI::Escape;
use Encode;
use JSON;
use Carp;

# just for debugging the module
# use Data::Dumper;
# use Devel::Peek;

use constant 
=item * retries = Integer value; The number of retries to send an API request if an http error or JSON decoding error occurs. Defaults to 0 (try only once - don't retry). If max_retries is set to 4, a
nteger value in seconds; The amount of time to wait before retrying a request if an HTTP error or JSON decoding error occurs.

=item * max_lag = Integer value in seconds; Wikipedia runs on a database 
Devel-CoverReport ( N/NA/NATANAEL/Devel-CoverReport-0.05.tar.gz, NATANAEL, 2012; MetaCPAN )
Devel-CoverReport/lib/Devel/CoverReport/DB.pm ( view source; MetaCPAN )
hex );
use English qw( -no_match_vars );
use File::Slurp qw( read_file write_file read_dir );
use JSON;
use Params::Validate qw( :all );
use Storable;
use YAML::Syck qw( LoadFile DumpFile );

=encodin
ails, it will try to use I<JSON> to load the data.

This method supports reading I<.12> and I<.13> file formats.
It can auto-detect if it was serialized with storable or JSON.

=cut
sub read_db_file {
  # Data is a Storable image.
        return retrieve($file_path);
    }

    require JSON;

    return decode_json( $data );
} # }}}

1;

=back

=head1 LICENCE

Copyright 2009-2011, Bartłomiej Sygu

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