haplo 2.2.2-java → 2.2.3-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/haplo.gemspec +2 -2
- data/lib/check.rb +2 -2
- data/lib/manifest.rb +1 -1
- data/lib/new_plugin.rb +2 -2
- data/lib/plugin.rb +1 -1
- data/lib/plugin_tool.rb +1 -1
- data/lib/syntax_checking.rb +12 -0
- data/lib/version.txt +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1208fad2d6e09f5e211febcbf66db8d7e001d4a5
|
4
|
+
data.tar.gz: db04bc4e201be9ac114b7ce0e5a443e157100ce5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a359b495e0434d0df43228ee04f12a4bc27e88046037f9b0c0c1849f34294710eeb86f980c8528ea4263c34fcd6888d393399570e984fca8ce4a1e950484b381
|
7
|
+
data.tar.gz: 65460374ff546f428de0493408a8c7d29d52244c7cc584499eb7f3a7ec9c95cc8e7981abd5c00f30038c6df994fee9dcf0bc83b3be1e7d6b1353cb1d493b5aa1
|
data/haplo.gemspec
CHANGED
@@ -3,8 +3,8 @@ Gem::Specification.new do |s|
|
|
3
3
|
files = Dir.glob("#{root_dir}/**/*.*").map { |x| x[root_dir.length + 1, x.length]}
|
4
4
|
|
5
5
|
s.name = 'haplo'
|
6
|
-
s.version = '2.2.
|
7
|
-
s.date = '2016-05-
|
6
|
+
s.version = '2.2.3'
|
7
|
+
s.date = '2016-05-30'
|
8
8
|
s.summary = "Haplo Plugin Tool"
|
9
9
|
s.description = "Development tools for developing Haplo plugins, see http://haplo.org"
|
10
10
|
s.licenses = ["MPL-2.0"]
|
data/lib/check.rb
CHANGED
@@ -37,7 +37,7 @@ module PluginTool
|
|
37
37
|
next unless File.file?(pathname)
|
38
38
|
next if plugin.exclude_files_from_syntax_check.include?(pathname)
|
39
39
|
plugin_relative_name = pathname[plugin_dir.length+1, pathname.length]
|
40
|
-
if pathname =~
|
40
|
+
if pathname =~ SYNTAX_CHECK_REGEXP
|
41
41
|
STDOUT.write("."); STDOUT.flush
|
42
42
|
# Check JavaScript
|
43
43
|
report = syntax_check_one_file(plugin, plugin_relative_name)
|
@@ -45,7 +45,7 @@ module PluginTool
|
|
45
45
|
check_file_result(plugin, plugin_relative_name, :OK)
|
46
46
|
else
|
47
47
|
puts "\n**** #{plugin_relative_name} has errors:\n#{report}\n"
|
48
|
-
check_file_result(plugin, plugin_relative_name, (plugin_relative_name =~ /\A(js|template)\//) ? :FAIL : :WARN)
|
48
|
+
check_file_result(plugin, plugin_relative_name, (plugin_relative_name =~ /\A(js|template|file)\//) ? :FAIL : :WARN)
|
49
49
|
end
|
50
50
|
else
|
51
51
|
# TODO: Checks for other file types, including the plugin.json
|
data/lib/manifest.rb
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
module PluginTool
|
9
9
|
|
10
|
-
PLUGIN_ACCEPTABLE_FILENAME = /\A(js|static|template|test|
|
10
|
+
PLUGIN_ACCEPTABLE_FILENAME = /\A(js|static|template|test|file)\/([A-Za-z0-9_-]+\/)*[A-Za-z0-9_-]+\.[A-Za-z0-9]+\z/
|
11
11
|
PLUGIN_ACCEPTABLE_FILENAME_EXCEPTIONS = ['plugin.json', 'requirements.schema', 'global.js', 'certificates-temp-http-api.pem', 'developer.json', 'readme.txt']
|
12
12
|
def self.plugin_filename_allowed?(filename)
|
13
13
|
(filename =~ PLUGIN_ACCEPTABLE_FILENAME) || (PLUGIN_ACCEPTABLE_FILENAME_EXCEPTIONS.include?(filename))
|
data/lib/new_plugin.rb
CHANGED
@@ -15,8 +15,8 @@ module PluginTool
|
|
15
15
|
end_on_error "File or directory #{plugin_name} already exists"
|
16
16
|
end
|
17
17
|
FileUtils.mkdir(plugin_name)
|
18
|
-
['js', 'static', 'template', 'test'].each do |dir|
|
19
|
-
FileUtils.
|
18
|
+
['js', 'static', 'template', 'test', 'file/form'].each do |dir|
|
19
|
+
FileUtils.mkdir_p("#{plugin_name}/#{dir}")
|
20
20
|
end
|
21
21
|
random = java.security.SecureRandom.new()
|
22
22
|
rbytes = Java::byte[20].new
|
data/lib/plugin.rb
CHANGED
@@ -186,7 +186,7 @@ module PluginTool
|
|
186
186
|
# Otherwise mark as a failed upload to stop an apply operation which will fail
|
187
187
|
upload_failed = true
|
188
188
|
end
|
189
|
-
PluginTool.syntax_check(self, filename) if filename =~
|
189
|
+
PluginTool.syntax_check(self, filename) if filename =~ SYNTAX_CHECK_REGEXP
|
190
190
|
end
|
191
191
|
end
|
192
192
|
if upload_failed
|
data/lib/plugin_tool.rb
CHANGED
@@ -18,7 +18,7 @@ PluginTool.try_load_custom
|
|
18
18
|
|
19
19
|
WORKSPACE_FILE = 'workspace.json'
|
20
20
|
LOCAL_ONLY_COMMANDS = {"license-key" => true, "pack" => true, "check" => true, "new" => true}
|
21
|
-
NO_DEPENDENCY_COMMANDS = LOCAL_ONLY_COMMANDS
|
21
|
+
NO_DEPENDENCY_COMMANDS = {"reset-db" => true}.merge(LOCAL_ONLY_COMMANDS)
|
22
22
|
PLUGIN_SEARCH_PATH = ['.']
|
23
23
|
|
24
24
|
# Options for passing to plugin objects
|
data/lib/syntax_checking.rb
CHANGED
@@ -7,6 +7,8 @@
|
|
7
7
|
|
8
8
|
module PluginTool
|
9
9
|
|
10
|
+
SYNTAX_CHECK_REGEXP = /\.(js|hsvt|json)\z/i
|
11
|
+
|
10
12
|
@@syntax_check_queue = []
|
11
13
|
@@syntax_check_queue_lock = Mutex.new
|
12
14
|
@@syntax_check_queue_semaphore = Mutex.new
|
@@ -46,6 +48,7 @@ module PluginTool
|
|
46
48
|
api_version = (plugin_json["apiVersion"] || '0').to_i
|
47
49
|
# Determine kind of file
|
48
50
|
return syntax_check_haplo_template(plugin, file) if file =~ /\.hsvt\z/i
|
51
|
+
return syntax_check_json_file(plugin, file) if file =~ /\.json\z/i
|
49
52
|
kind = (file =~ /\A(\w+)\//) ? $1 : file
|
50
53
|
# Is this file referenced?
|
51
54
|
report = nil
|
@@ -103,6 +106,15 @@ module PluginTool
|
|
103
106
|
end
|
104
107
|
PARSER_CONFIG = TemplateParserConfiguration.new
|
105
108
|
|
109
|
+
def self.syntax_check_json_file(plugin, file)
|
110
|
+
begin
|
111
|
+
JSON.parse(File.read("#{plugin.plugin_dir}/#{file}"))
|
112
|
+
nil
|
113
|
+
rescue => e
|
114
|
+
" #{e.message}"
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
106
118
|
def self.do_syntax_checking
|
107
119
|
init_syntax_checking
|
108
120
|
while(true)
|
data/lib/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
fc8a30a
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haplo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.3
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Haplo Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Development tools for developing Haplo plugins, see http://haplo.org
|
14
14
|
email: client.services@haplo-services.com
|