Sha256: 2c70a3003b7716610c4fc6f9ba0d2fb991ae8bd8576d032154ae5576807a28be

Contents?: true

Size: 918 Bytes

Versions: 13

Compression:

Stored size: 918 Bytes

Contents

class BrandOffboarder

    def offboard(brand_key, confirm: true)
        unless BrandsManager.instance.exists(brand_key)
            Solara.logger.fatal("Brnad key #{brand_key} doesn't exist!")
            return
        end

        if confirm
            Solara.logger.warn("Are you sure you need to offboard #{brand_key} and delete all its configurations? (y/n)")
            confirmation = STDIN.gets.chomp.downcase

            unless confirmation == 'y'
                Solara.logger.info("Offboarding #{brand_key} cancelled.")
                return
            end
        end
        BrandsManager.instance.offboard(brand_key)
        Solara.logger.success("Offboarded #{brand_key} successfully.")
        is_current_brand = BrandsManager.instance.is_current_brand(brand_key)
        SolaraManager.new.switch(BrandsManager.instance.first_brand_key, ignore_health_check: true) if is_current_brand
    end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
solara-0.7.4 solara/lib/core/scripts/brand_offboarder.rb
solara-0.7.3 solara/lib/core/scripts/brand_offboarder.rb
solara-0.7.2 solara/lib/core/scripts/brand_offboarder.rb
solara-0.7.1 solara/lib/core/scripts/brand_offboarder.rb
solara-0.7.0 solara/lib/core/scripts/brand_offboarder.rb
solara-0.6.0 solara/lib/core/scripts/brand_offboarder.rb
solara-0.5.0 solara/lib/core/scripts/brand_offboarder.rb
solara-0.4.0 solara/lib/core/scripts/brand_offboarder.rb
solara-0.3.0 solara/lib/core/scripts/brand_offboarder.rb
solara-0.2.4 solara/lib/core/scripts/brand_offboarder.rb
solara-0.2.3 solara/lib/core/scripts/brand_offboarder.rb
solara-0.2.2 solara/lib/core/scripts/brand_offboarder.rb
solara-0.2.1 solara/lib/core/scripts/brand_offboarder.rb