Sha256: bed9955a79f19293162504aefee975bcf997d697176ee1d7e42ed139ad3b8e47

Contents?: true

Size: 851 Bytes

Versions: 10

Compression:

Stored size: 851 Bytes

Contents

# frozen_string_literal: true

module KafkaProducer
  module Generators
    module Concerns
      module Configuration
        extend ActiveSupport::Concern

        CONFIG_PATH = "config/kafka_producer.yml"

        def check_config_file!
          config_path = File.expand_path(CONFIG_PATH)
          return if File.exist?(config_path)

          generator_name = "kafka_producer:install"
          if yes?(
            "The file #{config_path} does not appear to exist." \
            " Would you like to generate it?"
          )
            generate generator_name
          else
            raise Rails::Generators::Error, "Please generate #{config_path} " \
                           "by running `bin/rails g #{generator_name}` " \
                           "or add this file manually."
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sbmt-kafka_producer-3.2.0 lib/generators/kafka_producer/concerns/configuration.rb
sbmt-kafka_producer-3.1.1 lib/generators/kafka_producer/concerns/configuration.rb
sbmt-kafka_producer-3.1.0 lib/generators/kafka_producer/concerns/configuration.rb
sbmt-kafka_producer-3.0.0 lib/generators/kafka_producer/concerns/configuration.rb
sbmt-kafka_producer-2.2.3 lib/generators/kafka_producer/concerns/configuration.rb
sbmt-kafka_producer-2.2.2 lib/generators/kafka_producer/concerns/configuration.rb
sbmt-kafka_producer-2.2.1 lib/generators/kafka_producer/concerns/configuration.rb
sbmt-kafka_producer-2.2.0 lib/generators/kafka_producer/concerns/configuration.rb
sbmt-kafka_producer-2.1.0 lib/generators/kafka_producer/concerns/configuration.rb
sbmt-kafka_producer-2.0.0 lib/generators/kafka_producer/concerns/configuration.rb