MuranoCLI 3.0.8 → 3.1.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/MrMurano/Logs.rb +13 -5
- data/lib/MrMurano/ProjectFile.rb +5 -4
- data/lib/MrMurano/SyncUpDown.rb +1 -47
- data/lib/MrMurano/commands/globals.rb +1 -0
- data/lib/MrMurano/commands/logs.rb +601 -206
- data/lib/MrMurano/commands/solution_picker.rb +11 -11
- data/lib/MrMurano/makePretty.rb +55 -28
- data/lib/MrMurano/version.rb +1 -1
- data/spec/fixtures/websocket/README.rst +110 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f37048d0f8e9d3ee210166e7f27240e01a465fb
|
4
|
+
data.tar.gz: 635efd3ce5432c2d7737464c4bd1c7cef8a3e3de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06aa8d4b6de186aeb2de85d7a68a42d733971b56db0153356c1d4b681c0bdb78708549d267db31317b20e968c6b5b6b92f9629bc66c88180852c415cb3da538b
|
7
|
+
data.tar.gz: ae8101e79d98a35c398461b7c8e0f9809c6af891e2d1181e0136b43bf54e48cb7ef0c7d62e4feb3e4b863608768b7d2391d97e2557c6f685d5276c5cf320ac9c
|
data/lib/MrMurano/Logs.rb
CHANGED
@@ -14,6 +14,11 @@ require 'MrMurano/verbosing'
|
|
14
14
|
module MrMurano
|
15
15
|
module Logs
|
16
16
|
class Follow
|
17
|
+
def initialize(query, limit=nil)
|
18
|
+
@query = query
|
19
|
+
@limit = limit
|
20
|
+
end
|
21
|
+
|
17
22
|
def run_event_loop(sol, &block)
|
18
23
|
# block_given?
|
19
24
|
@message_handler = block
|
@@ -30,13 +35,16 @@ module MrMurano
|
|
30
35
|
# FIXME/2017-12-12 (landonb): Which endpoint do we want?
|
31
36
|
# /events, or /all, or /logs??
|
32
37
|
uri = [
|
33
|
-
protocol + ':/', $cfg['net.host'], 'api:1', '
|
38
|
+
protocol + ':/', $cfg['net.host'], 'api:1', 'solution', sol.api_id, 'logs',
|
34
39
|
].join('/')
|
35
40
|
uri += %(?token=#{sol.token})
|
36
|
-
uri += %(&query
|
37
|
-
uri += %(&
|
38
|
-
#
|
39
|
-
#uri += %(&
|
41
|
+
uri += %(&query=#{@query}) unless @query.to_s.empty?
|
42
|
+
uri += %(&limit=#{@limit}) unless @limit.nil?
|
43
|
+
# MAYBE: (landonb): Add projection options? (Use for tracking exclusion.)
|
44
|
+
# uri += %(&projection={})
|
45
|
+
# MAYBE: (landonb): Add limit option? This is number
|
46
|
+
# of old log events to fetch first before streaming.
|
47
|
+
# uri += %(&limit=20)
|
40
48
|
uri
|
41
49
|
end
|
42
50
|
|
data/lib/MrMurano/ProjectFile.rb
CHANGED
@@ -120,7 +120,7 @@ module MrMurano
|
|
120
120
|
end
|
121
121
|
|
122
122
|
def new_meta
|
123
|
-
tname = $cfg['location.base'].basename.to_s.gsub(/[^A-Za-z0-9]/, '')
|
123
|
+
tname = Pathname.new($cfg['location.base']).basename.to_s.gsub(/[^A-Za-z0-9]/, '')
|
124
124
|
PrjMeta.new(
|
125
125
|
tname,
|
126
126
|
"One line summary of #{tname}",
|
@@ -137,7 +137,7 @@ module MrMurano
|
|
137
137
|
end
|
138
138
|
|
139
139
|
# Get the current Project file
|
140
|
-
# @return [Pathname]
|
140
|
+
# @return [Pathname] Path to current project file.
|
141
141
|
def project_file
|
142
142
|
@prj_file
|
143
143
|
end
|
@@ -174,6 +174,9 @@ module MrMurano
|
|
174
174
|
'assets.include' => 'files.searchFor',
|
175
175
|
'assets.exclude' => 'files.ignoring',
|
176
176
|
|
177
|
+
# (lb): As far as I can tell, code uses $cfg['files.default_page'],
|
178
|
+
# and never accesses the $project['assets.default_page'].
|
179
|
+
# Is this a bug?
|
177
180
|
'assets.default_page' => 'files.default_page',
|
178
181
|
|
179
182
|
'modules.location' => 'location.modules',
|
@@ -191,8 +194,6 @@ module MrMurano
|
|
191
194
|
'services.exclude' => 'eventhandler.ignoring',
|
192
195
|
|
193
196
|
'resources.location' => 'location.resources',
|
194
|
-
# EXPLAIN/2017-07-05: [lb] not finding either resources.include
|
195
|
-
# nor product.spec used anywhere.
|
196
197
|
'resources.include' => 'product.spec',
|
197
198
|
'resources.exclude' => 'product.ignoring',
|
198
199
|
}.freeze
|
data/lib/MrMurano/SyncUpDown.rb
CHANGED
@@ -202,63 +202,17 @@ module MrMurano
|
|
202
202
|
# @param local [Pathname] Full path of where to download to
|
203
203
|
# @param item [Item] The item to download
|
204
204
|
def update_mtime(local, item)
|
205
|
-
# FIXME/MUR-XXXX: Ideally, server should use a hash we can compare.
|
206
|
-
# For now, we use the sometimes set :updated_at value.
|
207
|
-
# FIXME/EXPLAIN/2017-06-23: Why is :updated_at sometimes not set?
|
208
|
-
# (See more comments, below.)
|
209
205
|
return unless item[:updated_at]
|
210
|
-
|
211
206
|
mod_time = item[:updated_at]
|
212
207
|
mod_time = Time.parse(mod_time) unless mod_time.is_a?(Time)
|
213
208
|
begin
|
214
209
|
FileUtils.touch([local.to_path], mtime: mod_time)
|
215
210
|
rescue Errno::EACCES => err
|
216
|
-
# This
|
217
|
-
require 'rbconfig'
|
218
|
-
# Check the platform, e.g., "linux-gnu", or other.
|
219
|
-
#is_windows = (
|
220
|
-
# RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
|
221
|
-
#)
|
211
|
+
# (lb): This is okay on Windows. (We really need a better solution.)
|
222
212
|
unless OS.windows?
|
223
213
|
msg = 'Unexpected: touch failed on non-Windows machine'
|
224
214
|
warn "#{msg} / host_os: #{RbConfig::CONFIG['host_os']} / err: #{err}"
|
225
215
|
end
|
226
|
-
|
227
|
-
# 2017-07-13: Nor does ctime work.
|
228
|
-
# Errno::EACCES:
|
229
|
-
# Permission denied @ utime_failed -
|
230
|
-
# C:/Users/ADMINI~1/AppData/Local/Temp/2/one.lua_remote_20170714-1856-by2nzk.lua
|
231
|
-
#File.utime(mod_time, mod_time, local.to_path)
|
232
|
-
|
233
|
-
# 2017-07-14: So this probably fails, too...
|
234
|
-
#FileUtils.touch [local.to_path,], :ctime => mod_time
|
235
|
-
|
236
|
-
# MAYBE/2017-07-14: How to make diff work on Windows?
|
237
|
-
# Would need to store timestamp in metafile?
|
238
|
-
|
239
|
-
# FIXME/EXPLAIN/2017-06-23: Why is :updated_at sometimes not set?
|
240
|
-
# And why have I only triggered this from ./spec/cmd_syncdown_spec.rb ?
|
241
|
-
# (Probably because nothing else makes routes or files?)
|
242
|
-
# Here are the items in question:
|
243
|
-
#
|
244
|
-
# Happens to each of the MrMurano::Webservice::Endpoint::RouteItem's:
|
245
|
-
#
|
246
|
-
# <MrMurano::Webservice::Endpoint::RouteItem:0x007fe719cb6300
|
247
|
-
# @id="QeRq21Cfij",
|
248
|
-
# @method="delete",
|
249
|
-
# @path="/api/fire/{code}",
|
250
|
-
# @content_type="application/json",
|
251
|
-
# @script="--#ENDPOINT delete /api/fire/{code}\nreturn 'ok'\n\n-- vim: set ai sw=2 ts=2 :\n",
|
252
|
-
# @use_basic_auth=false,
|
253
|
-
# @synckey="DELETE_/api/fire/{code}">
|
254
|
-
#
|
255
|
-
# Happens to each of the MrMurano::Webservice::File::FileItem's:
|
256
|
-
#
|
257
|
-
# <MrMurano::Webservice::File::FileItem:0x007fe71a44a8f0
|
258
|
-
# @path="/",
|
259
|
-
# @mime_type="text/html",
|
260
|
-
# @checksum="da39a3ee5e6b4b0d3255bfef95601890afd80709",
|
261
|
-
# @synckey="/">
|
262
216
|
end
|
263
217
|
end
|
264
218
|
|