doggy 2.0.38 → 2.0.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -7
- data/lib/doggy/cli/push.rb +2 -2
- data/lib/doggy/model.rb +15 -5
- 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: 3e04c1e4612bdfa22169dc85914ce496b940a72e
|
4
|
+
data.tar.gz: 9588342799f7ef5033f9720456b7e756a913cb6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35838ed57e26c6cb0e0f9d20f50503a1247197d48680c5d9db8c467abc13ae13a70f4dd7c0c1f859f91d57e99736a6d370b98baa8d38bdca14f7e88c21ed76b8
|
7
|
+
data.tar.gz: 00e55e4ee1f7d3f9c621db78eeec3440f76ae40da3db054b32e70f01a516769269c25624b4ce7e3f2ca5ebb08d1329122b74e945026c8b7d7f73405860ddeabb
|
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.39)
|
5
5
|
activesupport (~> 4)
|
6
6
|
json (~> 1.8.3)
|
7
7
|
parallel (~> 1.6.1)
|
@@ -12,9 +12,8 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activesupport (4.2.
|
15
|
+
activesupport (4.2.8)
|
16
16
|
i18n (~> 0.7)
|
17
|
-
json (~> 1.7, >= 1.7.7)
|
18
17
|
minitest (~> 5.1)
|
19
18
|
thread_safe (~> 0.3, >= 0.3.4)
|
20
19
|
tzinfo (~> 1.1)
|
@@ -32,9 +31,9 @@ GEM
|
|
32
31
|
thread_safe (~> 0.3, >= 0.3.1)
|
33
32
|
equalizer (0.0.11)
|
34
33
|
hashdiff (0.2.3)
|
35
|
-
i18n (0.
|
34
|
+
i18n (0.8.1)
|
36
35
|
ice_nine (0.11.2)
|
37
|
-
json (1.8.
|
36
|
+
json (1.8.6)
|
38
37
|
metaclass (0.0.4)
|
39
38
|
minitest (5.9.0)
|
40
39
|
mocha (1.1.0)
|
@@ -45,7 +44,7 @@ GEM
|
|
45
44
|
rugged (0.23.3)
|
46
45
|
safe_yaml (1.0.4)
|
47
46
|
thor (0.19.4)
|
48
|
-
thread_safe (0.3.
|
47
|
+
thread_safe (0.3.6)
|
49
48
|
tzinfo (1.2.2)
|
50
49
|
thread_safe (~> 0.1)
|
51
50
|
virtus (1.0.5)
|
@@ -70,4 +69,4 @@ DEPENDENCIES
|
|
70
69
|
webmock
|
71
70
|
|
72
71
|
BUNDLED WITH
|
73
|
-
1.13.
|
72
|
+
1.13.7
|
data/lib/doggy/cli/push.rb
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
module Doggy
|
4
4
|
class CLI::Push
|
5
5
|
WARNING_MESSAGE = "You are about to force push all the objects. "\
|
6
|
-
"This will override changes in Datadog if they have not been
|
7
|
-
"Do you want to proceed?(Y/N)"
|
6
|
+
"This will override changes in Datadog if they have not been synced to the dog repository. "\
|
7
|
+
"Do you want to proceed? (Y/N)"
|
8
8
|
|
9
9
|
def sync_changes
|
10
10
|
changed_resources = Doggy::Model.changed_resources
|
data/lib/doggy/model.rb
CHANGED
@@ -23,7 +23,7 @@ module Doggy
|
|
23
23
|
attr_accessor :root
|
24
24
|
|
25
25
|
def find(id)
|
26
|
-
attributes = request(:get, resource_url(id))
|
26
|
+
attributes = request(:get, resource_url(id), nil, [404])
|
27
27
|
return if attributes['errors']
|
28
28
|
resource = new(attributes)
|
29
29
|
|
@@ -89,7 +89,7 @@ module Doggy
|
|
89
89
|
return Models::Screen if has_key.call('board_title')
|
90
90
|
end
|
91
91
|
|
92
|
-
def request(method, url, body = nil)
|
92
|
+
def request(method, url, body = nil, accepted_errors = nil)
|
93
93
|
uri = URI(url)
|
94
94
|
|
95
95
|
if uri.query
|
@@ -112,10 +112,20 @@ module Doggy
|
|
112
112
|
request.body = body if body
|
113
113
|
|
114
114
|
response = http.request(request)
|
115
|
-
|
116
|
-
|
115
|
+
parsed_response = response.body ? JSON.parse(response.body) : nil
|
116
|
+
|
117
|
+
unless accepted_response(response.code.to_i, accepted_errors)
|
118
|
+
raise DoggyError, "Unexpected response code #{response.code} for #{url}, body: #{parsed_response.to_s}"
|
119
|
+
end
|
120
|
+
parsed_response
|
121
|
+
end
|
122
|
+
|
123
|
+
def accepted_response(code, accepted_errors = nil)
|
124
|
+
if (accepted_errors != nil) && (accepted_errors.include? code)
|
125
|
+
true
|
126
|
+
else
|
127
|
+
code >= 200 && code < 400
|
117
128
|
end
|
118
|
-
response.body ? JSON.parse(response.body) : nil
|
119
129
|
end
|
120
130
|
|
121
131
|
def current_sha
|
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.39
|
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: 2017-
|
12
|
+
date: 2017-03-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|