Sha256: 41f9b8aaa682c2356969f6f414cb4c865211047fd7d808fbd1c240be58254cba

Contents?: true

Size: 1 KB

Versions: 16

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true

module Karafka
  module Web
    module Management
      module Actions
        # Cleans the boot file from Karafka Web-UI details.
        class CleanBootFile < Base
          # Web-UI enabled code
          ENABLER_CODE = ExtendBootFile::ENABLER_CODE

          private_constant :ENABLER_CODE

          # Removes the Web-UI boot file data
          def call
            karafka_rb = File.readlines(Karafka.boot_file)

            if karafka_rb.any? { |line| line.include?(ENABLER_CODE) }
              puts 'Updating the Karafka boot file...'
              karafka_rb.delete_if { |line| line.include?(ENABLER_CODE) }

              File.write(Karafka.boot_file, karafka_rb.join)
              puts "Karafka boot file #{successfully} updated."
              puts 'Make sure to remove configuration and other customizations as well.'
            else
              puts 'Karafka Web UI components not found in the boot file.'
            end
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
karafka-web-0.10.3 lib/karafka/web/management/actions/clean_boot_file.rb
karafka-web-0.10.2 lib/karafka/web/management/actions/clean_boot_file.rb
karafka-web-0.10.1 lib/karafka/web/management/actions/clean_boot_file.rb
karafka-web-0.10.0 lib/karafka/web/management/actions/clean_boot_file.rb
karafka-web-0.10.0.rc2 lib/karafka/web/management/actions/clean_boot_file.rb
karafka-web-0.10.0.rc1 lib/karafka/web/management/actions/clean_boot_file.rb
karafka-web-0.10.0.beta1 lib/karafka/web/management/actions/clean_boot_file.rb
karafka-web-0.9.1 lib/karafka/web/management/actions/clean_boot_file.rb
karafka-web-0.9.0 lib/karafka/web/management/actions/clean_boot_file.rb
karafka-web-0.9.0.rc3 lib/karafka/web/management/actions/clean_boot_file.rb
karafka-web-0.9.0.rc2 lib/karafka/web/management/actions/clean_boot_file.rb
karafka-web-0.9.0.rc1 lib/karafka/web/management/actions/clean_boot_file.rb
karafka-web-0.8.2 lib/karafka/web/management/actions/clean_boot_file.rb
karafka-web-0.8.1 lib/karafka/web/management/actions/clean_boot_file.rb
karafka-web-0.8.0 lib/karafka/web/management/actions/clean_boot_file.rb
karafka-web-0.8.0.rc1 lib/karafka/web/management/actions/clean_boot_file.rb