oneis 1.0.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.txt +19 -0
- data/bin/oneis-plugin +37 -0
- data/lib/CertificateBundle.pem +1019 -0
- data/lib/check.rb +58 -0
- data/lib/hmac.rb +12 -0
- data/lib/js.jar +0 -0
- data/lib/js_min.js +38 -0
- data/lib/js_syntax_test.js +81 -0
- data/lib/jshint.js +4359 -0
- data/lib/manifest.rb +41 -0
- data/lib/minimise.rb +68 -0
- data/lib/misc.rb +8 -0
- data/lib/new_plugin.rb +91 -0
- data/lib/notifications.rb +69 -0
- data/lib/packing.rb +59 -0
- data/lib/plugin.rb +207 -0
- data/lib/plugin_tool.rb +159 -0
- data/lib/server.rb +131 -0
- data/lib/syntax_checking.rb +87 -0
- data/lib/uglifyjs/parse-js.js +1342 -0
- data/lib/uglifyjs/process.js +2011 -0
- data/lib/uglifyjs/squeeze-more.js +69 -0
- data/lib/usage.txt +72 -0
- data/lib/version.txt +1 -0
- data/lib/watchers.rb +39 -0
- data/oneis.gemspec +19 -0
- metadata +100 -0
@@ -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;
|
data/lib/usage.txt
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
|
2
|
+
Usage:
|
3
|
+
|
4
|
+
oneis-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
|
+
--minimise
|
17
|
+
When uploading templates and client side JavaScript to the server, minimise the files
|
18
|
+
to match the pre-deployment pre-processing. Use this for final testing before
|
19
|
+
submitting the plugin for review.
|
20
|
+
|
21
|
+
--no-console, -n
|
22
|
+
In development mode, don't connect to the server for notifications. This prevents the
|
23
|
+
output of console.log() being displayed in your local terminal window.
|
24
|
+
|
25
|
+
Commands:
|
26
|
+
|
27
|
+
develop (default command)
|
28
|
+
Developer mode. Push plugin to the specified server.
|
29
|
+
|
30
|
+
test [NAME]
|
31
|
+
Run the tests on the server, then report on the results.
|
32
|
+
This command does *not* upload changes to the plugin or tests to the server.
|
33
|
+
If the optional NAME argument is supplied, then only tests which have filenames
|
34
|
+
which include this string will be run.
|
35
|
+
|
36
|
+
new
|
37
|
+
Create a new plugin, with all the required directories and an example plugin.json file.
|
38
|
+
|
39
|
+
reset-db
|
40
|
+
Remove all the relational database tables on the server, then recreate them with the
|
41
|
+
current tables defined in the plugin.
|
42
|
+
|
43
|
+
uninstall
|
44
|
+
Uninstall the plugin from the server.
|
45
|
+
|
46
|
+
check
|
47
|
+
Perform checks on the plugin as a quick test before it's submitted for review.
|
48
|
+
|
49
|
+
license-key <application-id>
|
50
|
+
Generate a license key to allow plugin installation by a client. The numeric
|
51
|
+
application ID is displayed during plugin installation.
|
52
|
+
|
53
|
+
|
54
|
+
Running oneis-plugin without any arguments will find the plugin in the current directory and
|
55
|
+
run the 'develop' command.
|
56
|
+
|
57
|
+
To initialise a new plugin, run a command like
|
58
|
+
|
59
|
+
oneis-plugin -p example_plugin new
|
60
|
+
|
61
|
+
and then edit the generated files.
|
62
|
+
|
63
|
+
|
64
|
+
Requirements:
|
65
|
+
|
66
|
+
server.yaml - server configuration (hostname, authentication token)
|
67
|
+
server.crt - server's SSL certificate root (optional)
|
68
|
+
|
69
|
+
|
70
|
+
For more information, see http://docs.oneis.co.uk/dev/tool/plugin
|
71
|
+
|
72
|
+
|
data/lib/version.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
6a273e8b32
|
data/lib/watchers.rb
ADDED
@@ -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
|
data/oneis.gemspec
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
root_dir = File.dirname(__FILE__)
|
3
|
+
files = Dir.glob("#{root_dir}/**/*.*").map { |x| x[root_dir.length + 1, x.length]}
|
4
|
+
|
5
|
+
s.name = 'oneis'
|
6
|
+
s.version = '1.0.0'
|
7
|
+
s.date = '2012-10-24'
|
8
|
+
s.summary = "ONEIS Tools"
|
9
|
+
s.description = "ONEIS Developer Tools"
|
10
|
+
s.authors = ["ONEIS"]
|
11
|
+
s.email = 'client.services@oneis.co.uk'
|
12
|
+
s.platform = "java"
|
13
|
+
s.add_dependency('jruby-openssl', '>= 0.7.7')
|
14
|
+
s.add_dependency('json', '>= 1.6.6')
|
15
|
+
s.files = files
|
16
|
+
s.executables = ['oneis-plugin']
|
17
|
+
s.default_executable = 'oneis-plugin'
|
18
|
+
s.homepage = "http://docs.oneis.co.uk/dev/tool/plugin"
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: oneis
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 1.0.0
|
6
|
+
platform: java
|
7
|
+
authors:
|
8
|
+
- ONEIS
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2012-10-24 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: jruby-openssl
|
17
|
+
prerelease: false
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.7.7
|
24
|
+
type: :runtime
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: json
|
28
|
+
prerelease: false
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 1.6.6
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id002
|
37
|
+
description: ONEIS Developer Tools
|
38
|
+
email: client.services@oneis.co.uk
|
39
|
+
executables:
|
40
|
+
- oneis-plugin
|
41
|
+
extensions: []
|
42
|
+
|
43
|
+
extra_rdoc_files: []
|
44
|
+
|
45
|
+
files:
|
46
|
+
- oneis.gemspec
|
47
|
+
- README.txt
|
48
|
+
- lib/CertificateBundle.pem
|
49
|
+
- lib/check.rb
|
50
|
+
- lib/hmac.rb
|
51
|
+
- lib/js.jar
|
52
|
+
- lib/js_min.js
|
53
|
+
- lib/js_syntax_test.js
|
54
|
+
- lib/jshint.js
|
55
|
+
- lib/manifest.rb
|
56
|
+
- lib/minimise.rb
|
57
|
+
- lib/misc.rb
|
58
|
+
- lib/new_plugin.rb
|
59
|
+
- lib/notifications.rb
|
60
|
+
- lib/packing.rb
|
61
|
+
- lib/plugin.rb
|
62
|
+
- lib/plugin_tool.rb
|
63
|
+
- lib/server.rb
|
64
|
+
- lib/syntax_checking.rb
|
65
|
+
- lib/usage.txt
|
66
|
+
- lib/version.txt
|
67
|
+
- lib/watchers.rb
|
68
|
+
- lib/uglifyjs/parse-js.js
|
69
|
+
- lib/uglifyjs/process.js
|
70
|
+
- lib/uglifyjs/squeeze-more.js
|
71
|
+
- bin/oneis-plugin
|
72
|
+
homepage: http://docs.oneis.co.uk/dev/tool/plugin
|
73
|
+
licenses: []
|
74
|
+
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options: []
|
77
|
+
|
78
|
+
require_paths:
|
79
|
+
- lib
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: "0"
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
none: false
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: "0"
|
92
|
+
requirements: []
|
93
|
+
|
94
|
+
rubyforge_project:
|
95
|
+
rubygems_version: 1.8.15
|
96
|
+
signing_key:
|
97
|
+
specification_version: 3
|
98
|
+
summary: ONEIS Tools
|
99
|
+
test_files: []
|
100
|
+
|