chihuahua 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c93d3e896095bbf2c9716518e202c680d93b14fb
4
- data.tar.gz: d6b789da20cbd8c71c01d1c1bb6e4aa2fe87853e
3
+ metadata.gz: 1cf179ea0c9f53ac40c3748cd8d8b01a6b428573
4
+ data.tar.gz: 0b323367e9e6af82e891a97c4504be4cb7d5def7
5
5
  SHA512:
6
- metadata.gz: bdf936f997542dbd765dfa22bc82a20a9f43e8a0a5807024cde75a29293a3ce7b146a44299bca84825213e598164a542393b156c8a3c9f26529898911762b207
7
- data.tar.gz: 515812f2b4e86a1f0da693e6a3dee052269200ca9ebb82385b18fa905b6dbbbbc06cb0a63c766ca96832db9342d31adab9943327901c3963d77b6a59b785fe4f
6
+ metadata.gz: e2ddd4304d4bb962a65599cf2920384278ebdb4a1e07c37478b270b41b41310cde3d3247790d5cb4c5f8277c7752d942b17069f19af07b786400061bfd5aa6aa
7
+ data.tar.gz: 811f4e1e043e2228d74e23cfda608869b8f5102a493eb954b7f46893788f84b38ec3b779c88809d4779af20bda91ef41b69236edacdd4d1fdd75b4483160723c
@@ -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
  #
@@ -67,7 +67,6 @@ module Chihuahua
67
67
  rescue => e
68
68
  puts e
69
69
  end
70
- puts monitors_data.length.to_s + ' 件の Monitors 定義を出力しました.'
71
70
  end
72
71
  end
73
72
  end
@@ -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 != nil then
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
- monitors_data = @exporter.export_monitors(@project)
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
- monitors_data = @exporter.export_monitors(@project)
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
 
@@ -1,3 +1,3 @@
1
1
  module Chihuahua
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
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.5
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-16 00:00:00.000000000 Z
11
+ date: 2017-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler