Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

erb

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

erb - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

1

lib/erb/getOpalScriptWithERBTemplate.js

@@ -15,3 +15,2 @@ var Promise = require('bluebird')

'../../ruby/opal-erb.js',
'../../ruby/corelib-string-unpack.js',
'../../ruby/json.js',

@@ -18,0 +17,0 @@ '../../ruby/base64.js',

2

lib/erb/runOpalScript.js

@@ -9,3 +9,3 @@ var vm = require('vm')

try {
var script = new vm.Script(opalScript);
var script = new vm.Script(opalScript)
script.runInContext(context, {

@@ -12,0 +12,0 @@ timeout: timeout,

@@ -6,13 +6,10 @@ /* global Opal */

Opal.loaded(['erb', 'json', 'base64'])
var script = Opal.Opal.ERB.$compile(Buffer.from('__TEMPLATE__', 'base64').toString('utf8'), 'mytemplate')
// eslint-disable-next-line no-eval
// eslint-disable-next-line
eval(script)
var ctx = Opal.Object.$new()
var ctx = Opal.get('Object').$new()
var json = Buffer.from('__FIELDS__', 'base64').toString('utf8')
var jsFields = JSON.parse(json)
var rubyFields = Opal.JSON.$parse(json)
var rubyFields = Opal.get('JSON').$parse(json)
Object.keys(jsFields).forEach(function (field) {

@@ -19,0 +16,0 @@ ctx.$instance_variable_set('@' + field, rubyFields['$[]'](field))

@@ -1,2 +0,2 @@

var maxArguments = 1024
var maxArguments = 39017

@@ -3,0 +3,0 @@ function validateObject (data, key) {

{
"name": "erb",
"version": "1.3.2",
"version": "1.3.3",
"description": "Compile a given Embedded RuBy (ERB) template using variables and functions defined in given a JavaScript object",

@@ -8,3 +8,3 @@ "main": "index.js",

"lint": "eslint test/ lib/",
"build": "bundle install --path vendor/bundle && mkdir -p ruby && bundle exec opal-build base64 > ruby/base64.js && bundle exec opal-build opal/compiler > ruby/opal-compiler.js && bundle exec opal-build corelib/string/unpack > ruby/corelib-string-unpack.js && bundle exec opal-build --stub erb opal/erb > ruby/opal-erb.js && bundle exec opal-build opal > ruby/opal.js && bundle exec opal-build json > ruby/json.js && bundle exec opal-build template > ruby/template.js",
"build": "bundle install --path vendor/bundle && mkdir -p ruby && bundle exec opal-build base64 > ruby/base64.js && bundle exec opal-build opal/compiler > ruby/opal-compiler.js && bundle exec opal-build opal/erb > ruby/opal-erb.js && bundle exec opal-build opal > ruby/opal.js && bundle exec opal-build json > ruby/json.js && bundle exec opal-build template > ruby/template.js",
"posttest": "npm run lint -s",

@@ -11,0 +11,0 @@ "pretest": "npm install -s && npm run build -s",

@@ -1,115 +0,175 @@

/* Generated by Opal 1.0.3 */
/* Generated by Opal 0.9.4 */
(function(Opal) {
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $hash2 = Opal.hash2, $truthy = Opal.truthy;
Opal.dynamic_require_severity = "error";
var OPAL_CONFIG = { method_missing: true, arity_check: false, freezing: true, tainting: true };
var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module;
Opal.add_stubs(['$raise', '$delete']);
return (function($base, $parent_nesting) {
var self = $module($base, 'Base64');
return (function($base) {
var $Base64, self = $Base64 = $module($base, 'Base64');
var $nesting = [self].concat($parent_nesting), $Base64_decode64$1, $Base64_encode64$2, $Base64_strict_decode64$3, $Base64_strict_encode64$4, $Base64_urlsafe_decode64$5, $Base64_urlsafe_encode64$6;
var def = self.$$proto, $scope = self.$$scope;
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
var encode, decode;
var charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
lookup = {};
// encoder
// [https://gist.github.com/999166] by [https://github.com/nignag]
encode = Opal.global.btoa || function (input) {
var str = String(input);
/* jshint ignore:start */
for (
// initialize result and counter
var block, charCode, idx = 0, map = chars, output = '';
// if the next str index does not exist:
// change the mapping table to "="
// check if d has no fractional digits
str.charAt(idx | 0) || (map = '=', idx % 1);
// "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8
output += map.charAt(63 & block >> 8 - idx % 1 * 8)
) {
charCode = str.charCodeAt(idx += 3/4);
if (charCode > 0xFF) {
self.$raise($$($nesting, 'ArgumentError'), "invalid character (failed: The string to be encoded contains characters outside of the Latin1 range.)");
for (var i = 0, length = charset.length; i < length; i++) {
lookup[charset.charAt(i)] = i;
}
function from(string) {
var buffer = [];
for (var i = 0, length = string.length; i < length; i++) {
var a, b, c, d;
a = lookup[string.charAt(i)];
b = lookup[string.charAt(++i)];
buffer.push((a << 2) | (b >> 4));
c = lookup[string.charAt(++i)];
if (c == 64) {
break;
}
block = block << 8 | charCode;
buffer.push(((b & 15) << 4) | (c >> 2));
d = lookup[string.charAt(++i)];
if (d == 64) {
break;
}
buffer.push(((c & 3) << 6) | d);
}
return output;
/* jshint ignore:end */
};
// decoder
// [https://gist.github.com/1020396] by [https://github.com/atk]
decode = Opal.global.atob || function (input) {
var str = String(input).replace(/=+$/, '');
if (str.length % 4 == 1) {
self.$raise($$($nesting, 'ArgumentError'), "invalid base64 (failed: The string to be decoded is not correctly encoded.)");
return buffer;
}
function decode(string) {
var buffer = from(string),
result = [], a, b, c;
for (var i = 0, length = buffer.length; i < length; i++) {
if (buffer[i] < 128) {
result.push(String.fromCharCode(buffer[i]));
}
else if (buffer[i] > 191 && buffer[i] < 224) {
a = (buffer[i] & 31) << 6;
b = buffer[++i] & 63;
result.push(String.fromCharCode(a | b));
}
else {
a = (buffer[i] & 15) << 12;
b = (buffer[++i] & 63) << 6;
c = buffer[++i] & 63;
result.push(String.fromCharCode(a | b | c));
}
}
/* jshint ignore:start */
for (
// initialize result and counters
var bc = 0, bs, buffer, idx = 0, output = '';
// get next character
buffer = str.charAt(idx++);
// character found in table? initialize bit storage and add its ascii value;
~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,
// and if not first of each 4 characters,
// convert the first 8 bits to one ascii character
bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0
) {
// try to find character in table (0-63, not found => -1)
buffer = chars.indexOf(buffer);
return result.join('');
}
function to(string) {
var buffer = [], i, length;
if (/^[\x00-\x7f]*$/.test(string)) {
for (i = 0, length = string.length; i < length; i++) {
buffer.push(string.charCodeAt(i));
}
}
return output;
/* jshint ignore:end */
};
;
Opal.defs(self, '$decode64', $Base64_decode64$1 = function $$decode64(string) {
else {
for (i = 0, length = string.length; i < length; i++) {
var ch = string.charCodeAt(i);
if (ch < 128) {
buffer.push(ch);
}
else if (ch < 2048) {
buffer.push((ch >> 6) | 192);
buffer.push((ch & 63) | 128);
}
else {
buffer.push((ch >> 12) | 224);
buffer.push(((ch >> 6) & 63) | 128);
buffer.push((ch & 63) | 128);
}
}
}
return buffer;
}
function encode(string) {
var buffer = to(string),
result = [];
for (var i = 0, length = buffer.length; i < length; i++) {
var a = buffer[i],
b = buffer[++i],
c = 0,
d = a >> 2,
e = ((a & 3) << 4) | (b >> 4),
f = 0,
g = 0;
if (isNaN(a)) {
f = g = 64;
}
else {
c = buffer[++i];
f = ((b & 15) << 2) | (c >> 6);
g = isNaN(c) ? 64 : c & 63;
}
result.push(charset.charAt(d));
result.push(charset.charAt(e));
result.push(charset.charAt(f));
result.push(charset.charAt(g));
}
return result.join('');
}
Opal.defs(self, '$decode64', function(string) {
var self = this;
return decode(string.replace(/\r?\n/g, ''));
}, $Base64_decode64$1.$$arity = 1);
Opal.defs(self, '$encode64', $Base64_encode64$2 = function $$encode64(string) {
});
Opal.defs(self, '$encode64', function(string) {
var self = this;
return encode(string).replace(/(.{60})/g, "$1\n").replace(/([^\n])$/g, "$1\n");
}, $Base64_encode64$2.$$arity = 1);
Opal.defs(self, '$strict_decode64', $Base64_strict_decode64$3 = function $$strict_decode64(string) {
return encode(string).replace(/(.{60})/g, "$1\n");
});
Opal.defs(self, '$strict_decode64', function(string) {
var self = this;
return decode(string);
}, $Base64_strict_decode64$3.$$arity = 1);
Opal.defs(self, '$strict_encode64', $Base64_strict_encode64$4 = function $$strict_encode64(string) {
});
Opal.defs(self, '$strict_encode64', function(string) {
var self = this;
return encode(string);
}, $Base64_strict_encode64$4.$$arity = 1);
Opal.defs(self, '$urlsafe_decode64', $Base64_urlsafe_decode64$5 = function $$urlsafe_decode64(string) {
});
Opal.defs(self, '$urlsafe_decode64', function(string) {
var self = this;
return decode(string.replace(/\-/g, '+').replace(/_/g, '/'));
}, $Base64_urlsafe_decode64$5.$$arity = 1);
Opal.defs(self, '$urlsafe_encode64', $Base64_urlsafe_encode64$6 = function $$urlsafe_encode64(string, $kwargs) {
var padding, self = this, str = nil;
});
if ($kwargs == null) {
$kwargs = $hash2([], {});
} else if (!$kwargs.$$is_hash) {
throw Opal.ArgumentError.$new('expected kwargs');
};
padding = $kwargs.$$smap["padding"];
if (padding == null) {
padding = true
};
str = encode(string).replace(/\+/g, '-').replace(/\//g, '_');
if ($truthy(padding)) {
} else {
str = str.$delete("=")
};
return str;
}, $Base64_urlsafe_encode64$6.$$arity = -2);
})($nesting[0], $nesting)
Opal.defs(self, '$urlsafe_encode64', function(string) {
var self = this;
return encode(string).replace(/\+/g, '-').replace(/\//g, '_');
});
})($scope.base)
})(Opal);

@@ -1,41 +0,17 @@

/* Generated by Opal 1.0.3 */
/* Generated by Opal 0.9.4 */
(function(Opal) {
function $rb_minus(lhs, rhs) {
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs);
}
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send, $hash2 = Opal.hash2, $truthy = Opal.truthy;
Opal.dynamic_require_severity = "error";
var OPAL_CONFIG = { method_missing: true, arity_check: false, freezing: true, tainting: true };
var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $hash2 = Opal.hash2, $klass = Opal.klass;
Opal.add_stubs(['$raise', '$new', '$push', '$[]=', '$-', '$[]', '$create_id', '$json_create', '$const_get', '$attr_accessor', '$create_id=', '$===', '$parse', '$generate', '$from_object', '$merge', '$to_json', '$responds_to?', '$to_io', '$write', '$to_s', '$to_a', '$strftime']);
(function($base, $parent_nesting) {
var self = $module($base, 'JSON');
Opal.add_stubs(['$new', '$push', '$[]=', '$[]', '$create_id', '$json_create', '$attr_accessor', '$create_id=', '$===', '$parse', '$generate', '$from_object', '$merge', '$to_json', '$responds_to?', '$to_io', '$write', '$to_s', '$to_a', '$strftime']);
(function($base) {
var $JSON, self = $JSON = $module($base, 'JSON');
var $nesting = [self].concat($parent_nesting), $JSON_$$$1, $JSON_parse$2, $JSON_parse$excl$3, $JSON_load$4, $JSON_from_object$5, $JSON_generate$6, $JSON_dump$7, $writer = nil;
var def = self.$$proto, $scope = self.$$scope, $a, $b;
(function($base, $super, $parent_nesting) {
var self = $klass($base, $super, 'JSONError');
var $parse = JSON.parse,
$hasOwn = Opal.hasOwnProperty;
var $nesting = [self].concat($parent_nesting);
return nil
})($nesting[0], $$($nesting, 'StandardError'), $nesting);
(function($base, $super, $parent_nesting) {
var self = $klass($base, $super, 'ParserError');
var $nesting = [self].concat($parent_nesting);
return nil
})($nesting[0], $$($nesting, 'JSONError'), $nesting);
var $hasOwn = Opal.hasOwnProperty;
function $parse(source) {
try {
return JSON.parse(source);
} catch (e) {
self.$raise($$$($$($nesting, 'JSON'), 'ParserError'), e.message);
}
};
function to_opal(value, options) {

@@ -74,8 +50,9 @@ var klass, arr, hash, i, ii, k;

if ($hasOwn.call(value, k)) {
(($writer = [k, to_opal(value[k], options)]), $send((hash), '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]);
(hash)['$[]='](k, to_opal(value[k], options));
}
}
if (!options.parse && (klass = (hash)['$[]']($$($nesting, 'JSON').$create_id())) != nil) {
return $$$('::', 'Object').$const_get(klass).$json_create(hash);
if (!options.parse && (klass = (hash)['$[]']($scope.get('JSON').$create_id())) != nil) {
klass = Opal.get(klass);
return (klass).$json_create(hash);
}

@@ -88,131 +65,122 @@ else {

};
;
(function(self, $parent_nesting) {
var $nesting = [self].concat($parent_nesting);
(function(self) {
var $scope = self.$$scope, def = self.$$proto;
return self.$attr_accessor("create_id")
})(Opal.get_singleton_class(self), $nesting);
$writer = ["json_class"];
$send(self, 'create_id=', Opal.to_a($writer));
$writer[$rb_minus($writer["length"], 1)];;
Opal.defs(self, '$[]', $JSON_$$$1 = function(value, options) {
var self = this;
})(Opal.get_singleton_class(self));
(($a = ["json_class"]), $b = self, $b['$create_id='].apply($b, $a), $a[$a.length-1]);
Opal.defs(self, '$[]', function(value, options) {
var $a, self = this;
if (options == null) {
options = $hash2([], {});
};
if ($truthy($$($nesting, 'String')['$==='](value))) {
options = $hash2([], {})
}
if ((($a = $scope.get('String')['$==='](value)) !== nil && (!$a.$$is_boolean || $a == true))) {
return self.$parse(value, options)
} else {
} else {
return self.$generate(value, options)
};
}, $JSON_$$$1.$$arity = -2);
Opal.defs(self, '$parse', $JSON_parse$2 = function $$parse(source, options) {
});
Opal.defs(self, '$parse', function(source, options) {
var self = this;
if (options == null) {
options = $hash2([], {});
};
options = $hash2([], {})
}
return self.$from_object($parse(source), options.$merge($hash2(["parse"], {"parse": true})));
}, $JSON_parse$2.$$arity = -2);
Opal.defs(self, '$parse!', $JSON_parse$excl$3 = function(source, options) {
});
Opal.defs(self, '$parse!', function(source, options) {
var self = this;
if (options == null) {
options = $hash2([], {});
};
options = $hash2([], {})
}
return self.$parse(source, options);
}, $JSON_parse$excl$3.$$arity = -2);
Opal.defs(self, '$load', $JSON_load$4 = function $$load(source, options) {
});
Opal.defs(self, '$load', function(source, options) {
var self = this;
if (options == null) {
options = $hash2([], {});
};
options = $hash2([], {})
}
return self.$from_object($parse(source), options);
}, $JSON_load$4.$$arity = -2);
Opal.defs(self, '$from_object', $JSON_from_object$5 = function $$from_object(js_object, options) {
var $a, self = this, $writer = nil;
});
Opal.defs(self, '$from_object', function(js_object, options) {
var $a, $b, $c, self = this;
if (options == null) {
options = $hash2([], {});
};
($truthy($a = options['$[]']("object_class")) ? $a : (($writer = ["object_class", $$($nesting, 'Hash')]), $send(options, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]));
($truthy($a = options['$[]']("array_class")) ? $a : (($writer = ["array_class", $$($nesting, 'Array')]), $send(options, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]));
return to_opal(js_object, options.$$smap);;
}, $JSON_from_object$5.$$arity = -2);
Opal.defs(self, '$generate', $JSON_generate$6 = function $$generate(obj, options) {
options = $hash2([], {})
}
($a = "object_class", $b = options, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, $scope.get('Hash'))));
($a = "array_class", $b = options, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, $scope.get('Array'))));
return to_opal(js_object, options.$$smap);
});
Opal.defs(self, '$generate', function(obj, options) {
var self = this;
if (options == null) {
options = $hash2([], {});
};
options = $hash2([], {})
}
return obj.$to_json(options);
}, $JSON_generate$6.$$arity = -2);
Opal.defs(self, '$dump', $JSON_dump$7 = function $$dump(obj, io, limit) {
var self = this, string = nil;
});
Opal.defs(self, '$dump', function(obj, io, limit) {
var $a, self = this, string = nil;
if (io == null) {
io = nil;
};
io = nil
}
if (limit == null) {
limit = nil;
};
limit = nil
}
string = self.$generate(obj);
if ($truthy(io)) {
if ($truthy(io['$responds_to?']("to_io"))) {
if (io !== false && io !== nil) {
if ((($a = io['$responds_to?']("to_io")) !== nil && (!$a.$$is_boolean || $a == true))) {
io = io.$to_io()};
io.$write(string);
return io;
} else {
} else {
return string
};
}, $JSON_dump$7.$$arity = -2);
})($nesting[0], $nesting);
(function($base, $super, $parent_nesting) {
var self = $klass($base, $super, 'Object');
});
})($scope.base);
(function($base, $super) {
function $Object(){};
var self = $Object = $klass($base, $super, 'Object', $Object);
var $nesting = [self].concat($parent_nesting), $Object_to_json$8;
var def = self.$$proto, $scope = self.$$scope;
return (Opal.def(self, '$to_json', $Object_to_json$8 = function $$to_json() {
return (Opal.defn(self, '$to_json', function() {
var self = this;
return self.$to_s().$to_json()
}, $Object_to_json$8.$$arity = 0), nil) && 'to_json'
})($nesting[0], null, $nesting);
(function($base, $parent_nesting) {
var self = $module($base, 'Enumerable');
return self.$to_s().$to_json();
}), nil) && 'to_json'
})($scope.base, null);
(function($base) {
var $Enumerable, self = $Enumerable = $module($base, 'Enumerable');
var $nesting = [self].concat($parent_nesting), $Enumerable_to_json$9;
var def = self.$$proto, $scope = self.$$scope;
Opal.def(self, '$to_json', $Enumerable_to_json$9 = function $$to_json() {
Opal.defn(self, '$to_json', function() {
var self = this;
return self.$to_a().$to_json()
}, $Enumerable_to_json$9.$$arity = 0)
})($nesting[0], $nesting);
(function($base, $super, $parent_nesting) {
var self = $klass($base, $super, 'Array');
return self.$to_a().$to_json();
})
})($scope.base);
(function($base, $super) {
function $Array(){};
var self = $Array = $klass($base, $super, 'Array', $Array);
var $nesting = [self].concat($parent_nesting), $Array_to_json$10;
var def = self.$$proto, $scope = self.$$scope;
return (Opal.def(self, '$to_json', $Array_to_json$10 = function $$to_json() {
return (Opal.defn(self, '$to_json', function() {
var self = this;

@@ -229,21 +197,23 @@

}, $Array_to_json$10.$$arity = 0), nil) && 'to_json'
})($nesting[0], null, $nesting);
(function($base, $super, $parent_nesting) {
var self = $klass($base, $super, 'Boolean');
}), nil) && 'to_json'
})($scope.base, null);
(function($base, $super) {
function $Boolean(){};
var self = $Boolean = $klass($base, $super, 'Boolean', $Boolean);
var $nesting = [self].concat($parent_nesting), $Boolean_to_json$11;
var def = self.$$proto, $scope = self.$$scope;
return (Opal.def(self, '$to_json', $Boolean_to_json$11 = function $$to_json() {
return (Opal.defn(self, '$to_json', function() {
var self = this;
return (self == true) ? 'true' : 'false';
}, $Boolean_to_json$11.$$arity = 0), nil) && 'to_json'
})($nesting[0], null, $nesting);
(function($base, $super, $parent_nesting) {
var self = $klass($base, $super, 'Hash');
}), nil) && 'to_json'
})($scope.base, null);
(function($base, $super) {
function $Hash(){};
var self = $Hash = $klass($base, $super, 'Hash', $Hash);
var $nesting = [self].concat($parent_nesting), $Hash_to_json$12;
var def = self.$$proto, $scope = self.$$scope;
return (Opal.def(self, '$to_json', $Hash_to_json$12 = function $$to_json() {
return (Opal.defn(self, '$to_json', function() {
var self = this;

@@ -268,63 +238,67 @@

return '{' + result.join(', ') + '}';
}, $Hash_to_json$12.$$arity = 0), nil) && 'to_json'
})($nesting[0], null, $nesting);
(function($base, $super, $parent_nesting) {
var self = $klass($base, $super, 'NilClass');
;
}), nil) && 'to_json'
})($scope.base, null);
(function($base, $super) {
function $NilClass(){};
var self = $NilClass = $klass($base, $super, 'NilClass', $NilClass);
var $nesting = [self].concat($parent_nesting), $NilClass_to_json$13;
var def = self.$$proto, $scope = self.$$scope;
return (Opal.def(self, '$to_json', $NilClass_to_json$13 = function $$to_json() {
return (Opal.defn(self, '$to_json', function() {
var self = this;
return "null"
}, $NilClass_to_json$13.$$arity = 0), nil) && 'to_json'
})($nesting[0], null, $nesting);
(function($base, $super, $parent_nesting) {
var self = $klass($base, $super, 'Numeric');
return "null";
}), nil) && 'to_json'
})($scope.base, null);
(function($base, $super) {
function $Numeric(){};
var self = $Numeric = $klass($base, $super, 'Numeric', $Numeric);
var $nesting = [self].concat($parent_nesting), $Numeric_to_json$14;
var def = self.$$proto, $scope = self.$$scope;
return (Opal.def(self, '$to_json', $Numeric_to_json$14 = function $$to_json() {
return (Opal.defn(self, '$to_json', function() {
var self = this;
return self.toString();
}, $Numeric_to_json$14.$$arity = 0), nil) && 'to_json'
})($nesting[0], null, $nesting);
(function($base, $super, $parent_nesting) {
var self = $klass($base, $super, 'String');
}), nil) && 'to_json'
})($scope.base, null);
(function($base, $super) {
function $String(){};
var self = $String = $klass($base, $super, 'String', $String);
var $nesting = [self].concat($parent_nesting);
var def = self.$$proto, $scope = self.$$scope;
return Opal.alias(self, "to_json", "inspect")
})($nesting[0], null, $nesting);
(function($base, $super, $parent_nesting) {
var self = $klass($base, $super, 'Time');
return Opal.alias(self, 'to_json', 'inspect')
})($scope.base, null);
(function($base, $super) {
function $Time(){};
var self = $Time = $klass($base, $super, 'Time', $Time);
var $nesting = [self].concat($parent_nesting), $Time_to_json$15;
var def = self.$$proto, $scope = self.$$scope;
return (Opal.def(self, '$to_json', $Time_to_json$15 = function $$to_json() {
return (Opal.defn(self, '$to_json', function() {
var self = this;
return self.$strftime("%FT%T%z").$to_json()
}, $Time_to_json$15.$$arity = 0), nil) && 'to_json'
})($nesting[0], null, $nesting);
return (function($base, $super, $parent_nesting) {
var self = $klass($base, $super, 'Date');
return self.$strftime("%FT%T%z").$to_json();
}), nil) && 'to_json'
})($scope.base, null);
return (function($base, $super) {
function $Date(){};
var self = $Date = $klass($base, $super, 'Date', $Date);
var $nesting = [self].concat($parent_nesting), $Date_to_json$16, $Date_as_json$17;
var def = self.$$proto, $scope = self.$$scope;
Opal.def(self, '$to_json', $Date_to_json$16 = function $$to_json() {
Opal.defn(self, '$to_json', function() {
var self = this;
return self.$to_s().$to_json()
}, $Date_to_json$16.$$arity = 0);
return (Opal.def(self, '$as_json', $Date_as_json$17 = function $$as_json() {
return self.$to_s().$to_json();
});
return (Opal.defn(self, '$as_json', function() {
var self = this;
return self.$to_s()
}, $Date_as_json$17.$$arity = 0), nil) && 'as_json';
})($nesting[0], null, $nesting);
return self.$to_s();
}), nil) && 'as_json';
})($scope.base, null);
})(Opal);

@@ -1,97 +0,91 @@

/* Generated by Opal 1.0.3 */
/* Generated by Opal 0.9.4 */
(function(Opal) {
function $rb_minus(lhs, rhs) {
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs);
}
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2, $truthy = Opal.truthy, $send = Opal.send;
Opal.dynamic_require_severity = "error";
var OPAL_CONFIG = { method_missing: true, arity_check: false, freezing: true, tainting: true };
var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2;
Opal.add_stubs(['$[]', '$[]=', '$-', '$keys', '$attr_reader', '$instance_exec', '$new', '$to_proc', '$<<', '$join']);
return (function($base, $super, $parent_nesting) {
var self = $klass($base, $super, 'Template');
Opal.add_stubs(['$[]', '$[]=', '$keys', '$attr_reader', '$instance_exec', '$to_proc', '$new', '$<<', '$join']);
return (function($base, $super) {
function $Template(){};
var self = $Template = $klass($base, $super, 'Template', $Template);
var $nesting = [self].concat($parent_nesting), $Template_$$$1, $Template_$$$eq$2, $Template_paths$3, $Template_initialize$4, $Template_inspect$5, $Template_render$6;
var def = self.$$proto, $scope = self.$$scope, TMP_1;
self.$$prototype.name = self.$$prototype.body = nil;
def.name = def.body = nil;
self._cache = $hash2([], {});
Opal.defs(self, '$[]', $Template_$$$1 = function(name) {
Opal.defs(self, '$[]', function(name) {
var $a, self = this;
if (self._cache == null) self._cache = nil;
return ($truthy($a = self._cache['$[]'](name)) ? $a : self._cache['$[]']("" + "templates/" + (name)))
}, $Template_$$$1.$$arity = 1);
Opal.defs(self, '$[]=', $Template_$$$eq$2 = function(name, instance) {
var self = this, $writer = nil;
return ((($a = self._cache['$[]'](name)) !== false && $a !== nil) ? $a : self._cache['$[]']("templates/" + (name)));
});
Opal.defs(self, '$[]=', function(name, instance) {
var self = this;
if (self._cache == null) self._cache = nil;
$writer = [name, instance];
$send(self._cache, '[]=', Opal.to_a($writer));
return $writer[$rb_minus($writer["length"], 1)];
}, $Template_$$$eq$2.$$arity = 2);
Opal.defs(self, '$paths', $Template_paths$3 = function $$paths() {
return self._cache['$[]='](name, instance);
});
Opal.defs(self, '$paths', function() {
var self = this;
if (self._cache == null) self._cache = nil;
return self._cache.$keys()
}, $Template_paths$3.$$arity = 0);
return self._cache.$keys();
});
self.$attr_reader("body");
Opal.def(self, '$initialize', $Template_initialize$4 = function $$initialize(name) {
var $iter = $Template_initialize$4.$$p, body = $iter || nil, $a, self = this, $writer = nil;
if ($iter) $Template_initialize$4.$$p = null;
if ($iter) $Template_initialize$4.$$p = null;;
$a = [name, body], (self.name = $a[0]), (self.body = $a[1]), $a;
$writer = [name, self];
$send($$($nesting, 'Template'), '[]=', Opal.to_a($writer));
return $writer[$rb_minus($writer["length"], 1)];;
}, $Template_initialize$4.$$arity = 1);
Opal.def(self, '$inspect', $Template_inspect$5 = function $$inspect() {
var self = this;
Opal.defn(self, '$initialize', TMP_1 = function(name) {
var $a, self = this, $iter = TMP_1.$$p, body = $iter || nil;
return "" + "#<Template: '" + (self.name) + "'>"
}, $Template_inspect$5.$$arity = 0);
Opal.def(self, '$render', $Template_render$6 = function $$render(ctx) {
TMP_1.$$p = null;
$a = [name, body], self.name = $a[0], self.body = $a[1], $a;
return $scope.get('Template')['$[]='](name, self);
});
Opal.defn(self, '$inspect', function() {
var self = this;
return "#<Template: '" + (self.name) + "'>";
});
Opal.defn(self, '$render', function(ctx) {
var $a, $b, self = this;
if (ctx == null) {
ctx = self;
};
return $send(ctx, 'instance_exec', [$$($nesting, 'OutputBuffer').$new()], self.body.$to_proc());
}, $Template_render$6.$$arity = -1);
return (function($base, $super, $parent_nesting) {
var self = $klass($base, $super, 'OutputBuffer');
ctx = self
}
return ($a = ($b = ctx).$instance_exec, $a.$$p = self.body.$to_proc(), $a).call($b, $scope.get('OutputBuffer').$new());
});
var $nesting = [self].concat($parent_nesting), $OutputBuffer_initialize$7, $OutputBuffer_append$8, $OutputBuffer_join$9;
return (function($base, $super) {
function $OutputBuffer(){};
var self = $OutputBuffer = $klass($base, $super, 'OutputBuffer', $OutputBuffer);
self.$$prototype.buffer = nil;
Opal.def(self, '$initialize', $OutputBuffer_initialize$7 = function $$initialize() {
var def = self.$$proto, $scope = self.$$scope;
def.buffer = nil;
Opal.defn(self, '$initialize', function() {
var self = this;
return (self.buffer = [])
}, $OutputBuffer_initialize$7.$$arity = 0);
Opal.def(self, '$append', $OutputBuffer_append$8 = function $$append(str) {
return self.buffer = [];
});
Opal.defn(self, '$append', function(str) {
var self = this;
return self.buffer['$<<'](str)
}, $OutputBuffer_append$8.$$arity = 1);
Opal.alias(self, "append=", "append");
return (Opal.def(self, '$join', $OutputBuffer_join$9 = function $$join() {
return self.buffer['$<<'](str);
});
Opal.alias(self, 'append=', 'append');
return (Opal.defn(self, '$join', function() {
var self = this;
return self.buffer.$join()
}, $OutputBuffer_join$9.$$arity = 0), nil) && 'join';
})($nesting[0], null, $nesting);
})($nesting[0], null, $nesting)
return self.buffer.$join();
}), nil) && 'join';
})($scope.base, null);
})($scope.base, null)
})(Opal);

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc