doggy 2.0.10 → 2.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/doggy/cli/pull.rb +13 -8
- data/lib/doggy/cli.rb +2 -2
- data/lib/doggy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a03dea3042516cbe90113a39d58cbe0aeb080ebc
|
4
|
+
data.tar.gz: d42ed86f756843f49ac3e29fc520ab781f73a4fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 698c71f8b6b353dad00b4ee6522a91080a47927b528f666c900032ab40091552ad54d68f96d5c1e60c676c7843dc4ce8c0d3714398596cf690836a1e77c5f441
|
7
|
+
data.tar.gz: 97ecfe0e042c35edf5a63e8d4e6730aea763f7b7aa9c6f6cf321689b495871e6aeee3b8820c834f52b24d9cf685ed1f1298ba194622712080a15b5b2084a2ca9
|
data/Gemfile.lock
CHANGED
data/lib/doggy/cli/pull.rb
CHANGED
@@ -2,14 +2,15 @@
|
|
2
2
|
|
3
3
|
module Doggy
|
4
4
|
class CLI::Pull
|
5
|
-
def initialize(options)
|
5
|
+
def initialize(ids:, options:)
|
6
|
+
@ids = ids
|
6
7
|
@options = options
|
7
8
|
end
|
8
9
|
|
9
10
|
def run
|
10
|
-
pull_resources('dashboards', Models::Dashboard) if should_pull?('dashboards')
|
11
|
-
pull_resources('monitors', Models::Monitor) if should_pull?('monitors')
|
12
|
-
pull_resources('screens', Models::Screen) if should_pull?('screens')
|
11
|
+
pull_resources('dashboards', Models::Dashboard, @ids) if should_pull?('dashboards')
|
12
|
+
pull_resources('monitors', Models::Monitor, @ids) if should_pull?('monitors')
|
13
|
+
pull_resources('screens', Models::Screen, @ids) if should_pull?('screens')
|
13
14
|
end
|
14
15
|
|
15
16
|
private
|
@@ -18,11 +19,15 @@ module Doggy
|
|
18
19
|
@options.empty? || @options[resource]
|
19
20
|
end
|
20
21
|
|
21
|
-
def pull_resources(name, klass)
|
22
|
-
|
22
|
+
def pull_resources(name, klass, ids)
|
23
|
+
if ids.any?
|
24
|
+
Doggy.ui.say "Pulling #{ name }: #{ids.join(', ')}"
|
25
|
+
remote_resources = klass.all.find_all { |m| ids.include?(m.id.to_s) }
|
26
|
+
else
|
27
|
+
Doggy.ui.say "Pulling #{ name }"
|
28
|
+
remote_resources = klass.all
|
29
|
+
end
|
23
30
|
local_resources = klass.all_local
|
24
|
-
remote_resources = klass.all
|
25
|
-
|
26
31
|
klass.assign_paths(remote_resources, local_resources)
|
27
32
|
remote_resources.each(&:save_local)
|
28
33
|
end
|
data/lib/doggy/cli.rb
CHANGED
@@ -16,8 +16,8 @@ module Doggy
|
|
16
16
|
method_option "monitors", type: :boolean, desc: 'Pull monitors'
|
17
17
|
method_option "screens", type: :boolean, desc: 'Pull screens'
|
18
18
|
|
19
|
-
def pull
|
20
|
-
CLI::Pull.new(options.dup).run
|
19
|
+
def pull(*ids)
|
20
|
+
CLI::Pull.new(ids: ids, options: options.dup).run
|
21
21
|
end
|
22
22
|
|
23
23
|
desc "push", "Pushes objects to Datadog"
|
data/lib/doggy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doggy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vlad Gorodetsky
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-10-
|
12
|
+
date: 2015-10-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|