triglav-agent 1.0.0.pre2 → 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/docs/Triglav.html +1 -1
- data/docs/Triglav/Agent.html +2 -2
- data/docs/Triglav/Agent/ApiClient.html +82 -20
- data/docs/Triglav/Agent/ApiClient/AuthenticationError.html +1 -1
- data/docs/Triglav/Agent/ApiClient/ConnectionError.html +1 -1
- data/docs/Triglav/Agent/ApiClient/Error.html +1 -1
- data/docs/Triglav/Agent/Base.html +1 -1
- data/docs/Triglav/Agent/Base/CLI.html +21 -19
- data/docs/Triglav/Agent/Base/Connection.html +92 -6
- data/docs/Triglav/Agent/Base/Monitor.html +1 -1
- data/docs/Triglav/Agent/Base/Processor.html +22 -30
- data/docs/Triglav/Agent/Base/Setting.html +65 -63
- data/docs/Triglav/Agent/Base/Worker.html +1 -1
- data/docs/Triglav/Agent/Configuration.html +1 -1
- data/docs/Triglav/Agent/Error.html +1 -1
- data/docs/Triglav/Agent/HashUtil.html +1 -1
- data/docs/Triglav/Agent/LogFormatter.html +1 -1
- data/docs/Triglav/Agent/Logger.html +1 -1
- data/docs/Triglav/Agent/StorageFile.html +1 -1
- data/docs/Triglav/Agent/Timer.html +1 -1
- data/docs/Triglav/Agent/TooManyError.html +1 -1
- data/docs/_index.html +1 -1
- data/docs/file.LICENSE.html +2 -2
- data/docs/file.README.html +1 -1
- data/docs/index.html +1 -1
- data/docs/method_list.html +50 -34
- data/docs/top-level-namespace.html +1 -1
- data/lib/triglav/agent.rb +1 -0
- data/lib/triglav/agent/base/cli.rb +4 -2
- data/lib/triglav/agent/base/processor.rb +4 -1
- data/lib/triglav/agent/base/setting.rb +4 -2
- data/lib/triglav/agent/base/worker.rb +7 -0
- data/lib/triglav/agent/status.rb +68 -0
- data/lib/triglav/agent/storage_file.rb +20 -0
- data/lib/triglav/agent/version.rb +1 -1
- data/triglav-agent.gemspec +2 -2
- metadata +5 -4
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'triglav/agent/hash_util'
|
2
2
|
require 'yaml'
|
3
|
+
require 'set'
|
3
4
|
|
4
5
|
module Triglav::Agent
|
5
6
|
# Thread and inter-process safe YAML file storage
|
@@ -140,5 +141,24 @@ module Triglav::Agent
|
|
140
141
|
def dump(hash)
|
141
142
|
File.write(@fp.path, YAML.dump(hash))
|
142
143
|
end
|
144
|
+
|
145
|
+
# Keep specified keys, and remove others
|
146
|
+
#
|
147
|
+
# @param [String] path
|
148
|
+
# @param [Array] parent keys of hash
|
149
|
+
# @param [Array] keys
|
150
|
+
def self.select!(path, parents = [], keys)
|
151
|
+
open(path) do |fp|
|
152
|
+
params = fp.load
|
153
|
+
if dig = (parents.empty? ? params : params.dig(*parents))
|
154
|
+
removes = dig.keys - keys
|
155
|
+
unless removes.empty?
|
156
|
+
$logger.info { "Remove from status: #{{parent_keys: parents, keys: removes}}" }
|
157
|
+
removes.each {|k| dig.delete(k) }
|
158
|
+
end
|
159
|
+
end
|
160
|
+
fp.dump(params)
|
161
|
+
end
|
162
|
+
end
|
143
163
|
end
|
144
164
|
end
|
data/triglav-agent.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Triglav Team"]
|
10
10
|
spec.email = ["triglav_admin_my@dena.jp"]
|
11
11
|
|
12
|
-
spec.summary = %q{Agent framework
|
13
|
-
spec.description = %q{Agent framework
|
12
|
+
spec.summary = %q{Agent framework for triglav, data-driven workflow tool.}
|
13
|
+
spec.description = %q{Agent framework for triglav, data-driven workflow tool.}
|
14
14
|
spec.homepage = "https://github.com/triglav-dataflow/triglav-agent-framework-ruby"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: triglav-agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Triglav Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: serverengine
|
@@ -150,7 +150,7 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
-
description: Agent framework
|
153
|
+
description: Agent framework for triglav, data-driven workflow tool.
|
154
154
|
email:
|
155
155
|
- triglav_admin_my@dena.jp
|
156
156
|
executables: []
|
@@ -219,6 +219,7 @@ files:
|
|
219
219
|
- lib/triglav/agent/error.rb
|
220
220
|
- lib/triglav/agent/hash_util.rb
|
221
221
|
- lib/triglav/agent/logger.rb
|
222
|
+
- lib/triglav/agent/status.rb
|
222
223
|
- lib/triglav/agent/storage_file.rb
|
223
224
|
- lib/triglav/agent/timer.rb
|
224
225
|
- lib/triglav/agent/version.rb
|
@@ -246,5 +247,5 @@ rubyforge_project:
|
|
246
247
|
rubygems_version: 2.5.2
|
247
248
|
signing_key:
|
248
249
|
specification_version: 4
|
249
|
-
summary: Agent framework
|
250
|
+
summary: Agent framework for triglav, data-driven workflow tool.
|
250
251
|
test_files: []
|