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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3815cf9fa969a85a2de651208fcd75c3c6ecd26d
4
- data.tar.gz: 8768dd2ccabb5a17cb516039267f28c636c1d679
3
+ metadata.gz: b5e2250b9c4216ff88db0fcd6451905a2b7f236f
4
+ data.tar.gz: 6ff822b499f265a8399ea0abbafff0f4efb2d67e
5
5
  SHA512:
6
- metadata.gz: f3511b597b8e11c30eee85e71a92f7a9d274d87329a9eb183c76fb2513c91b3c231526a431e1d4c6dae8015b0af715096bfe2b1ac89050419d4d981869520535
7
- data.tar.gz: bd85e409697ef8a671c1a16279941f0ff40bb60fc6a29d64d76c14eeed6ae09e1c001886b1bd178819b9cace9cf0bd2531471dbe02bdc51c01baa240a9da9eca
6
+ metadata.gz: 765d4c582d78ac696d89fc3cd1293281d039715ea291b002b51d62aa08c6e610d77c1e3cb331c3f8fae7ddd3584eb277185963ae0241d1993a539bfab250c29d
7
+ data.tar.gz: 91ab6f3a5ffc1de91a3cee60a498979017670fb569690fc21b73c26f4c4e99686dd2b0ac4f8cc20241fe4a444df5454fcd14647bc5336b2807e1f75949dca32e
data/.travis.yml CHANGED
@@ -1,4 +1,3 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.2
4
- before_install: gem install bundler -v 1.10.6
3
+ - 2.3.1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- doggy (2.0.34)
4
+ doggy (2.0.35)
5
5
  activesupport (~> 4)
6
6
  json (~> 1.8.3)
7
7
  parallel (~> 1.6.1)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Doggy
2
2
 
3
+ [![Build Status](https://travis-ci.org/Shopify/doggy.svg?branch=master)](https://travis-ci.org/Shopify/doggy)
4
+
3
5
  Doggy manages your DataDog dashboards, alerts, monitors, and screenboards.
4
6
 
5
7
  ## Installation
data/lib/doggy.rb CHANGED
@@ -23,6 +23,10 @@ module Doggy
23
23
 
24
24
  extend self
25
25
 
26
+ def random_word
27
+ (0...12).map { (97 + rand(26)).chr }.join
28
+ end
29
+
26
30
  def ui
27
31
  (defined?(@ui) && @ui) || (self.ui = Thor::Shell::Color.new)
28
32
  end
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.
@@ -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').each_delta.map do |delta|
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
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Doggy
4
- VERSION = "2.0.34"
4
+ VERSION = "2.0.35"
5
5
  end
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.34
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-08 00:00:00.000000000 Z
12
+ date: 2016-12-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json