vop 0.3.5 → 0.3.6
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.
- checksums.yaml +5 -5
- data/.github/workflows/ci.yml +39 -0
- data/.ruby-version +1 -0
- data/Gemfile.lock +34 -47
- data/README.md +118 -16
- data/bin/sidekiq.sh +10 -0
- data/exe/vop +2 -2
- data/lib/core/cache/cache.plugin +0 -0
- data/lib/core/cache/commands/invalidate_cache.rb +9 -0
- data/lib/core/{structure → meta}/commands/list_commands.rb +2 -1
- data/lib/core/meta/commands/list_filters.rb +3 -0
- data/lib/core/meta/commands/list_plugins.rb +3 -0
- data/lib/core/meta/commands/new_plugin.rb +3 -7
- data/lib/core/shell/commands/detail.rb +21 -0
- data/lib/core/shell/commands/edit.rb +5 -2
- data/lib/core/shell/commands/help.rb +1 -1
- data/lib/core/shell/commands/source.rb +10 -4
- data/lib/core/structure/commands/collect_contributions.rb +8 -2
- data/lib/core/structure/commands/generate_entity_commands.rb +19 -10
- data/lib/core/structure/commands/generate_invalidation_commands.rb +19 -9
- data/lib/core/structure/commands/list_contribution_targets.rb +9 -0
- data/lib/core/structure/commands/list_contributors.rb +1 -1
- data/lib/core/structure/structure.plugin +1 -1
- data/lib/vop/objects/chain.rb +6 -3
- data/lib/vop/objects/command.rb +14 -5
- data/lib/vop/objects/command_param.rb +22 -0
- data/lib/vop/objects/entities.rb +8 -8
- data/lib/vop/objects/entity.rb +57 -16
- data/lib/vop/objects/entity_definition.rb +22 -0
- data/lib/vop/objects/plugin.rb +46 -4
- data/lib/vop/objects/request.rb +9 -5
- data/lib/vop/parts/dependency_resolver.rb +0 -4
- data/lib/vop/parts/entity_loader.rb +0 -3
- data/lib/vop/parts/executor.rb +33 -8
- data/lib/vop/parts/plugin_finder.rb +6 -16
- data/lib/vop/search_path.rb +12 -0
- data/lib/vop/shell/shell.rb +134 -87
- data/lib/vop/shell/shell_formatter.rb +32 -17
- data/lib/vop/shell/shell_input_readline.rb +3 -0
- data/lib/vop/shell/shell_input_testable.rb +9 -3
- data/lib/vop/syntax/command_syntax.rb +22 -17
- data/lib/vop/syntax/entity_syntax.rb +21 -6
- data/lib/vop/syntax/plugin_syntax.rb +6 -0
- data/lib/vop/util/pluralizer.rb +9 -1
- data/lib/vop/version.rb +1 -1
- data/lib/vop/vop.rb +70 -44
- data/lib/vop.rb +11 -1
- data/vop.gemspec +8 -6
- metadata +103 -28
- data/lib/core/meta/commands/search_gems_for_plugins.rb +0 -38
- data/lib/core/meta/commands/search_path.rb +0 -6
- data/lib/core/structure/commands/list_plugins.rb +0 -3
- data/lib/vop/util/worker.rb +0 -24
data/lib/vop/vop.rb
CHANGED
@@ -10,7 +10,6 @@ require_relative "objects/entity"
|
|
10
10
|
require_relative "objects/entities"
|
11
11
|
require_relative "util/errors"
|
12
12
|
require_relative "util/pluralizer"
|
13
|
-
require_relative "util/worker"
|
14
13
|
|
15
14
|
module Vop
|
16
15
|
|
@@ -26,11 +25,16 @@ module Vop
|
|
26
25
|
attr_reader :filter_chain
|
27
26
|
|
28
27
|
attr_reader :finder, :loader, :sorter
|
28
|
+
attr_reader :search_path
|
29
|
+
attr_reader :load_status
|
30
|
+
|
31
|
+
@search_path = []
|
29
32
|
|
30
33
|
def initialize(options = {})
|
31
34
|
@options = {
|
32
35
|
config_path: "/etc/vop",
|
33
|
-
log_level: Logger::INFO
|
36
|
+
log_level: Logger::INFO,
|
37
|
+
no_init: false,
|
34
38
|
}.merge(options)
|
35
39
|
$logger.level = @options[:log_level]
|
36
40
|
|
@@ -42,6 +46,7 @@ module Vop
|
|
42
46
|
end
|
43
47
|
|
44
48
|
def clear
|
49
|
+
@load_status = {}
|
45
50
|
@plugins = []
|
46
51
|
@commands = {}
|
47
52
|
@entities = {}
|
@@ -53,6 +58,7 @@ module Vop
|
|
53
58
|
def _reset
|
54
59
|
clear
|
55
60
|
load
|
61
|
+
init unless @options[:no_init]
|
56
62
|
end
|
57
63
|
|
58
64
|
def to_s
|
@@ -79,30 +85,6 @@ module Vop
|
|
79
85
|
File.join(lib_path, "core")
|
80
86
|
end
|
81
87
|
|
82
|
-
def plugin_locations
|
83
|
-
result = []
|
84
|
-
|
85
|
-
# during development, we might find checkouts for "plugins" and "services"
|
86
|
-
# next to the core
|
87
|
-
vop_dir = Pathname.new(File.join(lib_path, "..", "..")).realpath
|
88
|
-
unless vop_dir.to_s.start_with? "/usr"
|
89
|
-
%w|plugins services|.each do |thing|
|
90
|
-
sibling_dir = File.join(vop_dir, thing)
|
91
|
-
result << sibling_dir
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
# for distribution packages (?)
|
96
|
-
result << "/usr/lib/vop-plugins"
|
97
|
-
|
98
|
-
# an extra path might have been passed in the options
|
99
|
-
if @options.has_key? :plugin_path
|
100
|
-
result << @options[:plugin_path]
|
101
|
-
end
|
102
|
-
|
103
|
-
result
|
104
|
-
end
|
105
|
-
|
106
88
|
def config_path
|
107
89
|
@options[:config_path]
|
108
90
|
end
|
@@ -111,17 +93,56 @@ module Vop
|
|
111
93
|
@plugin_config_path ||= File.join(config_path, "plugins.d")
|
112
94
|
end
|
113
95
|
|
96
|
+
def search_path_config_dir
|
97
|
+
@search_path_config_dir ||= File.join(config_path, "search_path.d")
|
98
|
+
end
|
99
|
+
|
114
100
|
def executor
|
115
101
|
@executor ||= Executor.new(self)
|
116
102
|
end
|
117
103
|
|
104
|
+
def search_path
|
105
|
+
unless @assembled_search_path
|
106
|
+
@assembled_search_path = self.class.search_path
|
107
|
+
unless ENV["VOP_IGNORE_PLUGINS"]
|
108
|
+
@assembled_search_path += Dir.glob("#{search_path_config_dir}/*").map { |x| File.readlink(x) }
|
109
|
+
end
|
110
|
+
end
|
111
|
+
@assembled_search_path
|
112
|
+
end
|
113
|
+
|
114
|
+
def unloaded
|
115
|
+
search_path.reject { |path| @load_status.key? path }
|
116
|
+
end
|
117
|
+
|
118
|
+
def load
|
119
|
+
load_from(core_location, { core: true })
|
120
|
+
load_from(@options[:plugin_path]) if @options.has_key?(:plugin_path)
|
121
|
+
|
122
|
+
while unloaded.any? do
|
123
|
+
unloaded.each do |path|
|
124
|
+
$logger.debug "loading from #{path}..."
|
125
|
+
load_from path
|
126
|
+
@load_status[path] = true
|
127
|
+
rescue => e
|
128
|
+
@load_status[path] = false
|
129
|
+
$logger.error "could not load plugins from #{path} : #{e.message}"
|
130
|
+
raise
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
# TODO: do we need this?
|
135
|
+
# call_global_hook :loading_finished
|
136
|
+
$logger.debug "loaded : #{@plugins.size} plugins, #{@commands.size} commands"
|
137
|
+
end
|
138
|
+
|
118
139
|
def load_from(locations, load_options = {})
|
119
140
|
found = finder.find(locations)
|
120
141
|
plugins = loader.load(found, load_options)
|
121
142
|
new_plugins = sorter.sort(plugins.loaded)
|
122
143
|
|
123
144
|
new_plugins.each do |plugin|
|
124
|
-
plugin.
|
145
|
+
plugin.load
|
125
146
|
self << plugin
|
126
147
|
end
|
127
148
|
|
@@ -129,14 +150,9 @@ module Vop
|
|
129
150
|
$logger.debug plugins.loaded.map(&:name)
|
130
151
|
end
|
131
152
|
|
132
|
-
def
|
133
|
-
|
134
|
-
|
135
|
-
load_from(search_path)
|
136
|
-
|
137
|
-
call_global_hook :loading_finished
|
138
|
-
|
139
|
-
$logger.info "init complete : #{@plugins.size} plugins, #{@commands.size} commands"
|
153
|
+
def init
|
154
|
+
@plugins.select(&:auto_load?).each(&:init)
|
155
|
+
call_global_hook :init_complete
|
140
156
|
end
|
141
157
|
|
142
158
|
def <<(stuff)
|
@@ -149,13 +165,14 @@ module Vop
|
|
149
165
|
@plugins << stuff
|
150
166
|
elsif stuff.is_a? EntityDefinition
|
151
167
|
entity = stuff
|
168
|
+
# TODO : auto-merge entities with the same name from multiple plugins?
|
152
169
|
@entities[entity.short_name] = stuff
|
153
170
|
elsif stuff.is_a? Command
|
154
171
|
command = stuff
|
155
172
|
unless command.dont_register
|
156
173
|
$logger.debug "registering #{command.name}"
|
157
174
|
if @commands.keys.include? command.short_name
|
158
|
-
$logger.
|
175
|
+
$logger.debug "overriding previous declaration of #{command.short_name}"
|
159
176
|
end
|
160
177
|
@commands[command.short_name] = stuff
|
161
178
|
|
@@ -186,6 +203,19 @@ module Vop
|
|
186
203
|
@hooks[hook_sym].each do |h|
|
187
204
|
h.call(payload)
|
188
205
|
end
|
206
|
+
|
207
|
+
@plugins.each do |plugin|
|
208
|
+
if plugin.has_hook? hook_sym
|
209
|
+
plugin.call_hook(hook_sym, payload)
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
def prepare_request(command_name, param_values = {}, extra = {}, origin_suffix = nil)
|
215
|
+
request = Request.new(self, command_name, param_values, extra)
|
216
|
+
request.origin = "#{@options[:origin]}"
|
217
|
+
request.origin += ":#{origin_suffix}" unless origin_suffix.nil?
|
218
|
+
request
|
189
219
|
end
|
190
220
|
|
191
221
|
def execute_request(request)
|
@@ -193,28 +223,24 @@ module Vop
|
|
193
223
|
begin
|
194
224
|
response = request.execute()
|
195
225
|
rescue => e
|
196
|
-
response =
|
226
|
+
response = Response.new(nil, {})
|
197
227
|
response.status = "error"
|
198
228
|
raise e
|
199
229
|
ensure
|
200
230
|
call_global_hook(:after_execute, { request: request, response: response })
|
201
231
|
end
|
202
232
|
|
203
|
-
#$logger.debug "executed : #{request.command.name}, response : #{response.pretty_inspect}"
|
204
233
|
response
|
205
234
|
end
|
206
235
|
|
207
236
|
def execute(command_name, param_values = {}, extra = {})
|
208
|
-
request =
|
237
|
+
request = prepare_request(command_name, param_values, extra)
|
209
238
|
response = execute_request(request)
|
210
|
-
|
211
239
|
response.result
|
212
240
|
end
|
213
241
|
|
214
|
-
def
|
215
|
-
|
242
|
+
def self.search_path
|
243
|
+
@search_path
|
216
244
|
end
|
217
|
-
|
218
245
|
end
|
219
|
-
|
220
246
|
end
|
data/lib/vop.rb
CHANGED
@@ -4,6 +4,13 @@ require_relative "vop/version"
|
|
4
4
|
require_relative "vop/shell/shell"
|
5
5
|
require_relative "vop/vop"
|
6
6
|
|
7
|
+
begin
|
8
|
+
require "vop-plugins"
|
9
|
+
rescue Exception => e
|
10
|
+
$stderr.puts "could not load plugins from gem : #{e.message}"
|
11
|
+
#raise
|
12
|
+
end
|
13
|
+
|
7
14
|
module Vop
|
8
15
|
|
9
16
|
def self.setup(options = {})
|
@@ -14,11 +21,14 @@ module Vop
|
|
14
21
|
if ENV["VOP_DEV_MODE"]
|
15
22
|
sibling_lib_dir = Pathname.new(File.join(File.dirname(__FILE__), "..", "lib")).realpath
|
16
23
|
if File.exists? sibling_lib_dir
|
17
|
-
#puts "adding local lib path #{sibling_lib_dir}"
|
18
24
|
$: << sibling_lib_dir
|
19
25
|
end
|
20
26
|
end
|
21
27
|
|
28
|
+
if ENV["VOP_ORIGIN"]
|
29
|
+
options[:origin] = "#{ENV["VOP_ORIGIN"]}:#{Process.pid}@#{`hostname`.strip}"
|
30
|
+
end
|
31
|
+
|
22
32
|
::Vop.setup(options)
|
23
33
|
end
|
24
34
|
|
data/vop.gemspec
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require "vop/version"
|
5
|
+
require "vop/search_path"
|
5
6
|
|
6
7
|
Gem::Specification.new do |spec|
|
7
8
|
spec.name = "vop"
|
@@ -20,15 +21,16 @@ Gem::Specification.new do |spec|
|
|
20
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
22
|
spec.require_paths = ["lib"]
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
Vop.gem_dependencies.each do |dep|
|
25
|
+
spec.add_dependency dep
|
26
|
+
end unless ENV["VOP_IGNORE_PLUGINS"]
|
27
|
+
|
28
|
+
spec.add_dependency "json", "~> 2.3"
|
27
29
|
spec.add_dependency "terminal-table"
|
28
30
|
spec.add_dependency "xml-simple"
|
31
|
+
spec.add_dependency "byebug"
|
29
32
|
|
30
|
-
spec.add_development_dependency "bundler", "~> 1.15"
|
31
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
32
33
|
spec.add_development_dependency "rspec", "~> 3.0"
|
34
|
+
spec.add_development_dependency "rake"
|
33
35
|
spec.add_development_dependency "simplecov"
|
34
36
|
end
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philipp T.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: redis
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: passgen
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: sidekiq
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: net-ssh
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: net-scp
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: ed25519
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -95,33 +95,89 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: bcrypt_pbkdf
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
104
|
-
type: :
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: vault
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: json
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
129
|
- - "~>"
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
118
|
-
type: :
|
131
|
+
version: '2.3'
|
132
|
+
type: :runtime
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
136
|
- - "~>"
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
138
|
+
version: '2.3'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: terminal-table
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: xml-simple
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: byebug
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
125
181
|
- !ruby/object:Gem::Dependency
|
126
182
|
name: rspec
|
127
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,6 +192,20 @@ dependencies:
|
|
136
192
|
- - "~>"
|
137
193
|
- !ruby/object:Gem::Version
|
138
194
|
version: '3.0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: rake
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
139
209
|
- !ruby/object:Gem::Dependency
|
140
210
|
name: simplecov
|
141
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -159,20 +229,26 @@ executables:
|
|
159
229
|
extensions: []
|
160
230
|
extra_rdoc_files: []
|
161
231
|
files:
|
232
|
+
- ".github/workflows/ci.yml"
|
162
233
|
- ".gitignore"
|
234
|
+
- ".ruby-version"
|
163
235
|
- Gemfile
|
164
236
|
- Gemfile.lock
|
165
237
|
- README.md
|
166
238
|
- Rakefile
|
167
239
|
- bin/console
|
168
240
|
- bin/setup
|
241
|
+
- bin/sidekiq.sh
|
169
242
|
- bin/vop.sh
|
170
243
|
- exe/vop
|
171
244
|
- lib/boot.rb
|
245
|
+
- lib/core/cache/cache.plugin
|
246
|
+
- lib/core/cache/commands/invalidate_cache.rb
|
247
|
+
- lib/core/meta/commands/list_commands.rb
|
248
|
+
- lib/core/meta/commands/list_filters.rb
|
249
|
+
- lib/core/meta/commands/list_plugins.rb
|
172
250
|
- lib/core/meta/commands/new_command.rb
|
173
251
|
- lib/core/meta/commands/new_plugin.rb
|
174
|
-
- lib/core/meta/commands/search_gems_for_plugins.rb
|
175
|
-
- lib/core/meta/commands/search_path.rb
|
176
252
|
- lib/core/meta/commands/set.rb
|
177
253
|
- lib/core/meta/commands/show.rb
|
178
254
|
- lib/core/meta/commands/show_config.rb
|
@@ -180,6 +256,7 @@ files:
|
|
180
256
|
- lib/core/meta/meta.plugin
|
181
257
|
- lib/core/shell/commands/change_loglevel.rb
|
182
258
|
- lib/core/shell/commands/clear_context.rb
|
259
|
+
- lib/core/shell/commands/detail.rb
|
183
260
|
- lib/core/shell/commands/edit.rb
|
184
261
|
- lib/core/shell/commands/help.rb
|
185
262
|
- lib/core/shell/commands/reset.rb
|
@@ -190,10 +267,9 @@ files:
|
|
190
267
|
- lib/core/structure/commands/disable_contributor.rb
|
191
268
|
- lib/core/structure/commands/generate_entity_commands.rb
|
192
269
|
- lib/core/structure/commands/generate_invalidation_commands.rb
|
193
|
-
- lib/core/structure/commands/
|
270
|
+
- lib/core/structure/commands/list_contribution_targets.rb
|
194
271
|
- lib/core/structure/commands/list_contributors.rb
|
195
272
|
- lib/core/structure/commands/list_entities.rb
|
196
|
-
- lib/core/structure/commands/list_plugins.rb
|
197
273
|
- lib/core/structure/commands/register_contributor.rb
|
198
274
|
- lib/core/structure/structure.plugin
|
199
275
|
- lib/vop.rb
|
@@ -215,6 +291,7 @@ files:
|
|
215
291
|
- lib/vop/parts/filter_loader.rb
|
216
292
|
- lib/vop/parts/plugin_finder.rb
|
217
293
|
- lib/vop/parts/plugin_loader.rb
|
294
|
+
- lib/vop/search_path.rb
|
218
295
|
- lib/vop/shell/shell.rb
|
219
296
|
- lib/vop/shell/shell_formatter.rb
|
220
297
|
- lib/vop/shell/shell_input.rb
|
@@ -226,14 +303,13 @@ files:
|
|
226
303
|
- lib/vop/syntax/plugin_syntax.rb
|
227
304
|
- lib/vop/util/errors.rb
|
228
305
|
- lib/vop/util/pluralizer.rb
|
229
|
-
- lib/vop/util/worker.rb
|
230
306
|
- lib/vop/version.rb
|
231
307
|
- lib/vop/vop.rb
|
232
308
|
- vop.gemspec
|
233
309
|
homepage: http://virtualop.org
|
234
310
|
licenses: []
|
235
311
|
metadata: {}
|
236
|
-
post_install_message:
|
312
|
+
post_install_message:
|
237
313
|
rdoc_options: []
|
238
314
|
require_paths:
|
239
315
|
- lib
|
@@ -248,9 +324,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
324
|
- !ruby/object:Gem::Version
|
249
325
|
version: '0'
|
250
326
|
requirements: []
|
251
|
-
|
252
|
-
|
253
|
-
signing_key:
|
327
|
+
rubygems_version: 3.3.7
|
328
|
+
signing_key:
|
254
329
|
specification_version: 4
|
255
330
|
summary: The vop is a scripting framework.
|
256
331
|
test_files: []
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require "rubygems"
|
2
|
-
require "find"
|
3
|
-
require "digest"
|
4
|
-
|
5
|
-
contribute to: "search_path" do |params|
|
6
|
-
gem_list = `gem list`.split("\n")
|
7
|
-
candidates = gem_list.select { |x| x =~ /vop-\w+/ }
|
8
|
-
|
9
|
-
# TODO cache which gems have already been inspected
|
10
|
-
# checksum = Digest::MD5.new
|
11
|
-
# candidates.map do |candidate|
|
12
|
-
# checksum << [ candidate.name, candidate.version ].join(":")
|
13
|
-
# end
|
14
|
-
# puts "gemspec md5 : #{checksum.hexdigest}"
|
15
|
-
|
16
|
-
result = []
|
17
|
-
|
18
|
-
candidates.each do |candidate|
|
19
|
-
$logger.debug "inspecting #{candidate}"
|
20
|
-
|
21
|
-
matched = /(.+?)\s+\([\d\.]+\)/.match(candidate)
|
22
|
-
unless matched
|
23
|
-
$logger.warn("unexpected line format : #{candidate}")
|
24
|
-
next
|
25
|
-
end
|
26
|
-
|
27
|
-
name = matched.captures.first
|
28
|
-
version = matched.captures.last
|
29
|
-
|
30
|
-
contents = `gem contents #{name}`.split("\n")
|
31
|
-
|
32
|
-
plugin_files = contents.grep /\.plugin$/
|
33
|
-
result += plugin_files.map do |file_name|
|
34
|
-
file_name.split("/")[0..-2].join("/")
|
35
|
-
end
|
36
|
-
end
|
37
|
-
result
|
38
|
-
end
|
data/lib/vop/util/worker.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require "sidekiq"
|
2
|
-
require "json"
|
3
|
-
|
4
|
-
module Vop
|
5
|
-
|
6
|
-
class AsyncExecutorWorker
|
7
|
-
include Sidekiq::Worker
|
8
|
-
|
9
|
-
def perform(request_json)
|
10
|
-
begin
|
11
|
-
op = ::Vop.boot
|
12
|
-
request = ::Vop::Request::from_json(op, request_json)
|
13
|
-
puts "performing #{request.pretty_inspect}"
|
14
|
-
response = op.execute_request(request)
|
15
|
-
puts "response : #{response.status}"
|
16
|
-
puts response.result
|
17
|
-
rescue => e
|
18
|
-
puts "[ERROR] #{e.message}\n#{e.backtrace.join("\n")}"
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|