This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Parser.addOption("-i", "--init") | |
.action("set") | |
.destination("init") | |
.defaultValue(false) | |
.type(Boolean) | |
.help("Init repository if it doesn't exist"); | |
Parser.addOption("-i", "--init", { | |
action: "set", | |
destination: "init", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Token = org.mozilla.javascript.Token; | |
function parse(source, name) { | |
var exportedFunction; | |
var exportedName; | |
var exported = []; | |
var jsdocs = []; | |
var seen = {}; | |
var checkAssignment = function(node, root, exported) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
helma> var Parser = require('helma/args').Parser; | |
helma> var p = new Parser(); | |
helma> p.addOption("s", "silent", null, "Ignore errors and warnings") | |
helma> p.addOption("x", "extend", "FOO", "Extend core functionality using FOO") | |
helma> p.addOption("v", "verbose", null, "Be verbose") | |
helma> p.help() | |
-s --silent Ignore errors and warnings | |
-x --extend FOO Extend core functionality using FOO | |
-v --verbose Be verbose | |
helma> var args = ["-s", "-x", "foo"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.app = function myAsyncApp(request){ | |
return function(responder) { | |
responder.init(200, {}); | |
var i = 0; | |
var intervalId = setInterval(function(){ | |
responder.write("Every second another message"); | |
if(i++ == 10){ | |
responder.close(); | |
clearInterval(intervalId); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Apache Maven 2 POM generated by Apache Ivy | |
http://ant.apache.org/ivy/ | |
Apache Ivy version: 2.1.0 20090925235825 | |
--> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/org/ringojs/wrappers/Storable.java b/src/org/ringojs/wrappers/Storable.java | |
index 2ee3055..302fa40 100644 | |
--- a/src/org/ringojs/wrappers/Storable.java | |
+++ b/src/org/ringojs/wrappers/Storable.java | |
@@ -70,7 +70,7 @@ public class Storable extends ScriptableObject { | |
} | |
@JSStaticFunction | |
- public static Scriptable defineClass(Scriptable store, String type) | |
+ public static Scriptable defineClass(Scriptable store, String type, Object mapping) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Test for Ringo's new async HTTP client with streaming Twitter API | |
// | |
// NOTE: I started working on a package for asynchronous JSON parsing that contains | |
// a better working version of this script: http://github.com/hns/jetson | |
// | |
// Run with: | |
// ringo twitterstream.js KEYWORD[,KEYWORD] | |
// needs valid user credentials | |
var username = "user"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include('ringo/scheduler'); | |
exports.app2 = function myAsyncApp(request){ | |
// Sends a message once a second 10 times | |
var progress, finished; | |
var i = 0; | |
var intervalId = setInterval(function(){ | |
i++; | |
progress({ | |
status: 200, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var {setTimeout} = require("ringo/scheduler"); | |
export("defer"); | |
var NEW = 0; | |
var FULFILLED = 1; | |
var FAILED = 2; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var map = { | |
base: "basename", | |
changeWorkingDirectory: "chdir", | |
workingDirectory: "cwd", | |
directory: "dirname", | |
makeDirectory: "mkdir", | |
makeTree: "mkdirs", | |
lastModified: "mtime", | |
removeDirectory: "rmdir", |
OlderNewer