Sha256: 1130326bb43afdf0216df069d81548078e2c63e3d8b578430478cdab8e6cd967

Contents?: true

Size: 1.53 KB

Versions: 11

Compression:

Stored size: 1.53 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

    def ensure_switched
        unless File.exist?(FilePath.current_brand)
message = <<-MESSAGE
It looks like you haven't switched to a brand yet!
You can open the dashboard by running 'solara dashboard' in your terminal and make the switch there.
Alternatively, you can execute 'solara switch YOUR_BRAND_KEY_HERE' in your terminal.
MESSAGE
            Solara.logger.error(message)
            return false
        end
        return true
   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

11 entries across 11 versions & 1 rubygems

Version Path
solara-0.7.4 solara/lib/core/doctor/doctor_manager.rb
solara-0.7.3 solara/lib/core/doctor/doctor_manager.rb
solara-0.7.2 solara/lib/core/doctor/doctor_manager.rb
solara-0.7.1 solara/lib/core/doctor/doctor_manager.rb
solara-0.7.0 solara/lib/core/doctor/doctor_manager.rb
solara-0.6.0 solara/lib/core/doctor/doctor_manager.rb
solara-0.5.0 solara/lib/core/doctor/doctor_manager.rb
solara-0.4.0 solara/lib/core/doctor/doctor_manager.rb
solara-0.3.0 solara/lib/core/doctor/doctor_manager.rb
solara-0.2.4 solara/lib/core/doctor/doctor_manager.rb
solara-0.2.3 solara/lib/core/doctor/doctor_manager.rb