meshx-plugin-sdk 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/meshx-plugin-sdk.rb +12 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90cff424f122f71ddbd6c6c4438d00a02760a5816d8992105d2e21a51cd0d7b9
|
4
|
+
data.tar.gz: 19b91e23b767c2a6b6a770e7bbaae7af2253ae1f35a9b9d400da848379cd539d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0adbbdf1c528f17856bf4c81a0c865af4adb3d2c564f79ce44a9be082af4869098d4200924c8c45f36346076bb0167da403312b4c2152ddb6aecfd0bd4c86803
|
7
|
+
data.tar.gz: 25c47100d7b07ff088e5fd77ab9141d0d560f7fdd7d6c67ea37ce0bc5149fb9df6c04f8dd19687129d902cf3d492514fdd27aeda71195d8c15ec44d032e84495
|
data/lib/meshx-plugin-sdk.rb
CHANGED
@@ -119,7 +119,6 @@ class Controller
|
|
119
119
|
@log = Logger.new(STDOUT)
|
120
120
|
@config = Config.new()
|
121
121
|
@plugin = Plugin.new(@api, @log, @config)
|
122
|
-
@exit_run = false
|
123
122
|
end
|
124
123
|
|
125
124
|
def valid_json?(json)
|
@@ -130,11 +129,10 @@ class Controller
|
|
130
129
|
end
|
131
130
|
|
132
131
|
def run()
|
133
|
-
exit_run = false
|
132
|
+
@exit_run = false
|
134
133
|
begin
|
135
134
|
@log.info("calling on_init()")
|
136
135
|
@plugin.on_init()
|
137
|
-
@exit_run = @plugin.exit?()
|
138
136
|
rescue StandardError => e
|
139
137
|
@log.error("error calling on_init(): #{e.message}")
|
140
138
|
end
|
@@ -142,16 +140,15 @@ class Controller
|
|
142
140
|
begin
|
143
141
|
@log.info("calling on_start()")
|
144
142
|
@plugin.on_start()
|
145
|
-
|
143
|
+
|
146
144
|
rescue StandardError => e
|
147
145
|
@log.error("error calling on_start(): #{e.message}")
|
148
146
|
end
|
149
147
|
|
150
148
|
keep_reading = true
|
151
149
|
@log.info("starting controller loop")
|
152
|
-
while keep_reading && @
|
150
|
+
while keep_reading && (@api.get_exit() == false)
|
153
151
|
begin
|
154
|
-
@exit_run = @plugin.exit?()
|
155
152
|
rtn = @api.get_messages()
|
156
153
|
@log.info("rtn: #{rtn.message} #{rtn.error} #{rtn.exit_code}")
|
157
154
|
# convert message to fileevent
|
@@ -337,6 +334,15 @@ end
|
|
337
334
|
|
338
335
|
class FoundationApi
|
339
336
|
def initialize()
|
337
|
+
@exit = false
|
338
|
+
end
|
339
|
+
|
340
|
+
def exit()
|
341
|
+
@exit = true
|
342
|
+
end
|
343
|
+
|
344
|
+
def get_exit()
|
345
|
+
return @exit
|
340
346
|
end
|
341
347
|
|
342
348
|
def pase_response(response)
|