gazer 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8353db2512a7ffe580a29ee37366871008368b6398d458fbc544eb5eca2e0e48
4
- data.tar.gz: 32c1c523488511675f82106447f2d78572322399548894eb35bf9fb882358b20
3
+ metadata.gz: 81947b24215954962cc0a753f2f021ab1b2bc23c59be970f48ba3f756b893521
4
+ data.tar.gz: 5b7017d8e67c99e807f6cf2efb93cc6e02371b37b4db00b7467e1afc8cef6fe6
5
5
  SHA512:
6
- metadata.gz: c5cdda279be77bb67a70ac68c8d7970550b67bfbf6a4a9ec93df3ed4515cf326179c1b7fc5b3a6d41c6f2ee8888c1b31e1e189bdf12ac5620cdc0a6c31bcedf5
7
- data.tar.gz: babe51b71247333c6fd6091d814fa7ada1adaf71d852f07a4aa7ece6b93c8576415157c82370a49e4317bf9610b4cc3796e2aca22c43791fe2df5e3409448e29
6
+ metadata.gz: 589e1fd671e6b81f21c65817bef12ab70527818516712689b541700718ebe59a142f172e3a79c1d412597d999ccbbd5f72b9e64c884a41e8aa3b7854847ba2d1
7
+ data.tar.gz: 12cf46f870a08ecc57e005843fa6fa6c5fb29c16c5713c20c28a0e3a05be326ca3147cf03d62846f80abb4a81b798a40f27bb3afbc1fc8b0dfabeaa636eb57ad
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.6](https://github.com/looker-open-source/gzr/compare/v0.3.5...v0.3.6) (2023-05-09)
4
+
5
+
6
+ ### Features
7
+
8
+ * dashboard sync_lookml to sync UDDs with their associated lookml dashboards ([#194](https://github.com/looker-open-source/gzr/issues/194)) ([7b94a79](https://github.com/looker-open-source/gzr/commit/7b94a7962d36d865759b105b481f602aac87523e))
9
+
3
10
  ## [0.3.5](https://github.com/looker-open-source/gzr/compare/v0.3.4...v0.3.5) (2023-05-05)
4
11
 
5
12
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gazer (0.3.5)
4
+ gazer (0.3.6)
5
5
  faraday (~> 1.10.3)
6
6
  looker-sdk (~> 0.1.1)
7
7
  net-http-persistent (~> 4.0, >= 4.0.1)
@@ -0,0 +1,52 @@
1
+ # The MIT License (MIT)
2
+
3
+ # Copyright (c) 2023 Mike DeAngelo Google, Inc.
4
+
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ # this software and associated documentation files (the "Software"), to deal in
7
+ # the Software without restriction, including without limitation the rights to
8
+ # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ # the Software, and to permit persons to whom the Software is furnished to do so,
10
+ # subject to the following conditions:
11
+
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ # frozen_string_literal: true
23
+
24
+ require_relative '../../../gzr'
25
+ require_relative '../../command'
26
+ require_relative '../../modules/dashboard'
27
+
28
+ module Gzr
29
+ module Commands
30
+ class Dashboard
31
+ class SyncLookml < Gzr::Command
32
+ include Gzr::Dashboard
33
+ def initialize(dashboard_id, options)
34
+ super()
35
+ @dashboard_id = dashboard_id
36
+ @options = options
37
+ end
38
+
39
+ def execute(input: $stdin, output: $stdout)
40
+ say_warning("options: #{@options.inspect}", output: output) if @options[:debug]
41
+ with_session do
42
+
43
+ dash = query_dashboard(@dashboard_id)
44
+ raise Gzr::CLI::Error, "Dashboard with id #{@dashboard_id} does not exist" unless dash
45
+
46
+ say_ok sync_lookml_dashboard(@dashboard_id)
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -112,6 +112,18 @@ module Gzr
112
112
  Gzr::Commands::Dashboard::ImportLookml.new(dashboard_id, target_folder_id, options).execute
113
113
  end
114
114
  end
115
+
116
+ desc 'sync_lookml DASHBOARD_ID', 'Sync any UDD from a lookml dashboard'
117
+ method_option :help, aliases: '-h', type: :boolean,
118
+ desc: 'Display usage information'
119
+ def sync_lookml(dashboard_id)
120
+ if options[:help]
121
+ invoke :help, ['sync_lookml']
122
+ else
123
+ require_relative 'dashboard/sync_lookml'
124
+ Gzr::Commands::Dashboard::SyncLookml.new(dashboard_id, options).execute
125
+ end
126
+ end
115
127
  end
116
128
  end
117
129
  end
@@ -364,5 +364,15 @@ module Gzr
364
364
  raise
365
365
  end
366
366
  end
367
+
368
+ def sync_lookml_dashboard(id)
369
+ begin
370
+ return @sdk.sync_lookml_dashboard(id, {})
371
+ rescue LookerSDK::Error => e
372
+ say_error "Error sync_lookml_dashboard(#{id})"
373
+ say_error e
374
+ raise
375
+ end
376
+ end
367
377
  end
368
378
  end
data/lib/gzr/version.rb CHANGED
@@ -20,5 +20,5 @@
20
20
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
22
  module Gzr
23
- VERSION = '0.3.5'.freeze
23
+ VERSION = '0.3.6'.freeze
24
24
  end
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.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike DeAngelo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-05 00:00:00.000000000 Z
11
+ date: 2023-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-reader
@@ -303,6 +303,7 @@ files:
303
303
  - lib/gzr/commands/dashboard/import_lookml.rb
304
304
  - lib/gzr/commands/dashboard/mv.rb
305
305
  - lib/gzr/commands/dashboard/rm.rb
306
+ - lib/gzr/commands/dashboard/sync_lookml.rb
306
307
  - lib/gzr/commands/folder.rb
307
308
  - lib/gzr/commands/folder/cat.rb
308
309
  - lib/gzr/commands/folder/create.rb