Sha256: b96c519c6acbb12aed49fec068e976ae08cadd533d37ffb04990cf4fdb12b9b8
Contents?: true
Size: 985 Bytes
Versions: 16
Compression:
Stored size: 985 Bytes
Contents
# frozen_string_literal: true module RubyRabbitmqJanus module Generators # Create an class for generate a initializer class InitializerGenerator < Rails::Generators::Base desc 'Generate a initializer to this gem for rails application.' INITIALIZER = <<-INIT # frozen_string_literal: true require 'actions' # Initialize a gem and create an session with a keepalive ::RRJ = RubyRabbitmqJanus::RRJ.new # This test disable this gems execution when you running an task with rake unless File.basename($PROGRAM_NAME) == 'rake' Rails.configuration.after_initialize do # If you don't want listen a standard queue, comment this lines and # "require 'actions'" actions = RubyRabbitmqJanus::ActionEvents.new.actions RubyRabbitmqJanus::Janus::Concurrencies::Event.instance.run(&actions) end end INIT # Create an initializer def copy_initializer initializer 'ruby_rabbitmq_janus.rb', INITIALIZER end end end end
Version data entries
16 entries across 16 versions & 1 rubygems