Class: FunCi::Setup::SetupChecker
- Inherits:
-
Object
- Object
- FunCi::Setup::SetupChecker
- Defined in:
- lib/fun_ci/setup/setup_checker.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(project_root:, stdout:) ⇒ SetupChecker
constructor
A new instance of SetupChecker.
- #run ⇒ Object
Constructor Details
#initialize(project_root:, stdout:) ⇒ SetupChecker
Returns a new instance of SetupChecker.
12 13 14 15 |
# File 'lib/fun_ci/setup/setup_checker.rb', line 12 def initialize(project_root:, stdout:) @config = ProjectConfig.new(project_root) @stdout = stdout end |
Class Method Details
.run(project_root:, stdout: $stdout, stderr: $stderr) ⇒ Object
8 9 10 |
# File 'lib/fun_ci/setup/setup_checker.rb', line 8 def self.run(project_root:, stdout: $stdout, stderr: $stderr) new(project_root: project_root, stdout: stdout).run end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/fun_ci/setup/setup_checker.rb', line 17 def run errors = @config.validate if errors.empty? @stdout.puts "All OK. The project is configured." 0 else errors.each { |e| @stdout.puts e } 1 end end |