haplo 2.1.0-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,69 @@
1
+ var jsp = require("./parse-js"),
2
+ pro = require("./process"),
3
+ slice = jsp.slice,
4
+ member = jsp.member,
5
+ curry = jsp.curry,
6
+ MAP = pro.MAP,
7
+ PRECEDENCE = jsp.PRECEDENCE,
8
+ OPERATORS = jsp.OPERATORS;
9
+
10
+ function ast_squeeze_more(ast) {
11
+ var w = pro.ast_walker(), walk = w.walk, scope;
12
+ function with_scope(s, cont) {
13
+ var save = scope, ret;
14
+ scope = s;
15
+ ret = cont();
16
+ scope = save;
17
+ return ret;
18
+ };
19
+ function _lambda(name, args, body) {
20
+ return [ this[0], name, args, with_scope(body.scope, curry(MAP, body, walk)) ];
21
+ };
22
+ return w.with_walkers({
23
+ "toplevel": function(body) {
24
+ return [ this[0], with_scope(this.scope, curry(MAP, body, walk)) ];
25
+ },
26
+ "function": _lambda,
27
+ "defun": _lambda,
28
+ "new": function(ctor, args) {
29
+ if (ctor[0] == "name") {
30
+ if (ctor[1] == "Array" && !scope.has("Array")) {
31
+ if (args.length != 1) {
32
+ return [ "array", args ];
33
+ } else {
34
+ return walk([ "call", [ "name", "Array" ], args ]);
35
+ }
36
+ } else if (ctor[1] == "Object" && !scope.has("Object")) {
37
+ if (!args.length) {
38
+ return [ "object", [] ];
39
+ } else {
40
+ return walk([ "call", [ "name", "Object" ], args ]);
41
+ }
42
+ } else if ((ctor[1] == "RegExp" || ctor[1] == "Function" || ctor[1] == "Error") && !scope.has(ctor[1])) {
43
+ return walk([ "call", [ "name", ctor[1] ], args]);
44
+ }
45
+ }
46
+ },
47
+ "call": function(expr, args) {
48
+ if (expr[0] == "dot" && expr[2] == "toString" && args.length == 0) {
49
+ // foo.toString() ==> foo+""
50
+ return [ "binary", "+", expr[1], [ "string", "" ]];
51
+ }
52
+ if (expr[0] == "name") {
53
+ if (expr[1] == "Array" && args.length != 1 && !scope.has("Array")) {
54
+ return [ "array", args ];
55
+ }
56
+ if (expr[1] == "Object" && !args.length && !scope.has("Object")) {
57
+ return [ "object", [] ];
58
+ }
59
+ if (expr[1] == "String" && !scope.has("String")) {
60
+ return [ "binary", "+", args[0], [ "string", "" ]];
61
+ }
62
+ }
63
+ }
64
+ }, function() {
65
+ return walk(pro.ast_add_scope(ast));
66
+ });
67
+ };
68
+
69
+ exports.ast_squeeze_more = ast_squeeze_more;
@@ -0,0 +1,81 @@
1
+
2
+ Usage:
3
+
4
+ haplo-plugin [OPTION] [COMMAND]
5
+
6
+ Options:
7
+
8
+ --help, -h
9
+ Display this message
10
+
11
+ --plugin, -p
12
+ Specify one or more plugin names, separated by commas, or ALL to specify all plugins
13
+ in the current directory. If not specified, and there's a single plugin in the current
14
+ directory, it will be selected automatically.
15
+
16
+ --server, -s [SUBSTRING]
17
+ For this run of the plugin tool, use the server containing the given substring.
18
+
19
+ --minimise
20
+ When uploading templates and client side JavaScript to the server, minimise the files
21
+ to match the pre-deployment pre-processing. Use this for final testing before
22
+ submitting the plugin for review.
23
+
24
+ --no-console, -n
25
+ In development mode, don't connect to the server for notifications. This prevents the
26
+ output of console.log() being displayed in your local terminal window.
27
+
28
+ Commands:
29
+
30
+ develop (default command)
31
+ Developer mode. Push plugin to the specified server.
32
+
33
+ auth [SERVER]
34
+ Authorise with server. SERVER can optionally include a non-default port number.
35
+
36
+ server [SUBSTRING]
37
+ Change the default server to the one containing the given substring.
38
+
39
+ test [NAME]
40
+ Run the tests on the server, then report on the results.
41
+ This command does *not* upload changes to the plugin or tests to the server.
42
+ If the optional NAME argument is supplied, then only tests which have filenames
43
+ which include this string will be run.
44
+
45
+ new
46
+ Create a new plugin, with all the required directories and an example plugin.json file.
47
+
48
+ reset-db
49
+ Remove all the relational database tables on the server, then recreate them with the
50
+ current tables defined in the plugin.
51
+
52
+ uninstall
53
+ Uninstall the plugin from the server.
54
+
55
+ check
56
+ Perform checks on the plugin as a quick test before it's submitted for review.
57
+
58
+ license-key <application-id>
59
+ Generate a license key to allow plugin installation by a client. The numeric
60
+ application ID is displayed during plugin installation.
61
+
62
+
63
+ Running haplo-plugin without any arguments will find the plugin in the current directory and
64
+ run the 'develop' command.
65
+
66
+ To initialise a new plugin, run a command like
67
+
68
+ haplo-plugin -p example_plugin new
69
+
70
+ and then edit the generated files.
71
+
72
+
73
+ If the server certificate does not use a known public CA, a alternative certificate can be
74
+ provided using a server.crt file in the current working directory. This may optionally contain
75
+ elements of the hostname, eg app.example.com would select the first file from:
76
+ server.app.example.com.crt server.example.com.crt server.com.crt server.crt
77
+
78
+
79
+ For more information, see http://docs.haplo.org/dev/tool/plugin
80
+
81
+
@@ -0,0 +1 @@
1
+ 830a73c2a9
@@ -0,0 +1,39 @@
1
+
2
+ module PluginTool
3
+
4
+ class WatcherPoll
5
+ def initialize(dirs)
6
+ @dirs = dirs
7
+ @last_contents = make_contents
8
+ end
9
+ def wait(timeout)
10
+ while timeout > 0
11
+ c = make_contents
12
+ if @last_contents != c
13
+ @last_contents = c
14
+ return
15
+ end
16
+ timeout -= 1
17
+ sleep 1
18
+ end
19
+ end
20
+ def make_contents
21
+ c = ''
22
+ @dirs.each do |dir|
23
+ Dir.glob("#{dir}/**/*").each do |file|
24
+ c << file
25
+ c << ":#{File.mtime(file).to_i}\n"
26
+ end
27
+ end
28
+ c
29
+ end
30
+ end
31
+
32
+ def self.make_watcher(dirs)
33
+ # TODO: Option to use external watcher task
34
+ # pipe = IO.popen(watcher_cmd)
35
+ # wait with pipe.read
36
+ WatcherPoll.new(dirs)
37
+ end
38
+
39
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: haplo
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.1.0
5
+ platform: java
6
+ authors:
7
+ - Haplo Services
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-01-04 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Development tools for developing Haplo plugins, see http://haplo.org
14
+ email: client.services@haplo-services.com
15
+ executables:
16
+ - haplo-plugin
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - README.txt
21
+ - bin/haplo-plugin
22
+ - haplo.gemspec
23
+ - lib/CertificateBundle.pem
24
+ - lib/auth.rb
25
+ - lib/check.rb
26
+ - lib/custom.rb
27
+ - lib/haplo-templates.jar
28
+ - lib/hmac.rb
29
+ - lib/js.jar
30
+ - lib/js_min.js
31
+ - lib/js_syntax_test.js
32
+ - lib/jshint.js
33
+ - lib/local_config.rb
34
+ - lib/manifest.rb
35
+ - lib/minimise.rb
36
+ - lib/misc.rb
37
+ - lib/new_plugin.rb
38
+ - lib/notifications.rb
39
+ - lib/packing.rb
40
+ - lib/plugin.rb
41
+ - lib/plugin_tool.rb
42
+ - lib/run.rb
43
+ - lib/schema_requirements.rb
44
+ - lib/server.rb
45
+ - lib/syntax_checking.rb
46
+ - lib/uglifyjs/parse-js.js
47
+ - lib/uglifyjs/process.js
48
+ - lib/uglifyjs/squeeze-more.js
49
+ - lib/usage.txt
50
+ - lib/version.txt
51
+ - lib/watchers.rb
52
+ homepage: http://docs.haplo.org/dev/tool/plugin
53
+ licenses:
54
+ - MPL-2.0
55
+ metadata: {}
56
+ post_install_message:
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ requirements: []
71
+ rubyforge_project:
72
+ rubygems_version: 2.4.8
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Haplo Plugin Tool
76
+ test_files: []