doggy 2.0.28 → 2.0.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +17 -1
- data/lib/doggy/cli/edit.rb +1 -0
- data/lib/doggy/cli/push.rb +1 -0
- data/lib/doggy/model.rb +9 -0
- data/lib/doggy/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91c2b9cacf34931798638f66cd8b715c7a82fe90
|
4
|
+
data.tar.gz: fcc7987e9cb35c25fe11aeaeb300837417cda15b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20dc45a9c05aa91769f94f02dbf99431476826926b89d6380aa0dd3aaf9581ac70fc17fb9b6fbaf75c5c9d9cb00ddb6a6160b544483641cda9cf7bdf975372b2
|
7
|
+
data.tar.gz: fd65d752b941303a69f195b9c1de9f3db838c230771fb31ffcc01b2f71a0366f2d14b8649fb6a86cc86e1fcdc9a1f75c6b71fffb701042a8ae5c0b64886bec51
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.3.1
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
doggy (2.0.
|
4
|
+
doggy (2.0.27)
|
5
5
|
json (~> 1.8.3)
|
6
6
|
parallel (~> 1.6.1)
|
7
7
|
rugged (~> 0.23.2)
|
@@ -11,21 +11,31 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
+
addressable (2.5.0)
|
15
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
14
16
|
axiom-types (0.1.1)
|
15
17
|
descendants_tracker (~> 0.0.4)
|
16
18
|
ice_nine (~> 0.11.0)
|
17
19
|
thread_safe (~> 0.3, >= 0.3.1)
|
18
20
|
coercible (1.0.0)
|
19
21
|
descendants_tracker (~> 0.0.1)
|
22
|
+
crack (0.4.3)
|
23
|
+
safe_yaml (~> 1.0.0)
|
20
24
|
descendants_tracker (0.0.4)
|
21
25
|
thread_safe (~> 0.3, >= 0.3.1)
|
22
26
|
equalizer (0.0.11)
|
27
|
+
hashdiff (0.2.3)
|
23
28
|
ice_nine (0.11.2)
|
24
29
|
json (1.8.3)
|
30
|
+
metaclass (0.0.4)
|
25
31
|
minitest (5.9.0)
|
32
|
+
mocha (1.1.0)
|
33
|
+
metaclass (~> 0.0.1)
|
26
34
|
parallel (1.6.2)
|
35
|
+
public_suffix (2.0.4)
|
27
36
|
rake (10.5.0)
|
28
37
|
rugged (0.23.3)
|
38
|
+
safe_yaml (1.0.4)
|
29
39
|
thor (0.19.1)
|
30
40
|
thread_safe (0.3.5)
|
31
41
|
virtus (1.0.5)
|
@@ -33,6 +43,10 @@ GEM
|
|
33
43
|
coercible (~> 1.0)
|
34
44
|
descendants_tracker (~> 0.0, >= 0.0.3)
|
35
45
|
equalizer (~> 0.0, >= 0.0.9)
|
46
|
+
webmock (1.22.6)
|
47
|
+
addressable (>= 2.3.6)
|
48
|
+
crack (>= 0.3.2)
|
49
|
+
hashdiff
|
36
50
|
|
37
51
|
PLATFORMS
|
38
52
|
ruby
|
@@ -41,7 +55,9 @@ DEPENDENCIES
|
|
41
55
|
bundler (~> 1.10)
|
42
56
|
doggy!
|
43
57
|
minitest
|
58
|
+
mocha
|
44
59
|
rake (~> 10.0)
|
60
|
+
webmock
|
45
61
|
|
46
62
|
BUNDLED WITH
|
47
63
|
1.13.6
|
data/lib/doggy/cli/edit.rb
CHANGED
data/lib/doggy/cli/push.rb
CHANGED
@@ -28,6 +28,7 @@ module Doggy
|
|
28
28
|
def push_resources(name, klass)
|
29
29
|
Doggy.ui.say "Pushing #{ name }"
|
30
30
|
local_resources = klass.all_local(only_changed: !@options['all_objects'])
|
31
|
+
local_resources.each(&:ensure_read_only!)
|
31
32
|
Doggy.ui.say "#{ local_resources.size } objects to push"
|
32
33
|
local_resources.each(&:save)
|
33
34
|
end
|
data/lib/doggy/model.rb
CHANGED
@@ -9,6 +9,8 @@ module Doggy
|
|
9
9
|
class Model
|
10
10
|
include Virtus.model
|
11
11
|
|
12
|
+
attribute :read_only, Boolean
|
13
|
+
|
12
14
|
# This stores the path on disk. We don't define it as a model attribute so
|
13
15
|
# it doesn't get serialized.
|
14
16
|
attr_accessor :path
|
@@ -150,6 +152,8 @@ module Doggy
|
|
150
152
|
seed[key] = hash[key]
|
151
153
|
if seed[key].is_a?(Hash)
|
152
154
|
seed[key] = Doggy::Model.sort_by_key(seed[key], &block)
|
155
|
+
elsif seed[key].is_a?(Array)
|
156
|
+
seed[key].each_with_index { |e, i| seed[key][i] = sort_by_key(e, &block) if e.is_a?(Hash) }
|
153
157
|
end
|
154
158
|
seed
|
155
159
|
end
|
@@ -172,7 +176,12 @@ module Doggy
|
|
172
176
|
super(attributes)
|
173
177
|
end
|
174
178
|
|
179
|
+
def ensure_read_only!
|
180
|
+
self.read_only = true
|
181
|
+
end
|
182
|
+
|
175
183
|
def save_local
|
184
|
+
ensure_read_only!
|
176
185
|
prefix = case self.class.name
|
177
186
|
when 'Doggy::Models::Dashboard' then 'dash'
|
178
187
|
when 'Doggy::Models::Monitor' then 'monitor'
|
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.29
|
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-11-
|
12
|
+
date: 2016-11-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -133,6 +133,7 @@ extensions: []
|
|
133
133
|
extra_rdoc_files: []
|
134
134
|
files:
|
135
135
|
- ".gitignore"
|
136
|
+
- ".ruby-version"
|
136
137
|
- ".travis.yml"
|
137
138
|
- CODE_OF_CONDUCT.md
|
138
139
|
- Gemfile
|
@@ -176,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
177
|
version: '0'
|
177
178
|
requirements: []
|
178
179
|
rubyforge_project:
|
179
|
-
rubygems_version: 2.
|
180
|
+
rubygems_version: 2.5.1
|
180
181
|
signing_key:
|
181
182
|
specification_version: 4
|
182
183
|
summary: Syncs DataDog dashboards, alerts, screenboards, and monitors.
|