Sha256: cd886e36a3eeb70e192401246eae87f8ae1e99f424785ce5af5bc38564c0cff4
Contents?: true
Size: 1.19 KB
Versions: 18
Compression:
Stored size: 1.19 KB
Contents
# frozen_string_literal: true module Karafka # Karafka framework Cli class Cli < Thor # Install Karafka Cli action class Install < Base desc 'Install all required things for Karafka application in current directory' # Directories created by default INSTALL_DIRS = %w[ app/consumers app/responders config log tmp/pids ].freeze # Where should we map proper files from templates INSTALL_FILES_MAP = { 'karafka.rb.example' => Karafka.boot_file.basename, 'application_consumer.rb.example' => 'app/consumers/application_consumer.rb', 'application_responder.rb.example' => 'app/responders/application_responder.rb' }.freeze # Install all required things for Karafka application in current directory def call INSTALL_DIRS.each do |dir| FileUtils.mkdir_p Karafka.root.join(dir) end INSTALL_FILES_MAP.each do |source, target| target = Karafka.root.join(target) next if File.exist?(target) source = Karafka.core_root.join("templates/#{source}") FileUtils.cp_r(source, target) end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems