doctor 0.7.0 → 0.8.0

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: d16333b303f78e6c74e7573452a1e2671568e13c
4
- data.tar.gz: 454d8e1cf0034507f24f750c012c8efc60261dda
3
+ metadata.gz: 6db2305895c47404744bcee5f971b76f0f753d57
4
+ data.tar.gz: 657c8f77601e05a0b92e0a43313d071401152f43
5
5
  SHA512:
6
- metadata.gz: 99f26173936b5eed0f384180fe1031d509df85746b8a7e5400f5afdae646b20ec117dfff79c7975ba1ff29432116a258326e6a5a2a872271002b2f1cb131cd1a
7
- data.tar.gz: 90c53fd9e459595a0f44daa9c3b2a8a577b5cd24ff0bcdca49215fa6e8d49d282d0eebad92ca71e45fe1e60a6d05ce1ddeb24b74cd27be34ca9a4b0d99a68555
6
+ metadata.gz: 5368b8ea5ff3afe022e4669a4389de1c2c1a15b88c477da88f9bce11d1d748a81f77f93a8e1651b14da6e334f6cc55bd92f00d023354241b2065ac4a5daa7a0f
7
+ data.tar.gz: 6329c8cb35248d159bec0b790c4f4141d3847db86d6cc5ce811d9cdbf8dc3c7a603016ee1afdb5d475396c9ffe5ba9abfef8ac3c43730bab8656935bf8cc069e
@@ -0,0 +1,20 @@
1
+ module Doctor
2
+ class ReleasePathAnalyser
3
+ def analyse
4
+ [check_path]
5
+ end
6
+
7
+ private
8
+
9
+ def check_path
10
+ path = File.basename(Rails.root)
11
+ last = Dir.entries("#{Rails.root}/..").sort_by { |x| File.basename(x) }.reverse[0]
12
+ status = last == path ? 'ok' : 'error'
13
+ OpenStruct.new(
14
+ status: status,
15
+ last_release: last,
16
+ path: path
17
+ )
18
+ end
19
+ end
20
+ end
@@ -3,6 +3,7 @@ module Doctor
3
3
  def perform
4
4
  result = {}
5
5
 
6
+ result[:release_path] = analyze_release_path
6
7
  result[:telnets] = analyze_telnet
7
8
  result[:databases] = analyze_database
8
9
  result[:hds] = analyse_hds
@@ -18,6 +19,10 @@ module Doctor
18
19
 
19
20
  private
20
21
 
22
+ def analyze_release_path
23
+ process(ReleasePathAnalyser, Dto::ReleasePathResultDto)
24
+ end
25
+
21
26
  def analyze_telnet
22
27
  process(TelnetAnalyser, Dto::TelnetResultDto)
23
28
  end
@@ -54,7 +59,6 @@ module Doctor
54
59
 
55
60
  def list_all_error_messages(result)
56
61
  errors = []
57
-
58
62
  result.values.each do |result_analyze|
59
63
  result_analyze.each do |result|
60
64
  next if result.status.eql?('ok')
@@ -0,0 +1,14 @@
1
+ module Doctor
2
+ module Dto
3
+ class ReleasePathResultDto
4
+ attr_reader :status
5
+ attr_reader :error_message
6
+
7
+ def initialize(data)
8
+ @status = data[:status]
9
+ @path = data[:path]
10
+ @last = data[:last_release]
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module Doctor
2
- VERSION = '0.7.0'.freeze
2
+ VERSION = '0.8.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doctor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - uaiHebert
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-27 00:00:00.000000000 Z
11
+ date: 2016-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -168,12 +168,14 @@ files:
168
168
  - Rakefile
169
169
  - app/analyser/doctor/database_analyser.rb
170
170
  - app/analyser/doctor/hd_analyser.rb
171
+ - app/analyser/doctor/release_path_analyser.rb
171
172
  - app/analyser/doctor/telnet_analyser.rb
172
173
  - app/controllers/doctor/health_check_controller.rb
173
174
  - app/use_case/doctor/health_check.rb
174
175
  - app/util/doctor/config_manager.rb
175
176
  - app/view/doctor/dto/database_result_dto.rb
176
177
  - app/view/doctor/dto/hd_result_dto.rb
178
+ - app/view/doctor/dto/release_path_result_dto.rb
177
179
  - app/view/doctor/dto/telnet_result_dto.rb
178
180
  - config/routes.rb
179
181
  - lib/doctor.rb