chihuahua 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chihuahua/cli.rb +1 -0
- data/lib/chihuahua/export.rb +0 -1
- data/lib/chihuahua/update.rb +8 -5
- data/lib/chihuahua/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: 1cf179ea0c9f53ac40c3748cd8d8b01a6b428573
|
4
|
+
data.tar.gz: 0b323367e9e6af82e891a97c4504be4cb7d5def7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2ddd4304d4bb962a65599cf2920384278ebdb4a1e07c37478b270b41b41310cde3d3247790d5cb4c5f8277c7752d942b17069f19af07b786400061bfd5aa6aa
|
7
|
+
data.tar.gz: 811f4e1e043e2228d74e23cfda608869b8f5102a493eb954b7f46893788f84b38ec3b779c88809d4779af20bda91ef41b69236edacdd4d1fdd75b4483160723c
|
data/lib/chihuahua/cli.rb
CHANGED
@@ -34,6 +34,7 @@ module Chihuahua
|
|
34
34
|
args['tags'] = options[:tags]
|
35
35
|
exporter = Chihuahua::Export.new(options[:project], args)
|
36
36
|
monitors_data = exporter.export_monitors(options[:project])
|
37
|
+
puts monitors_data.length.to_s + ' 件の Monitors 定義を出力しました.'
|
37
38
|
exporter.store_monitors_data(monitors_data)
|
38
39
|
end
|
39
40
|
#
|
data/lib/chihuahua/export.rb
CHANGED
data/lib/chihuahua/update.rb
CHANGED
@@ -43,6 +43,7 @@ module Chihuahua
|
|
43
43
|
# current_monitors = @exporter.export_monitors(filter['name'], filter['tags']) { |f| YAML.load(f) }
|
44
44
|
current_monitors = @exporter.export_monitors(@project) { |f| YAML.load(f) }
|
45
45
|
datas = open(@monitors_file_path) { |f| YAML.load(f) }
|
46
|
+
apply_flag = []
|
46
47
|
datas.each do |data|
|
47
48
|
# 新規登録 or 更新のチェック(id キーが有れば更新)
|
48
49
|
if data.has_key?('id') then
|
@@ -52,14 +53,13 @@ module Chihuahua
|
|
52
53
|
# 差分の有無をチェック(diff != "\n" であれば差分が有ると判断)
|
53
54
|
if diff != "\n" then
|
54
55
|
# --dry-run フラグのチェック
|
55
|
-
if dry_run
|
56
|
+
if dry_run then
|
56
57
|
puts hl.color('Check update line.', :gray, :underline)
|
57
58
|
puts diff
|
58
59
|
puts ''
|
59
60
|
else
|
60
61
|
update_monitor(data)
|
61
|
-
|
62
|
-
@exporter.store_monitors_data(monitors_data)
|
62
|
+
apply_flag << '1'
|
63
63
|
end
|
64
64
|
end
|
65
65
|
else
|
@@ -67,8 +67,7 @@ module Chihuahua
|
|
67
67
|
# --dry-run フラグのチェック
|
68
68
|
if dry_run == nil then
|
69
69
|
create_monitor(data)
|
70
|
-
|
71
|
-
@exporter.store_monitors_data(monitors_data)
|
70
|
+
apply_flag << '1'
|
72
71
|
else
|
73
72
|
puts hl.color('Check add line.', :gray, :underline)
|
74
73
|
puts hl.color(YAML.dump(data), :light_cyan)
|
@@ -76,6 +75,10 @@ module Chihuahua
|
|
76
75
|
end
|
77
76
|
end
|
78
77
|
end
|
78
|
+
unless dry_run or apply_flag.empty? then
|
79
|
+
monitors_data = @exporter.export_monitors(@project)
|
80
|
+
@exporter.store_monitors_data(monitors_data)
|
81
|
+
end
|
79
82
|
puts 'done.'
|
80
83
|
end
|
81
84
|
|
data/lib/chihuahua/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chihuahua
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- inokappa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|