Sha256: 21ba8c91797333b72387df7b406680d6f2a25e163c0b05182ff6f836015c93f8
Contents?: true
Size: 1.06 KB
Versions: 8
Compression:
Stored size: 1.06 KB
Contents
# frozen_string_literal: true namespace :rimless do require 'fileutils' # Install a template file to the project. # # @param src [String] the template source file name # @param dest [Array<String>] the relative destination parts def install_template(src, *dest) src = File.join(__dir__, 'templates', src) dest = File.join(Dir.pwd, *dest, File.basename(src)) return puts "# [Skip] #{dest}" if File.exist? dest puts "# [Install] #{dest}" FileUtils.mkdir_p(File.dirname(dest)) FileUtils.copy(src, dest) end desc 'Install the Rimless consumer components' task :install do install_template('karafka.rb') install_template('application_consumer.rb', 'app', 'consumers') install_template('custom_consumer.rb', 'app', 'consumers') install_template('custom_consumer_spec.rb', 'spec', 'consumers') puts <<~OUTPUT # # Installation done. # # You can now configure your routes at the +karafka.rb+ file at # your project root. And list all routes with +rake rimless:routes+. OUTPUT end end
Version data entries
8 entries across 8 versions & 1 rubygems