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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 190d565dbf232dd436f471739be9aefc29971fcf
4
- data.tar.gz: 0afe0ae84193295c0bd5ed7597f1586af5c7855a
3
+ metadata.gz: 1208fad2d6e09f5e211febcbf66db8d7e001d4a5
4
+ data.tar.gz: db04bc4e201be9ac114b7ce0e5a443e157100ce5
5
5
  SHA512:
6
- metadata.gz: 4e540d591d93b81d105ab3f8f3efa07ea05ad98a950de35c7bf8fd210fe8c9a6ab2f948a636b490692813dde5348eac80fa628aa73bb78f0fa6ce458c5ff7222
7
- data.tar.gz: 88e45b40016126f1a5cf38023c60ba72333b0f77017341a7752d9ca507b53162af5ca42414481ae518227d5d80de936a1d1a03ce2f883bedcb3403aec0c853bc
6
+ metadata.gz: a359b495e0434d0df43228ee04f12a4bc27e88046037f9b0c0c1849f34294710eeb86f980c8528ea4263c34fcd6888d393399570e984fca8ce4a1e950484b381
7
+ data.tar.gz: 65460374ff546f428de0493408a8c7d29d52244c7cc584499eb7f3a7ec9c95cc8e7981abd5c00f30038c6df994fee9dcf0bc83b3be1e7d6b1353cb1d493b5aa1
@@ -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.2'
7
- s.date = '2016-05-23'
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"]
@@ -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 =~ /\.(js|hsvt)\z/i
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
@@ -7,7 +7,7 @@
7
7
 
8
8
  module PluginTool
9
9
 
10
- PLUGIN_ACCEPTABLE_FILENAME = /\A(js|static|template|test|data)\/([A-Za-z0-9_-]+\/)*[A-Za-z0-9_-]+\.[A-Za-z0-9]+\z/
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))
@@ -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.mkdir("#{plugin_name}/#{dir}")
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
@@ -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 =~ /\.(js|hsvt)\z/i
189
+ PluginTool.syntax_check(self, filename) if filename =~ SYNTAX_CHECK_REGEXP
190
190
  end
191
191
  end
192
192
  if upload_failed
@@ -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.dup
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
@@ -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)
@@ -1 +1 @@
1
- b3aebf0
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.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-23 00:00:00.000000000 Z
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