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

Version Path
ruby_rabbitmq_janus-1.2.9 lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
ruby_rabbitmq_janus-1.2.8 lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
ruby_rabbitmq_janus-1.2.7 lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
ruby_rabbitmq_janus-1.2.7.pre.alpha lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
ruby_rabbitmq_janus-1.2.6 lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
ruby_rabbitmq_janus-1.2.5 lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
ruby_rabbitmq_janus-1.2.4 lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
ruby_rabbitmq_janus-1.2.3.pre.53 lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
ruby_rabbitmq_janus-1.2.3 lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
ruby_rabbitmq_janus-1.2.2 lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
ruby_rabbitmq_janus-1.2.1 lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
ruby_rabbitmq_janus-1.2.0 lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
ruby_rabbitmq_janus-1.1.12 lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
ruby_rabbitmq_janus-1.1.11 lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
ruby_rabbitmq_janus-1.1.10 lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
ruby_rabbitmq_janus-1.1.9 lib/generators/ruby_rabbitmq_janus/initializer_generator.rb