oneis 2.0.1-java → 2.0.2-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,6 +23,7 @@ end
23
23
  require JS_JAR
24
24
 
25
25
  require "#{ONEIS_PLUGIN_ROOT_DIR}/lib/hmac.rb"
26
+ require "#{ONEIS_PLUGIN_ROOT_DIR}/lib/local_config.rb"
26
27
  require "#{ONEIS_PLUGIN_ROOT_DIR}/lib/manifest.rb"
27
28
  require "#{ONEIS_PLUGIN_ROOT_DIR}/lib/auth.rb"
28
29
  require "#{ONEIS_PLUGIN_ROOT_DIR}/lib/server.rb"
@@ -0,0 +1,28 @@
1
+
2
+ module PluginTool
3
+
4
+ module LocalConfig
5
+
6
+ LOCAL_CONFIG_FILENAME = "server.config.json"
7
+
8
+ def self.load
9
+ if File.exist? LOCAL_CONFIG_FILENAME
10
+ @@local_config = JSON.parse(File.open(LOCAL_CONFIG_FILENAME) { |f| f.read })
11
+ else
12
+ @@local_config = {}
13
+ end
14
+ end
15
+
16
+ def self.get_list(list_name)
17
+ lookup = @@local_config[list_name]
18
+ return [] unless lookup
19
+ list = []
20
+ server_name = PluginTool.get_server_hostname
21
+ list.concat(lookup['*']) if lookup.has_key?('*')
22
+ list.concat(lookup[server_name]) if server_name && lookup.has_key?(server_name)
23
+ list
24
+ end
25
+
26
+ end
27
+
28
+ end
@@ -8,6 +8,8 @@ File.open("#{File.dirname(__FILE__)}/version.txt") do |f|
8
8
  puts "ONEIS Plugin Tool (#{f.read.chomp})"
9
9
  end
10
10
 
11
+ PluginTool::LocalConfig.load
12
+
11
13
  # Commands not needing server
12
14
  LOCAL_ONLY_COMMANDS = {"license-key" => true, "pack" => true, "check" => true}
13
15
 
@@ -54,6 +56,8 @@ end
54
56
  PLUGIN_TOOL_COMMAND = (ARGV.shift || 'develop')
55
57
  options.args = ARGV
56
58
 
59
+ automatic_plugin_exclusion = false
60
+
57
61
  # Help message?
58
62
  if show_help || PLUGIN_TOOL_COMMAND == 'help'
59
63
  puts File.open("#{File.dirname(__FILE__)}/usage.txt") { |f| f.read }
@@ -73,6 +77,7 @@ end
73
77
 
74
78
  if plugin_names.length == 1 && plugin_names[0] == 'ALL'
75
79
  plugin_names = find_all_plugins()
80
+ automatic_plugin_exclusion = true
76
81
  end
77
82
 
78
83
  # Some commands don't require a server or plugin to be specified
@@ -131,7 +136,19 @@ end
131
136
  unless LOCAL_ONLY_COMMANDS[PLUGIN_TOOL_COMMAND]
132
137
  PluginTool.setup_auth(options)
133
138
  PluginTool.check_for_certificate_file
134
- # Ask plugins to set themselves up
139
+
140
+ if automatic_plugin_exclusion
141
+ exclusions = PluginTool::LocalConfig.get_list("exclude")
142
+ plugins = plugins.select do |plugin|
143
+ if exclusions.include?(plugin.name)
144
+ puts "NOTICE: Excluded plugin #{plugin.name}"
145
+ false
146
+ else
147
+ true
148
+ end
149
+ end
150
+ end
151
+
135
152
  plugins.each { |p| p.setup_for_server }
136
153
  end
137
154
 
@@ -7,6 +7,10 @@ module PluginTool
7
7
  @@server_key = key
8
8
  end
9
9
 
10
+ def self.get_server_hostname
11
+ @@server_hostname
12
+ end
13
+
10
14
  def self.check_for_certificate_file
11
15
  @@server_ca = nil
12
16
  hostname_parts = (@@server_hostname || '').split('.')
@@ -1 +1 @@
1
- c7c8ef009b
1
+ 0aa65198b7
@@ -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 = 'oneis'
6
- s.version = '2.0.1'
7
- s.date = '2015-01-05'
6
+ s.version = '2.0.2'
7
+ s.date = '2015-01-09'
8
8
  s.summary = "ONEIS Tools"
9
9
  s.description = "ONEIS Developer Tools"
10
10
  s.authors = ["ONEIS"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: oneis
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.0.1
5
+ version: 2.0.2
6
6
  platform: java
7
7
  authors:
8
8
  - ONEIS
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2015-01-05 00:00:00 Z
13
+ date: 2015-01-09 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: jruby-openssl
@@ -53,6 +53,7 @@ files:
53
53
  - lib/js_min.js
54
54
  - lib/js_syntax_test.js
55
55
  - lib/jshint.js
56
+ - lib/local_config.rb
56
57
  - lib/manifest.rb
57
58
  - lib/minimise.rb
58
59
  - lib/misc.rb