Sha256: 4aed913abe626da8b320c106939cfda37572f28af715ceeb94983d5c4bec55c4

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

Dir.glob("#{__dir__}/*.rb").each { |file| require file }
Dir.glob("#{__dir__}/validator/*.rb").each { |file| require file }
Dir.glob("#{__dir__}/brand/*.rb").each { |file| require file }

class DoctorManager
    def initialize
    end

    def visit_brands(brand_keys = [], print_logs: true)
        Solara.logger.header("Brand Doctor")
        ensure_initialized!
        BrandDoctor.new.visit(brand_keys, print_logs: print_logs)
    end

    def visit_project!
        Solara.logger.header("Project Doctor")
        Solara.logger.start_step("Project Health Check")
        ensure_initialized!
        ProjectDoctor.new.visit
        Solara.logger.end_step("Project Health Check")
    end

    private

    def ensure_initialized!
        brands = FilePath.brands
        brands_list = FilePath.brands_list
        platform = SolaraSettingsManager.instance.platform
        unless File.exist?(brands) &&  File.exist?(brands_list) && !platform.nil? && !platform.empty?
            Solara.logger.error("Solara is not initialized here. Please run 'solara init' to initialize.")
            exit 1
        end
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solara-0.2.2 solara/lib/core/doctor/doctor_manager.rb
solara-0.2.1 solara/lib/core/doctor/doctor_manager.rb