Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
311a77d0
Commit
311a77d0
authored
Jul 06, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor SimpleExecutor
parent
68327a42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
lib/system_check/simple_executor.rb
lib/system_check/simple_executor.rb
+25
-5
No files found.
lib/system_check/simple_executor.rb
View file @
311a77d0
...
...
@@ -42,7 +42,7 @@ module SystemCheck
#
# @param [SystemCheck::BaseCheck] check_klass
def
run_check
(
check_klass
)
$stdout
.
print
"
#{
check_klass
.
display_name
}
... "
print_display_name
(
check_klass
)
check
=
check_klass
.
new
...
...
@@ -59,17 +59,17 @@ module SystemCheck
end
if
check
.
check?
$stdout
.
puts
check_klass
.
check_pass
.
color
(
:green
)
print_check_pass
(
check_klass
)
else
$stdout
.
puts
check_klass
.
check_fail
.
color
(
:red
)
print_check_failure
(
check_klass
)
if
check
.
can_repair?
$stdout
.
print
'Trying to fix error automatically. ...'
if
check
.
repair!
$stdout
.
puts
'Success'
.
color
(
:green
)
print_success
return
else
$stdout
.
puts
'Failed'
.
color
(
:red
)
print_failure
end
end
...
...
@@ -81,6 +81,26 @@ module SystemCheck
private
def
print_display_name
(
check_klass
)
$stdout
.
print
"
#{
check_klass
.
display_name
}
... "
end
def
print_check_pass
(
check_klass
)
$stdout
.
puts
check_klass
.
check_pass
.
color
(
:green
)
end
def
print_check_failure
(
check_klass
)
$stdout
.
puts
check_klass
.
check_fail
.
color
(
:red
)
end
def
print_success
$stdout
.
puts
'Success'
.
color
(
:green
)
end
def
print_failure
$stdout
.
puts
'Failed'
.
color
(
:red
)
end
# Prints header content for the series of checks to be executed for this component
#
# @param [String] component name of the component relative to the checks being executed
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment