Class: KafkaConsumer::Generators::ConsumerGenerator
Constant Summary
KafkaConsumer::Generators::Concerns::Configuration::CONFIG_PATH
Instance Method Summary
collapse
#check_config_file!
Instance Method Details
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/generators/kafka_consumer/consumer/consumer_generator.rb', line 18
def configure_consumer_group
@group_key = ask "Would you also configure a consumer group?" \
" Type the group's key (e.g. my_consumer_group) or press Enter to skip this action"
return if @group_key.blank?
check_config_file!
@group_name = ask "Type the group's name (e.g. my.consumer.group)"
@topic = ask "Type the group topic's name"
insert_into_file CONFIG_PATH, group_template.result(binding), after: "consumer_groups:\n"
end
|
#insert_consumer_class ⇒ Object
13
14
15
16
|
# File 'lib/generators/kafka_consumer/consumer/consumer_generator.rb', line 13
def insert_consumer_class
@consumer_name = "#{name.classify}Consumer"
template "consumer.rb.erb", "app/consumers/#{file_path}_consumer.rb"
end
|