(uniq);
use YAML::XS 0.67;
use AnyEvent::Filesys::Notify 1.23;
use boolean;
$YAML::XS::Boolean = 'JSON::PP';
use Qgoda::Logger;
use Qgoda::Config;
use Qgoda::Site;
use Qgoda::Asset;
use Qgoda::Analyz
at = $options{output_format};
$format = 'JSON' if empty $format;
if ('JSON' eq uc $format) {
require JSON;
print JSON::encode_json($data);
} elsif ('YAML' eq uc $format) {
n qw('qgoda');
use File::Spec;
use Cwd;
use URI;
use Scalar::Util qw(reftype);
use JSON 2.0 qw(encode_json decode_json);
use Date::Parse qw(str2time);
use POSIX qw(setlocale LC_ALL);
use File::Basenam
e) {
my $json = encode_json($filters);
$json =~ s{.(.*).}{$1};
die __x("invalid filters '{filters}' (use named arguments!)\n",
filters => $json);
} elsif (
my $reftype = reftype $hashref;
if ('ARRAY' eq $reftype) {
my $json = encode_json($hashref);
$json =~ s{.(.*).}{$1};
die __x("invalid arguments '{args}' for method '{me
da::Init::VERSION = '0.9.8';
use strict;
use Locale::TextDomain qw('qgoda');
use File::Spec;
use JSON '2.90';
use Scalar::Util qw(weaken reftype);
use Qgoda::Util qw(read_file write_file yaml_error
dump the configuration JSON schema and exit
init initialize a new qgoda site
dump dump the site structure as JSON (implies --quiet)
javascrip
use Locale::TextDomain qw(qgoda);
use Cwd;
use JSON::PP;
use File::Spec;
use Qgoda;
use constant true => $JSON::PP::true;
use constant false => $JSON::PP::false;
sub config {
# FIXME! Fill in the
turn {
'$schema' => 'http://json-schema.org/draft-07/schema#',
'$id' => 'http://www.qgoda.net/schema/Qgoda/v'
. $Qgoda::VERSION
. '/config.schema.json',
title => __"Configuration
u:%02u%s',
$time[5] + 1900, $time[4] + 1, $time[3], $time[2], $time[1],
$time[0], $tz);
}
sub TO_JSON {
my ($self) = @_;
return $self->ISOString;
}
1;
ils::VERSION = '0.9.8';
use strict;
use Locale::TextDomain qw(qgoda);
use File::Spec;
use JSON qw(decode_json);
use Scalar::Util qw(reftype);
use Qgoda::Util qw(read_file empty);
use base 'Exporter
$_, 'package.json') }
grep !/^\./, readdir $dh) {
my $package_dir = File::Spec->catfile('node_modules', $subdir);
my $package_json = File::Spec->
,
'package.json');
my $package = eval { decode_json read_file $package_json }
or next;
next if !$package->{qg
e '_config.yml') {
$filename = '_config.yml';
} elsif (-e '_config.json') {
$filename = '_config.json';
} elsif (!$q->getOption('no-config')) {
$logger->warning(__"conf
$local_filename = '_localconfig.yml';
} elsif (-e '_localconfig.json') {
$local_filename = '_localconfig.json';
}
my $local_yaml = '';
if (!empty $local_filename) {
->{paths}->{views}]
if 0 == @{$config->{po}->{tt2}};
# This outsmarts the default options for JSON schema.
my $processor_options = $schema->{properties}
->{processors}->{
0.9.8';
use strict;
use Qgoda;
use base 'Qgoda::Command';
sub _getDefaults { output_format => 'JSON' }
sub _getOptionSpecs {
output_format => 'output-format=s'
}
sub _run {
my ($self, $ar
he default output format JSON with one of:
=over 8
=item YAML
See L<http://yaml.oprg/>
=item PERL
Serialized into Perl code.
=item STORABLE
See L<Storable>.
=item JSON
The default output form
namespace {
my ($self, $plugin_data) = @_;
die __x("Field '{field}' missing in 'package.json'.\n",
field => 'qgoda.module')
if !exists $plugin_data->{module};
die __x
lf->{__modules}->{$module_name} = $plugin_data;
die __x("Field '{field}' missing in 'package.json'.\n",
field => 'qgoda.entry')
if !exists $plugin_data->{entry};
my $entr
se strict;
use Qgoda::Util qw(empty);
use JavaScript::Duktape::XS 0.000074;
use Cpanel::JSON::XS qw(decode_json);
use File::Spec;
use File::Basename qw(dirname);
use Locale::TextDomain qw(qgoda);
BE
filename => $filename, err => $!));
my $code = join '', <$fh>;
if ($filename =~ /\.json$/) {
$code = 'module.exports = ' . $code;
}
return $code;
}
sub __normalize {
my ($self, $
self->__isFile($filename);
# FIXME! Try to mark $filename as json. That's safer than looking
# at the extender;
$filename = "$name.json";
return $filename if $self->__isFile($filename);
die;
}
{_package}) {
$logger->info(__"updating 'package.json'");
my $json = JSON->new;
my $json_data = read_file 'package.json'
or $logger->fatal(__x("cannot read '{filen
filename => 'package.json',
error => $!));
my $old = eval { $json->decode($json_data) };
$logger->fatal($@) if $@;
= merge_data $old, $config->{_package};
$json->pretty(1);
$json_data = $json->encode($data);
write_file 'package.json', $json_data
or $logger->fatal(__x("cannot w
d from F<_config.yaml> (resp. F<_config.yml> or]
F<_config.json>) and F<_localconfig.yaml> (resp. F<_localconfig.yml>
or F<_localconfig.json>).
If none of these files exist, the Qgoda default config
Qgoda::Command::Javascript::VERSION = '0.9.8';
use strict;
use Locale::TextDomain qw(qgoda);
use JSON;
use Storable;
use YAML::XS;
use Qgoda;
use Qgoda::CLI;
use Qgoda::JavaScript::Environment;
use
mpty read_file);
use base 'Qgoda::Command';
sub _getDefaults {
global => [],
input_format => 'json'
}
sub _getOptionSpecs {
input => 'i|input=s',
input_data => 'input-data=s',
input_format =>
d input format '{format}'.\n",
format => $options{input_format})
if ($lc_format ne 'json' && $lc_format ne 'yaml'
&& $lc_format ne 'perl' && $lc_format ne 'storable');
my $cod
L::XS;
use JSON;
use Data::Dumper;
use Storable qw(nfreeze);
use Locale::TextDomain qw(qgoda);
use Qgoda;
use Qgoda::Schema;
use base 'Qgoda::Command';
sub _getDefaults {
format => 'json'
}
sub _
a->config;
if ('yaml' eq $options{format}) {
print Dump($schema);
} elsif ('json' eq $options{format}) {
print JSON->new->canonical->encode($schema);
} elsif ('perl' eq $options{format}) {
pr
T][--help]
Try 'qgoda --help' for a description of global options.
=head1 DESCRIPTION
Dump the JSON schema for the Qgoda configuration to the console (standard
output).
B<Important!> The Qgoda con
return $self->{origin};
} else {
return $self->getPath;
}
}
sub dump {
my ($self) = @_;
return %$self;
}
sub TO_JSON {
my ($self) = @_;
return {%$self};
}
1;