view release on metacpan or search on metacpan
t/json-schema-test-suite/index.js view on Meta::CPAN
'use strict';
var Ajv = require('ajv');
var jsonSchemaTest = require('json-schema-test');
var assert = require('assert');
var refs = {
'http://localhost:1234/integer.json': require('./remotes/integer.json'),
'http://localhost:1234/subSchemas.json': require('./remotes/subSchemas.json'),
'http://localhost:1234/folder/folderInteger.json': require('./remotes/folder/folderInteger.json'),
view all matches for this distribution
view release on metacpan or search on metacpan
t/spec/index.js view on Meta::CPAN
'use strict';
const Ajv = require('ajv');
const jsonSchemaTest = require('json-schema-test');
const assert = require('assert');
const refs = {
'http://localhost:1234/integer.json': require('./remotes/integer.json'),
'http://localhost:1234/subSchemas.json': require('./remotes/subSchemas.json'),
'http://localhost:1234/folder/folderInteger.json': require('./remotes/folder/folderInteger.json'),
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JSPL/Runtime/CommonJS.pm view on Meta::CPAN
use JSPL;
my $ctx->stock_context('commonJS');
$ctx->eval(q|
var print = function() {
var stdout = require("system").stdout;
stdout.print.apply(stdout, arguments);
}
|);
=head1 DESCRIPTION
view all matches for this distribution
view release on metacpan or search on metacpan
remove = Const::Fast::Exporter
remove = HTTP::Status
[EnsurePrereqsInstalled]
:version = 0.003
type = requires
type = recommends
[GitHub::Meta]
repo = git://github.com/robrwo/JavaScript-Const-Exporter.git
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JavaScript/Duktape/XS.pm view on Meta::CPAN
my $info = $vm->get_version_info();
$vm->set('perl_module_resolve', \&module_resolve);
$vm->set('perl_module_load', \&module_load);
$vm->eval('var badger = require("badger");');
=head1 DESCRIPTION
This module provides an XS wrapper to call Duktape from Perl.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JavaScript/Duktape/C/lib/duktape.c view on Meta::CPAN
h_obj = duk_push_this_coercible_to_object(thr);
DUK_ASSERT(h_obj != NULL);
ret = duk_hobject_get_own_propdesc(thr, h_obj, h_v, &desc, 0 /*flags*/); /* don't push value */
duk_push_boolean(thr, ret && ((desc.flags & required_desc_flags) == required_desc_flags));
return 1;
}
/*
* Object.seal() and Object.freeze() (E5 Sections 15.2.3.8 and 15.2.3.9)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JavaScript/Embedded/C/lib/duktape.c view on Meta::CPAN
h_obj = duk_push_this_coercible_to_object(thr);
DUK_ASSERT(h_obj != NULL);
ret = duk_hobject_get_own_propdesc(thr, h_obj, h_v, &desc, 0 /*flags*/); /* don't push value */
duk_push_boolean(thr, ret && ((desc.flags & required_desc_flags) == required_desc_flags));
return 1;
}
/*
* Object.seal() and Object.freeze() (E5 Sections 15.2.3.8 and 15.2.3.9)
view all matches for this distribution
view release on metacpan or search on metacpan
t/javascripts/test.js view on Meta::CPAN
//= require <curry>
mmm_curry();
view all matches for this distribution
view release on metacpan or search on metacpan
share/require.js view on Meta::CPAN
callStack = [];
global.require = function(id) {
// native module
var native = requireNative(id);
if (native) {
return native;
}
// resolve file
view all matches for this distribution
view release on metacpan or search on metacpan
share/handlebars-v4.0.11.js view on Meta::CPAN
try {
/* istanbul ignore next */
if (false) {
// We don't support this in AMD environments. For these environments, we asusme that
// they are running on the browser and thus have no need for the source-map library.
var SourceMap = require('source-map');
SourceNode = SourceMap.SourceNode;
}
} catch (err) {}
/* NOP */
view all matches for this distribution
view release on metacpan or search on metacpan
t/13_module.t view on Meta::CPAN
my $source;
if ($module_name eq 'pig.js') {
$source = sprintf("module.exports = 'you\\'re about to get eaten by %s';", $module_name);
}
elsif ($module_name eq 'cow.js') {
$source = "module.exports = require('pig');";
}
elsif ($module_name eq 'ape.js') {
$source = "module.exports = { module: module, __filename: __filename, wasLoaded: module.loaded };";
}
elsif ($module_name eq 'badger.js') {
t/13_module.t view on Meta::CPAN
SKIP: {
skip 'modules not (yet) supported in V8', 18;
$vm->eval('var p = require("pig");');
is($vm->typeof('p'), 'string', 'basic require()');
$vm->eval('var r = require("cow"); var c = r.indexOf("pig");');
# printf STDERR ("cow: %s", Dumper($vm->get('r')));
ok($vm->get('c') >= 0, 'nested require()');
$vm->eval('var ape1 = require("ape"); var ape2 = require("ape");');
my $a1 = $vm->get('ape1');
my $a2 = $vm->get('ape2');
is_deeply($a1, $a2, 'cached require');
$vm->eval('var ape1 = require("ape"); var inCache = "ape.js" in require.cache; delete require.cache["ape.js"]; var ape2 = require("ape");');
ok($vm->get('inCache'), 'cached required, inCache');
ok($vm->get('ape2') ne $vm->get('ape1'), 'cached require, not equal');
$vm->eval('var ape3 = require("ape");');
is($vm->typeof('ape3.module.require'), "function", "module.require is a function");
my $a30 = $vm->get('ape3');
my $a31 = $vm->get('ape3.module.exports');
t/13_module.t view on Meta::CPAN
ok( $a34, 'module loaded');
ok(!$a35, 'wasLoaded');
is($a36, 'ape.js', 'ape __filename');
$vm->eval('var badger = require("badger");');
# printf STDERR ("badger: %s", Dumper($vm->get('badger')));
is($vm->get('badger.foo'), 123, 'exports.foo assignment');
is($vm->get('badger.bar'), 234, 'exports.bar assignment');
$vm->eval('var comment = require("comment");');
# printf STDERR ("comment %s", Dumper($vm->get('comment')));
is($vm->get('comment.foo'), 123, 'comment.foo, last line with // comment');
is($vm->get('comment.bar'), 234, 'comment.bar, last line with // comment');
$vm->eval('var shebang = require("shebang");');
is($vm->get('shebang.foo'), 123, 'shebang.foo');
is($vm->get('shebang.bar'), 234, 'shebang.bar');
};
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/zzmem_plojb1.t view on Meta::CPAN
use Test::More;
plan skip_all => 'apparent memory-leak, fixes welcome';
use FindBin;
my $context = require "$FindBin::Bin/mem.pl";
plan skip_all => "no ps" unless check_ps();
package Test;
sub new {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Jemplate.pm view on Meta::CPAN
Copyright 2006-2014 - Ingy döt Net - All rights reserved.
*/
var Jemplate;
if (typeof(exports) == 'object') {
Jemplate = require("jemplate").Jemplate;
}
if (typeof(Jemplate) == 'undefined')
throw('Jemplate.js must be loaded before any Jemplate template files');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/LWP/Authen/OAuth2/ServiceProvider.pm view on Meta::CPAN
}
sub init {
my ($self, $opts) = @_;
# Now let us consume options. 2 args = required, 3 = defaulted.
# In general subclasses should Just Work.
# need to read this first, since the later opts depend on it
$self->copy_option($opts, 'use_test_urls') if defined $opts->{use_test_urls};
view all matches for this distribution
view release on metacpan or search on metacpan
site/htdocs/static/bwr/angular/angular.js view on Meta::CPAN
function getControllers(directiveName, require, $element, elementControllers) {
var value;
if (isString(require)) {
var match = require.match(REQUIRE_PREFIX_REGEXP);
var name = require.substring(match[0].length);
var inheritType = match[1] || match[3];
var optional = match[2] === '?';
//If only parents then start at the parent element
if (inheritType === '^^') {
site/htdocs/static/bwr/angular/angular.js view on Meta::CPAN
'Controller \'{0}\', required by directive \'{1}\', can\'t be found!',
name, directiveName);
}
} else if (isArray(require)) {
value = [];
for (var i = 0, ii = require.length; i < ii; i++) {
value[i] = getControllers(directiveName, require[i], $element, elementControllers);
}
} else if (isObject(require)) {
value = {};
forEach(require, function(controller, property) {
site/htdocs/static/bwr/angular/angular.js view on Meta::CPAN
}
});
}
beforeEach(function() {
util = require('util');
webdriver = require('selenium-webdriver');
});
// For now, we only test on Chrome,
// as Safari does not load the page with Protractor's injected scripts,
// and Firefox webdriver always disables content security policy (#6358)
view all matches for this distribution
view release on metacpan or search on metacpan
site/htdocs/static/bwr/jquery/dist/jquery.js view on Meta::CPAN
// For CommonJS and CommonJS-like environments where a proper `window`
// is present, execute the factory and get jQuery.
// For environments that do not have a `window` with a `document`
// (such as Node.js), expose a factory as module.exports.
// This accentuates the need for the creation of a real `window`.
// e.g. var jQuery = require("jquery")(window);
// See ticket trac-14549 for more info.
module.exports = global.document ?
factory( global, true ) :
function( w ) {
if ( !w.document ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lemplate.pm view on Meta::CPAN
lemplate --compile path/to/lemplate/directory/ > myapp/templates.lua
From OpenResty Lua code:
local templates = require "myapp.templates"
ngx.print(templates.process("homepage.tt2", { var1 = 32, var2 = "foo" }))
From the command-line:
lemplate --compile path/to/lemplate/directory/ > myapp/templates.lua
lib/Lemplate.pm view on Meta::CPAN
This will compile all the templates into one Lua module file which can be loaded in your
main OpenResty/Lua application as the module C<myapp.templates>.
Now all you need to do is load the Lua module file in your OpenResty app:
local templates = require "myapp.templates"
and do the HTML page rendering:
local results = templates.process("some-page.tt2",
{ var1 = val1, var2 = val2, ...})
view all matches for this distribution
view release on metacpan or search on metacpan
t/context.t view on Meta::CPAN
BEGIN { use_ok "Lexical::SealRequireHints"; }
BEGIN { unshift @INC, "./t/lib"; }
my $retval;
eval { $retval = require t::context_0; 1 };
is $@, "";
is $retval, "t::context_0 return";
eval { $retval = require t::context_0; 1 };
is $@, "";
is $retval, 1;
eval { $retval = [ require t::context_1 ]; 1 };
is $@, "";
t/context.t view on Meta::CPAN
is $@, "";
sub diecxt() {
die wantarray ? "ARRAY\n" : defined(wantarray) ? "SCALAR\n" : "VOID\n";
}
eval { $retval = require(diecxt()); 1 };
is $@, "SCALAR\n";
eval { $retval = [ require(diecxt()) ]; 1 };
is $@, "SCALAR\n";
eval { require(diecxt()); 1 };
is $@, "SCALAR\n";
view all matches for this distribution
view release on metacpan or search on metacpan
ffi/scanner.c view on Meta::CPAN
if (parser->simple_key_allowed)
{
yaml_simple_key_t simple_key;
simple_key.possible = 1;
simple_key.required = required;
simple_key.token_number =
parser->tokens_parsed + (parser->tokens.tail - parser->tokens.head);
simple_key.mark = parser->mark;
if (!yaml_parser_remove_simple_key(parser)) return 0;
view all matches for this distribution
view release on metacpan or search on metacpan
[AutoPrereqs]
[DynamicPrereqs]
-condition = is_os('MSWin32')
-body = requires('Win32::Locale', 0 )
[Prereqs / Recommended]
-relationship = recommends
Task::Lingua::Any::Numbers = 0.11
view all matches for this distribution
view release on metacpan or search on metacpan
[Prereqs]
[EnsurePrereqsInstalled]
:version = 0.003
type = requires
type = recommends
[GitHub::Meta]
repo = git://github.com/robrwo/Lingua-Conjunction.git
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lingua/EN/Inflexion/Term.pm view on Meta::CPAN
}
# Conversions to ordinal and cardinal numbers (with module loaded on demand)...
my $num2word = sub {
state $load = require Lingua::EN::Nums2Words && Lingua::EN::Nums2Words::set_case('lower');
Lingua::EN::Nums2Words::num2word(@_);
};
my $num2word_short_ordinal = sub {
state $load = require Lingua::EN::Nums2Words && Lingua::EN::Nums2Words::set_case('lower');
Lingua::EN::Nums2Words::num2word_short_ordinal(@_);
};
my $num2word_ordinal = sub {
state $load = require Lingua::EN::Nums2Words && Lingua::EN::Nums2Words::set_case('lower');
Lingua::EN::Nums2Words::num2word_ordinal(@_);
};
# These words may need an "and" before them...
my $LAST_WORD = qr{
lib/Lingua/EN/Inflexion/Term.pm view on Meta::CPAN
sub cardinal {
my $value = $term_of{ shift() };
my $max_trans = shift();
# Load the necessary module, and compensate for its persnicketiness...
state $load = require Lingua::EN::Words2Nums;
local $SIG{__WARN__} = sub{};
# Make sure we have a number...
$value = Lingua::EN::Words2Nums::words2nums($value) // $value;
lib/Lingua/EN/Inflexion/Term.pm view on Meta::CPAN
sub ordinal {
my $value = $term_of{ shift() };
my $max_trans = shift();
# Load the necessary module, and compensate for its persnicketiness...
state $load = require Lingua::EN::Words2Nums;
local $SIG{__WARN__} = sub{};
# Make sure we have a number...
$value = Lingua::EN::Words2Nums::words2nums($value) // $value;
view all matches for this distribution
view release on metacpan or search on metacpan
t/fibonacci2.t view on Meta::CPAN
require "t/common.pl";
my $expect = join("",<DATA>);
my $buffer = tie *OUT, 'Handle';
select OUT;
my $ok = require "examples/fibonacci2.spl";
select STDOUT;
ok($ok);
is($$buffer,$expect);
__DATA__
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Linux/DVB/DVBT/Apps/QuartzPVR/Config/PHP.pm view on Meta::CPAN
# # Include settings into this namespace
# $line = "use PHP;\n" ;
# $line .= "require_php('$php', $namespace);" ;
##$line = '' ;
$line = require_php($php, $namespace);
}
else
view all matches for this distribution
view release on metacpan or search on metacpan
remove = Devel::GlobalDestruction
remove = Mite::Project
[EnsurePrereqsInstalled]
:version = 0.003
type = requires
type = recommends
[GitHub::Meta]
repo = git://github.com/robrwo/Linux-Statm-Tiny.git
view all matches for this distribution
view release on metacpan or search on metacpan
t/common.pl view on Meta::CPAN
# strict clean) if CopSTASH_ne(PL_curcop, GvSTASH(dest)), where dest is the SV
# to be copied to returns true. This is the case when the current control ops
# (PL_curcop) namespace doesn't match the namespace of the destination SV..
# See sv.c line 3776 (5.8.8).
my $conf = require 't/config.pl';
my $caller = (caller())[0];
while (my ($key, $val) = each(%{ $conf })) {
no strict 'refs';
*{ "${caller}::${key}" } = \$val;
view all matches for this distribution
view release on metacpan or search on metacpan
Devel::CallChecker = 0
Devel::CallParser = 0
[DynamicPrereqs]
:version = 0.018
-body = requires('B::Hooks::EndOfScope') if "$]" < '5.013008';
[MakeMaker::Awesome]
:version = 0.26
header = use lib 'inc';
header = use MMHelper;
view all matches for this distribution
view release on metacpan or search on metacpan
Test::LeakTrace = 0
Tie::Array = 0
[DynamicPrereqs]
:version = 0.029
-body = requires('List::SomeUtils::XS', '0.54') if !want_pp() and can_xs();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Log/Dispatch/Perl.pm view on Meta::CPAN
'' => sub { undef },
carp => $havecarp
? \&Carp::carp
: sub {
$havecarp ||= require Carp;
$ACTION2CODE{carp}= \&Carp::carp;
goto &Carp::carp;
},
cluck => $] < 5.008
? sub {
$havecarp ||= require Carp;
( my $m= Carp::longmess() )
=~ s#\s+Log::Dispatch::[^\n]+\n##sg;
return CORE::warn $_[0] . $m;
}
: sub {
$havecarp ||= require Carp;
return CORE::warn $_[0] . Carp::longmess();
},
confess => $] < 5.008
? sub {
$havecarp ||= require Carp;
( my $m = Carp::longmess() )
=~ s#\s+Log::Dispatch::[^\n]+\n##sg;
return CORE::die $_[0] . $m;
}
: sub {
$havecarp ||= require Carp;
return CORE::die $_[0] . Carp::longmess();
},
croak => $havecarp
? \&Carp::croak
: sub {
$havecarp ||= require Carp;
$ACTION2CODE{croak}= \&Carp::croak;
goto &Carp::croak;
},
die => sub { CORE::die @_ },
view all matches for this distribution
view release on metacpan or search on metacpan
[Prereqs / TestRecommends]
[EnsurePrereqsInstalled]
:version = 0.003
type = requires
type = recommends
[GitHub::Meta]
repo = git://github.com/robrwo/Log-Dispatch-TAP.git
view all matches for this distribution