doggy 2.0.34 → 2.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -2
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/lib/doggy.rb +4 -0
- data/lib/doggy/cli.rb +8 -1
- data/lib/doggy/cli/edit.rb +1 -5
- data/lib/doggy/model.rb +7 -1
- 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: b5e2250b9c4216ff88db0fcd6451905a2b7f236f
|
4
|
+
data.tar.gz: 6ff822b499f265a8399ea0abbafff0f4efb2d67e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 765d4c582d78ac696d89fc3cd1293281d039715ea291b002b51d62aa08c6e610d77c1e3cb331c3f8fae7ddd3584eb277185963ae0241d1993a539bfab250c29d
|
7
|
+
data.tar.gz: 91ab6f3a5ffc1de91a3cee60a498979017670fb569690fc21b73c26f4c4e99686dd2b0ac4f8cc20241fe4a444df5454fcd14647bc5336b2807e1f75949dca32e
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/doggy.rb
CHANGED
data/lib/doggy/cli.rb
CHANGED
@@ -6,6 +6,13 @@ module Doggy
|
|
6
6
|
class CLI < Thor
|
7
7
|
include Thor::Actions
|
8
8
|
|
9
|
+
map %w(--version -v) => :__print_version
|
10
|
+
|
11
|
+
desc '--version, -v', 'print the version'
|
12
|
+
def __print_version
|
13
|
+
puts Doggy::VERSION
|
14
|
+
end
|
15
|
+
|
9
16
|
desc "pull [IDs]", "Pulls objects from Datadog"
|
10
17
|
|
11
18
|
def pull(*ids)
|
@@ -40,7 +47,7 @@ module Doggy
|
|
40
47
|
CLI::Push.new.push_all(ids)
|
41
48
|
end
|
42
49
|
|
43
|
-
desc "mute IDs", "Mutes given monitors indefinitely"
|
50
|
+
desc "mute IDs [--duration DURATION]", "Mutes given monitors indefinitely or for the specific duration"
|
44
51
|
long_desc <<-D
|
45
52
|
IDs is a space separated list of item IDs.
|
46
53
|
If `--duration` is not given, item will be muted indefinitely.
|
data/lib/doggy/cli/edit.rb
CHANGED
@@ -40,7 +40,7 @@ module Doggy
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def fork(resource)
|
43
|
-
salt = random_word
|
43
|
+
salt = Doggy.random_word
|
44
44
|
forked_resource = resource.dup
|
45
45
|
forked_resource.id = nil
|
46
46
|
forked_resource.refute_read_only!
|
@@ -57,9 +57,5 @@ module Doggy
|
|
57
57
|
forked_resource.save
|
58
58
|
forked_resource
|
59
59
|
end
|
60
|
-
|
61
|
-
def random_word
|
62
|
-
(0...12).map { (65 + rand(26)).chr.downcase }.join
|
63
|
-
end
|
64
60
|
end
|
65
61
|
end
|
data/lib/doggy/model.rb
CHANGED
@@ -61,7 +61,9 @@ module Doggy
|
|
61
61
|
|
62
62
|
def changed_resources
|
63
63
|
repo = Rugged::Repository.new(Doggy.object_root.parent.to_s)
|
64
|
-
repo.diff(current_sha, 'HEAD')
|
64
|
+
diff = repo.diff(current_sha, 'HEAD')
|
65
|
+
diff.find_similar!
|
66
|
+
diff.each_delta.map do |delta|
|
65
67
|
new_file_path = delta.new_file[:path]
|
66
68
|
next unless new_file_path.match(/\Aobjects\//)
|
67
69
|
is_deleted = delta.status == :deleted
|
@@ -152,6 +154,10 @@ module Doggy
|
|
152
154
|
end
|
153
155
|
end # class << self
|
154
156
|
|
157
|
+
def ==(another_model)
|
158
|
+
to_h == another_model.to_h
|
159
|
+
end
|
160
|
+
|
155
161
|
def initialize(attributes = nil)
|
156
162
|
root_key = self.class.root
|
157
163
|
|
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.35
|
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: 2016-12-
|
12
|
+
date: 2016-12-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|