gazer 0.3.12 → 0.3.13
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 +4 -4
- data/.github/CODEOWNERS +1 -0
- data/CHANGELOG.md +30 -0
- data/Gemfile.lock +1 -1
- data/lib/gzr/command.rb +19 -70
- data/lib/gzr/commands/alert/ls.rb +1 -4
- data/lib/gzr/commands/alert/notifications.rb +1 -4
- data/lib/gzr/commands/attribute/ls.rb +1 -4
- data/lib/gzr/commands/connection/dialects.rb +1 -4
- data/lib/gzr/commands/connection/ls.rb +1 -4
- data/lib/gzr/commands/connection/test.rb +1 -4
- data/lib/gzr/commands/folder/top.rb +3 -9
- data/lib/gzr/commands/group/ls.rb +1 -4
- data/lib/gzr/commands/group/member_groups.rb +1 -4
- data/lib/gzr/commands/group/member_users.rb +1 -4
- data/lib/gzr/commands/model/ls.rb +1 -4
- data/lib/gzr/commands/model/set/ls.rb +2 -5
- data/lib/gzr/commands/permission/ls.rb +1 -4
- data/lib/gzr/commands/permission/set/ls.rb +1 -8
- data/lib/gzr/commands/plan/failures.rb +2 -3
- data/lib/gzr/commands/plan/ls.rb +6 -4
- data/lib/gzr/commands/project/branch.rb +1 -4
- data/lib/gzr/commands/project/ls.rb +1 -4
- data/lib/gzr/commands/role/group_ls.rb +1 -6
- data/lib/gzr/commands/role/ls.rb +1 -6
- data/lib/gzr/commands/role/user_ls.rb +1 -6
- data/lib/gzr/commands/user/ls.rb +6 -5
- data/lib/gzr/commands/user/me.rb +3 -4
- data/lib/gzr/modules/dashboard.rb +1 -1
- data/lib/gzr/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dd0b164c1da440ba7b4225d7ef2e5e76def07d519cf04e35f61e5921e390e2b
|
4
|
+
data.tar.gz: 9333932c3246f59efcca4c7f85d2ef669fe0b0272d5188f474bed1f156f0c251
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a69c4d6c5e280859d6938b7b701b288df2b0cbdc7eb29ed79f33826bff414bc52ea991c83b502da058d7466663232e5a4a956b4c3f38979933a442677c0b4ec
|
7
|
+
data.tar.gz: 95c0e12dff593a12cae33eb50a99deed23fb3cc29dd8312c115d160b8f37deabc8bb6ad1e72e2de0b301a4a4a719c8b58ba0f1ec50d71dec0d2b7b78d3703c80
|
data/.github/CODEOWNERS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* @looker-open-source/cloud-looker-devrel
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,35 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.3.13](https://github.com/looker-open-source/gzr/compare/v0.3.12...v0.3.13) (2024-02-20)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* clean up eval code ([b478a45](https://github.com/looker-open-source/gzr/commit/b478a45327ddf1e48441e780c54ad280822d736c))
|
9
|
+
* remove eval from lib/gzr/commands/alert/ls.rb ([5a3e53a](https://github.com/looker-open-source/gzr/commit/5a3e53a528b9f05ff86716980f435c0225ecb6b5))
|
10
|
+
* remove eval from lib/gzr/commands/alert/notifications.rb ([1a06c3c](https://github.com/looker-open-source/gzr/commit/1a06c3ca9541e049f93ae9bb5eccb31d639437fa))
|
11
|
+
* remove eval from lib/gzr/commands/attribute/ls.rb ([5bc8051](https://github.com/looker-open-source/gzr/commit/5bc80514d88bfb344d90f1a736521354774c63f2))
|
12
|
+
* remove eval from lib/gzr/commands/connection/dialects.rb ([1a45294](https://github.com/looker-open-source/gzr/commit/1a45294a4e97f714c7d523d8bf6e8a01c5341380))
|
13
|
+
* remove eval from lib/gzr/commands/connection/ls.rb ([87e36f8](https://github.com/looker-open-source/gzr/commit/87e36f8223f9585938b9c33d06b18055f2f78de2))
|
14
|
+
* remove eval from lib/gzr/commands/connection/test.rb ([70f1e27](https://github.com/looker-open-source/gzr/commit/70f1e274cad6fa2506d07afb24f54ca6474e89de))
|
15
|
+
* remove eval from lib/gzr/commands/folder/top.rb ([42740d2](https://github.com/looker-open-source/gzr/commit/42740d23a4771ffb98e732322882104960dc5949))
|
16
|
+
* remove eval from lib/gzr/commands/group/ls.rb ([21e0169](https://github.com/looker-open-source/gzr/commit/21e016960f6c3e30885c830817a84c351c0e77c4))
|
17
|
+
* remove eval from lib/gzr/commands/group/member_groups.rb ([e4b20b3](https://github.com/looker-open-source/gzr/commit/e4b20b37a8935efd21a654ed88653f96ba87c446))
|
18
|
+
* remove eval from lib/gzr/commands/group/member_users.rb ([956ac4e](https://github.com/looker-open-source/gzr/commit/956ac4eb967266f9829a80f4f21d6b0cc9442577))
|
19
|
+
* remove eval from lib/gzr/commands/model/ls.rb ([8d23a68](https://github.com/looker-open-source/gzr/commit/8d23a687cc23fe4827ab6597054f6420a954513d))
|
20
|
+
* remove eval from lib/gzr/commands/model/set/ls.rb ([596f60a](https://github.com/looker-open-source/gzr/commit/596f60aaac0570874771aee5e12cdcb746a0fd8b))
|
21
|
+
* remove eval from lib/gzr/commands/permission/ls.rb ([b79897b](https://github.com/looker-open-source/gzr/commit/b79897b1915a9fb7dd265b27ba7c507af07dc620))
|
22
|
+
* remove eval from lib/gzr/commands/permission/set/ls.rb ([f47916d](https://github.com/looker-open-source/gzr/commit/f47916d396d8c01484d7d24f183b342736282f7f))
|
23
|
+
* remove eval from lib/gzr/commands/plan/failures.rb ([b912249](https://github.com/looker-open-source/gzr/commit/b9122494ff2f4dd2d9d5294df6f0900d5fd60983))
|
24
|
+
* remove eval from lib/gzr/commands/plan/ls.rb ([84e74f4](https://github.com/looker-open-source/gzr/commit/84e74f439f327fb8e4faa74dcc6d166a016573b2))
|
25
|
+
* remove eval from lib/gzr/commands/project/branch.rb ([2b36a27](https://github.com/looker-open-source/gzr/commit/2b36a2757e9edd0e7305ecc8dea2ff6ba01fc5c8))
|
26
|
+
* remove eval from lib/gzr/commands/project/ls.rb ([70e80d6](https://github.com/looker-open-source/gzr/commit/70e80d6253ced09fd9ec96918f8eed90f5f1d4c6))
|
27
|
+
* remove eval from lib/gzr/commands/role/group_ls.rb ([43dd2ec](https://github.com/looker-open-source/gzr/commit/43dd2eca15211bcf0032b006de71a9b85a225ba9))
|
28
|
+
* remove eval from lib/gzr/commands/role/ls.rb ([fae96e7](https://github.com/looker-open-source/gzr/commit/fae96e7c99fdd27d3bd141ae334eaa8cf6ba572b))
|
29
|
+
* remove eval from lib/gzr/commands/role/user_ls.rb ([6a53980](https://github.com/looker-open-source/gzr/commit/6a53980eb7a407bce9d163b6fb6264c03c64b623))
|
30
|
+
* remove eval from lib/gzr/commands/user/me.rb ([af070e3](https://github.com/looker-open-source/gzr/commit/af070e3b8f7aa4acbc11e3665b94a203c3a1962e))
|
31
|
+
* use query_slug in merge query api ([beb1524](https://github.com/looker-open-source/gzr/commit/beb152409d43032d45299cf4687031254d27872c))
|
32
|
+
|
3
33
|
## [0.3.12](https://github.com/looker-open-source/gzr/compare/v0.3.11...v0.3.12) (2023-10-04)
|
4
34
|
|
5
35
|
|
data/Gemfile.lock
CHANGED
data/lib/gzr/command.rb
CHANGED
@@ -400,78 +400,27 @@ module Gzr
|
|
400
400
|
end
|
401
401
|
|
402
402
|
##
|
403
|
-
# This method will accept
|
404
|
-
# and convert
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
# This version of field names yields an expression that can be evaluated against a hash structure
|
419
|
-
# like this one...
|
420
|
-
#
|
421
|
-
# data&.fetch(:a,nil)
|
422
|
-
# val1
|
423
|
-
# data&.fetch(:b,nil)
|
424
|
-
# val2
|
425
|
-
# data&.fetch(:c,nil)&.fetch(:d,nil)
|
426
|
-
# val3
|
427
|
-
# data&.fetch(:c,nil)&.fetch(:e,nil)&.fetch(:f,nil)
|
428
|
-
# val4
|
429
|
-
# data&.fetch(:c,nil)&.fetch(:e,nil)&.fetch(:g,nil)
|
430
|
-
# val5
|
431
|
-
# data&.fetch(:h,nil)
|
432
|
-
# val6
|
433
|
-
#
|
434
|
-
# data =
|
435
|
-
# {
|
436
|
-
# a: "val",
|
437
|
-
# b: "val",
|
438
|
-
# c: {
|
439
|
-
# d: "val",
|
440
|
-
# e: {
|
441
|
-
# f: "val",
|
442
|
-
# g: "val"
|
443
|
-
# }
|
444
|
-
# },
|
445
|
-
# h: "val"
|
446
|
-
# }
|
447
|
-
#
|
448
|
-
# field_names_hash(fields).each do |field|
|
449
|
-
# puts "data#{field}"
|
450
|
-
# puts eval "data#{field}"
|
451
|
-
# end
|
452
|
-
|
453
|
-
def field_names_hash(opt_fields)
|
454
|
-
fields = []
|
455
|
-
token_stack = []
|
456
|
-
last_token = false
|
457
|
-
tokens = opt_fields.split /(\(|,|\))/
|
458
|
-
tokens << nil
|
459
|
-
tokens.each do |t|
|
460
|
-
if t == '(' then
|
461
|
-
token_stack.push(last_token)
|
462
|
-
elsif t.nil? || t == ',' then
|
463
|
-
fields << "&.fetch(:#{(token_stack + [last_token]).join(',nil)&.fetch(:')},nil)" if last_token
|
464
|
-
elsif t.empty? then
|
465
|
-
next
|
466
|
-
elsif t == ')' then
|
467
|
-
fields << "&.fetch(:#{(token_stack + [last_token]).join(',nil)&.fetch(:')},nil)" if last_token
|
468
|
-
token_stack.pop
|
469
|
-
last_token = false
|
470
|
-
else
|
471
|
-
last_token = t
|
403
|
+
# This method will accept an array of field name expressions in a format like 'c.e.g'
|
404
|
+
# and convert each into the value of g, or nil if any intermediate value is nil.
|
405
|
+
|
406
|
+
def field_expressions_eval(expressions, data)
|
407
|
+
expressions.map do |exp|
|
408
|
+
nesting = exp.split('.')
|
409
|
+
current = data
|
410
|
+
while (nesting.length > 0) do
|
411
|
+
field = nesting.shift
|
412
|
+
if (current.kind_of?(Hash))
|
413
|
+
value = current.fetch(field.to_sym,nil)
|
414
|
+
current = value
|
415
|
+
else
|
416
|
+
current = nil
|
417
|
+
end
|
472
418
|
end
|
419
|
+
if current.kind_of? Array
|
420
|
+
current = current.join("\n")
|
421
|
+
end
|
422
|
+
current
|
473
423
|
end
|
474
|
-
fields
|
475
424
|
end
|
476
425
|
|
477
426
|
##
|
@@ -51,11 +51,8 @@ module Gzr
|
|
51
51
|
table_hash = Hash.new
|
52
52
|
fields = field_names(@options[:fields])
|
53
53
|
table_hash[:header] = fields unless @options[:plain]
|
54
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
55
54
|
table_hash[:rows] = data.map do |row|
|
56
|
-
|
57
|
-
eval "row#{e}"
|
58
|
-
end
|
55
|
+
field_expressions_eval(fields,row)
|
59
56
|
end
|
60
57
|
table = TTY::Table.new(table_hash)
|
61
58
|
alignments = fields.collect do |k|
|
@@ -49,11 +49,8 @@ module Gzr
|
|
49
49
|
table_hash = Hash.new
|
50
50
|
fields = field_names(@fields)
|
51
51
|
table_hash[:header] = fields unless @options[:plain]
|
52
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
53
52
|
table_hash[:rows] = data.map do |row|
|
54
|
-
|
55
|
-
eval "row#{e}"
|
56
|
-
end
|
53
|
+
field_expressions_eval(fields,row)
|
57
54
|
end
|
58
55
|
table = TTY::Table.new(table_hash)
|
59
56
|
alignments = fields.collect do |k|
|
@@ -48,11 +48,8 @@ module Gzr
|
|
48
48
|
table_hash = Hash.new
|
49
49
|
fields = field_names(@options[:fields])
|
50
50
|
table_hash[:header] = fields unless @options[:plain]
|
51
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
52
51
|
table_hash[:rows] = data.map do |row|
|
53
|
-
|
54
|
-
eval "row#{e}"
|
55
|
-
end
|
52
|
+
field_expressions_eval(fields,row)
|
56
53
|
end
|
57
54
|
table = TTY::Table.new(table_hash)
|
58
55
|
alignments = fields.collect do |k|
|
@@ -47,11 +47,8 @@ module Gzr
|
|
47
47
|
table_hash = Hash.new
|
48
48
|
fields = field_names(@options[:fields])
|
49
49
|
table_hash[:header] = data[0].keys unless @options[:plain]
|
50
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
51
50
|
table_hash[:rows] = data.map do |row|
|
52
|
-
|
53
|
-
eval "row#{e}"
|
54
|
-
end
|
51
|
+
field_expressions_eval(fields,row)
|
55
52
|
end
|
56
53
|
table = TTY::Table.new(table_hash)
|
57
54
|
alignments = fields.collect do |k|
|
@@ -47,11 +47,8 @@ module Gzr
|
|
47
47
|
table_hash = Hash.new
|
48
48
|
fields = field_names(@options[:fields])
|
49
49
|
table_hash[:header] = fields unless @options[:plain]
|
50
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
51
50
|
table_hash[:rows] = data.map do |row|
|
52
|
-
|
53
|
-
eval "row#{e}"
|
54
|
-
end
|
51
|
+
field_expressions_eval(fields,row)
|
55
52
|
end
|
56
53
|
table = TTY::Table.new(table_hash)
|
57
54
|
alignments = fields.collect do |k|
|
@@ -44,11 +44,8 @@ module Gzr
|
|
44
44
|
table_hash = Hash.new
|
45
45
|
fields = field_names(@options[:fields])
|
46
46
|
table_hash[:header] = fields unless @options[:plain]
|
47
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
48
47
|
table_hash[:rows] = data.map do |row|
|
49
|
-
|
50
|
-
eval "row#{e}"
|
51
|
-
end
|
48
|
+
field_expressions_eval(fields,row)
|
52
49
|
end
|
53
50
|
table = TTY::Table.new(table_hash)
|
54
51
|
alignments = fields.collect do |k|
|
@@ -50,16 +50,10 @@ module Gzr
|
|
50
50
|
table_hash = Hash.new
|
51
51
|
fields = field_names(@options[:fields])
|
52
52
|
table_hash[:header] = fields unless @options[:plain]
|
53
|
-
|
54
|
-
rows =
|
55
|
-
|
56
|
-
if ( h[:is_shared_root] || h[:is_users_root] || h[:is_embed_shared_root] || h[:is_embed_users_root] ) then
|
57
|
-
rows << expressions.collect do |e|
|
58
|
-
eval "h#{e}"
|
59
|
-
end
|
60
|
-
end
|
53
|
+
data = folders.select { |h| ( h[:is_shared_root] || h[:is_users_root] || h[:is_embed_shared_root] || h[:is_embed_users_root] )}
|
54
|
+
table_hash[:rows] = data.map do |row|
|
55
|
+
field_expressions_eval(fields,row)
|
61
56
|
end
|
62
|
-
table_hash[:rows] = rows
|
63
57
|
table = TTY::Table.new(table_hash)
|
64
58
|
begin
|
65
59
|
if @options[:csv] then
|
@@ -47,11 +47,8 @@ module Gzr
|
|
47
47
|
table_hash = Hash.new
|
48
48
|
fields = field_names(@options[:fields])
|
49
49
|
table_hash[:header] = fields unless @options[:plain]
|
50
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
51
50
|
table_hash[:rows] = data.map do |row|
|
52
|
-
|
53
|
-
eval "row#{e}"
|
54
|
-
end
|
51
|
+
field_expressions_eval(fields,row)
|
55
52
|
end
|
56
53
|
table = TTY::Table.new(table_hash)
|
57
54
|
alignments = fields.collect do |k|
|
@@ -48,11 +48,8 @@ module Gzr
|
|
48
48
|
table_hash = Hash.new
|
49
49
|
fields = field_names(@options[:fields])
|
50
50
|
table_hash[:header] = fields unless @options[:plain]
|
51
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
52
51
|
table_hash[:rows] = data.map do |row|
|
53
|
-
|
54
|
-
eval "row#{e}"
|
55
|
-
end
|
52
|
+
field_expressions_eval(fields,row)
|
56
53
|
end
|
57
54
|
table = TTY::Table.new(table_hash)
|
58
55
|
alignments = fields.collect do |k|
|
@@ -48,11 +48,8 @@ module Gzr
|
|
48
48
|
table_hash = Hash.new
|
49
49
|
fields = field_names(@options[:fields])
|
50
50
|
table_hash[:header] = fields unless @options[:plain]
|
51
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
52
51
|
table_hash[:rows] = data.map do |row|
|
53
|
-
|
54
|
-
eval "row#{e}"
|
55
|
-
end
|
52
|
+
field_expressions_eval(fields,row)
|
56
53
|
end
|
57
54
|
table = TTY::Table.new(table_hash)
|
58
55
|
alignments = fields.collect do |k|
|
@@ -47,11 +47,8 @@ module Gzr
|
|
47
47
|
table_hash = Hash.new
|
48
48
|
fields = field_names(@options[:fields])
|
49
49
|
table_hash[:header] = fields unless @options[:plain]
|
50
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
51
50
|
table_hash[:rows] = data.map do |row|
|
52
|
-
|
53
|
-
eval "row#{e}"
|
54
|
-
end
|
51
|
+
field_expressions_eval(fields,row)
|
55
52
|
end
|
56
53
|
table = TTY::Table.new(table_hash)
|
57
54
|
alignments = fields.collect do |k|
|
@@ -48,11 +48,8 @@ module Gzr
|
|
48
48
|
table_hash = Hash.new
|
49
49
|
fields = field_names(@options[:fields])
|
50
50
|
table_hash[:header] = fields unless @options[:plain]
|
51
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
52
51
|
table_hash[:rows] = data.map do |row|
|
53
|
-
|
54
|
-
eval "row#{e}"
|
55
|
-
end
|
52
|
+
field_expressions_eval(fields,row)
|
56
53
|
end
|
57
54
|
table = TTY::Table.new(table_hash)
|
58
55
|
alignments = fields.collect do |k|
|
@@ -62,7 +59,7 @@ module Gzr
|
|
62
59
|
if @options[:csv] then
|
63
60
|
output.puts render_csv(table)
|
64
61
|
else
|
65
|
-
output.puts table.render(if @options[:plain] then :basic else :ascii end, alignments: alignments, width: @options[:width] || TTY::Screen.width)
|
62
|
+
output.puts table.render(if @options[:plain] then :basic else :ascii end, multiline: true, alignments: alignments, width: @options[:width] || TTY::Screen.width)
|
66
63
|
end
|
67
64
|
end if table
|
68
65
|
end
|
@@ -49,11 +49,8 @@ module Gzr
|
|
49
49
|
table_hash = Hash.new
|
50
50
|
fields = field_names('permission,parent,description')
|
51
51
|
table_hash[:header] = fields unless @options[:plain]
|
52
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
53
52
|
table_hash[:rows] = data.map do |row|
|
54
|
-
|
55
|
-
eval "row#{e}"
|
56
|
-
end
|
53
|
+
field_expressions_eval(fields,row)
|
57
54
|
end
|
58
55
|
table = TTY::Table.new(table_hash)
|
59
56
|
alignments = fields.collect do |k|
|
@@ -48,15 +48,8 @@ module Gzr
|
|
48
48
|
table_hash = Hash.new
|
49
49
|
fields = field_names(@options[:fields])
|
50
50
|
table_hash[:header] = fields unless @options[:plain]
|
51
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
52
51
|
table_hash[:rows] = data.map do |row|
|
53
|
-
|
54
|
-
exp = eval "row#{e}"
|
55
|
-
if exp.kind_of? Array
|
56
|
-
exp = exp.join "\n"
|
57
|
-
end
|
58
|
-
exp
|
59
|
-
end
|
52
|
+
field_expressions_eval(fields,row)
|
60
53
|
end
|
61
54
|
table = TTY::Table.new(table_hash)
|
62
55
|
alignments = fields.collect do |k|
|
@@ -67,7 +67,6 @@ module Gzr
|
|
67
67
|
}
|
68
68
|
data = run_inline_query(query)
|
69
69
|
fields = query[:fields]
|
70
|
-
expressions = fields.collect { |f| "[:'#{f}']" }
|
71
70
|
begin
|
72
71
|
say_ok "No plans found in history"
|
73
72
|
return nil
|
@@ -80,8 +79,8 @@ module Gzr
|
|
80
79
|
next if row[:'scheduled_plan.id'] == prior_plan_id
|
81
80
|
prior_plan_id = row[:'scheduled_plan.id']
|
82
81
|
next if row[:'scheduled_job.status'] == 'success'
|
83
|
-
|
84
|
-
|
82
|
+
fields.collect do |f|
|
83
|
+
row.fetch(f.to_sym, nil)
|
85
84
|
end
|
86
85
|
end.compact
|
87
86
|
table = TTY::Table.new(table_hash)
|
data/lib/gzr/commands/plan/ls.rb
CHANGED
@@ -64,11 +64,9 @@ module Gzr
|
|
64
64
|
}
|
65
65
|
data = run_inline_query(query)
|
66
66
|
fields = query[:fields]
|
67
|
-
expressions = fields.collect { |f| "[:'#{f}']" }
|
68
67
|
else
|
69
68
|
data = query_all_scheduled_plans("all",@options[:fields])
|
70
69
|
fields = field_names(@options[:fields])
|
71
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
72
70
|
end
|
73
71
|
begin
|
74
72
|
say_ok "No plans found"
|
@@ -78,8 +76,12 @@ module Gzr
|
|
78
76
|
table_hash = Hash.new
|
79
77
|
table_hash[:header] = fields unless @options[:plain]
|
80
78
|
table_hash[:rows] = data.map do |row|
|
81
|
-
|
82
|
-
|
79
|
+
if @options[:disabled] then
|
80
|
+
fields.collect do |f|
|
81
|
+
row.fetch(f.to_sym, nil)
|
82
|
+
end
|
83
|
+
else
|
84
|
+
field_expressions_eval(fields,row)
|
83
85
|
end
|
84
86
|
end
|
85
87
|
table = TTY::Table.new(table_hash)
|
@@ -71,11 +71,8 @@ $ gzr session logout --token_file --host looker.example.com
|
|
71
71
|
table_hash = Hash.new
|
72
72
|
fields = field_names(@options[:fields])
|
73
73
|
table_hash[:header] = fields unless @options[:plain]
|
74
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
75
74
|
table_hash[:rows] = data.map do |row|
|
76
|
-
|
77
|
-
eval "row#{e}"
|
78
|
-
end
|
75
|
+
field_expressions_eval(fields,row)
|
79
76
|
end
|
80
77
|
table = TTY::Table.new(table_hash)
|
81
78
|
alignments = fields.collect do |k|
|
@@ -48,11 +48,8 @@ module Gzr
|
|
48
48
|
table_hash = Hash.new
|
49
49
|
fields = field_names(@options[:fields])
|
50
50
|
table_hash[:header] = fields unless @options[:plain]
|
51
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
52
51
|
table_hash[:rows] = data.map do |row|
|
53
|
-
|
54
|
-
eval "row#{e}"
|
55
|
-
end
|
52
|
+
field_expressions_eval(fields,row)
|
56
53
|
end
|
57
54
|
table = TTY::Table.new(table_hash)
|
58
55
|
alignments = fields.collect do |k|
|
@@ -48,13 +48,8 @@ module Gzr
|
|
48
48
|
table_hash = Hash.new
|
49
49
|
fields = field_names(@options[:fields])
|
50
50
|
table_hash[:header] = fields unless @options[:plain]
|
51
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
52
51
|
table_hash[:rows] = data.map do |row|
|
53
|
-
|
54
|
-
v = eval "row#{e}"
|
55
|
-
next (v.join "\n") if v.kind_of? Array
|
56
|
-
v
|
57
|
-
end
|
52
|
+
field_expressions_eval(fields,row)
|
58
53
|
end
|
59
54
|
table = TTY::Table.new(table_hash)
|
60
55
|
alignments = fields.collect do |k|
|
data/lib/gzr/commands/role/ls.rb
CHANGED
@@ -47,13 +47,8 @@ module Gzr
|
|
47
47
|
table_hash = Hash.new
|
48
48
|
fields = field_names(@options[:fields])
|
49
49
|
table_hash[:header] = fields unless @options[:plain]
|
50
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
51
50
|
table_hash[:rows] = data.map do |row|
|
52
|
-
|
53
|
-
v = eval "row#{e}"
|
54
|
-
next (v.join "\n") if v.kind_of? Array
|
55
|
-
v
|
56
|
-
end
|
51
|
+
field_expressions_eval(fields,row)
|
57
52
|
end
|
58
53
|
table = TTY::Table.new(table_hash)
|
59
54
|
alignments = fields.collect do |k|
|
@@ -48,13 +48,8 @@ module Gzr
|
|
48
48
|
table_hash = Hash.new
|
49
49
|
fields = field_names(@options[:fields])
|
50
50
|
table_hash[:header] = fields unless @options[:plain]
|
51
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
52
51
|
table_hash[:rows] = data.map do |row|
|
53
|
-
|
54
|
-
v = eval "row#{e}"
|
55
|
-
next (v.join "\n") if v.kind_of? Array
|
56
|
-
v
|
57
|
-
end
|
52
|
+
field_expressions_eval(fields,row)
|
58
53
|
end
|
59
54
|
table = TTY::Table.new(table_hash)
|
60
55
|
alignments = fields.collect do |k|
|
data/lib/gzr/commands/user/ls.rb
CHANGED
@@ -60,19 +60,20 @@ module Gzr
|
|
60
60
|
fields = field_names(@options[:fields])
|
61
61
|
fields.unshift 'last_login' if @options[:"last-login"]
|
62
62
|
table_hash[:header] = fields unless @options[:plain]
|
63
|
-
expressions = fields.collect { |fn| field_expression_hash(fn) }
|
64
63
|
table_hash[:rows] = data.map do |row|
|
65
|
-
|
66
|
-
|
67
|
-
|
64
|
+
new_row = field_expressions_eval(fields,row)
|
65
|
+
if @options[:"last-login"]
|
66
|
+
new_row.shift
|
67
|
+
new_row.unshift (credentials.map do |c|
|
68
68
|
obj = row.fetch(c.to_sym)
|
69
69
|
if obj.kind_of?(Array)
|
70
70
|
obj.collect { |e| e.fetch(:logged_in_at,nil)&.to_s }
|
71
71
|
else
|
72
72
|
obj&.fetch(:logged_in_at,nil)&.to_s
|
73
73
|
end
|
74
|
-
end.flatten.compact.max
|
74
|
+
end.flatten.compact.max)
|
75
75
|
end
|
76
|
+
new_row
|
76
77
|
end
|
77
78
|
table = TTY::Table.new(table_hash)
|
78
79
|
alignments = fields.collect do |k|
|
data/lib/gzr/commands/user/me.rb
CHANGED
@@ -44,10 +44,9 @@ module Gzr
|
|
44
44
|
table_hash = Hash.new
|
45
45
|
fields = field_names(@options[:fields])
|
46
46
|
table_hash[:header] = fields unless @options[:plain]
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
end]
|
47
|
+
table_hash[:rows] = [data].map do |row|
|
48
|
+
field_expressions_eval(fields,row)
|
49
|
+
end
|
51
50
|
|
52
51
|
table = TTY::Table.new(table_hash) if data
|
53
52
|
alignments = fields.collect do |k|
|
@@ -301,7 +301,7 @@ module Gzr
|
|
301
301
|
if merge_result
|
302
302
|
merge_result[:source_queries].each_index do |j|
|
303
303
|
source_query = merge_result[:source_queries][j]
|
304
|
-
merge_result[:source_queries][j][:query] = query(source_query[:query_id]).to_attrs
|
304
|
+
merge_result[:source_queries][j][:query] = query(source_query[:query_slug] || source_query[:query_id]).to_attrs
|
305
305
|
end
|
306
306
|
find_vis_config_reference(merge_result) do |vis_config|
|
307
307
|
find_color_palette_reference(vis_config) do |o,default_colors|
|
data/lib/gzr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gazer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike DeAngelo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-reader
|
@@ -258,6 +258,7 @@ executables:
|
|
258
258
|
extensions: []
|
259
259
|
extra_rdoc_files: []
|
260
260
|
files:
|
261
|
+
- ".github/CODEOWNERS"
|
261
262
|
- ".github/dependabot.yml"
|
262
263
|
- ".github/scripts/parse_version.sh"
|
263
264
|
- ".github/scripts/wait_for_looker.sh"
|