Sha256: 15d03c96d6011b4cae986f874c7f8ce55af51629cd13a143502df45a724fe799

Contents?: true

Size: 840 Bytes

Versions: 6

Compression:

Stored size: 840 Bytes

Contents

# frozen_string_literal: true

require_relative "neetodeploy/autoscale/version"

module Neetodeploy
  module Autoscale
    class Error < StandardError; end

    class << self
      def setup_middleware
        require "neetodeploy/autoscale/middleware"
        Neetodeploy::Autoscale.setup_rails if defined? Rails
        Neetodeploy::Autoscale.setup_sidekiq if defined?(Sidekiq)
      end

      def setup_rails
        require "neetodeploy/autoscale/railtie"
      end

      def setup_sidekiq
        require "neetodeploy/autoscale/sidekiq_middleware"

        Sidekiq.configure_server do |config|
          config.server_middleware do |chain|
            chain.add Neetodeploy::SidekiqMiddleware
          end
        end
      end
    end
  end
end

ENV.to_h["NEETODEPLOY_APP_NAME"].present? && Neetodeploy::Autoscale.setup_middleware

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
neetodeploy-autoscale-1.0.5 lib/neetodeploy-autoscale.rb
neetodeploy-autoscale-1.0.4 lib/neetodeploy-autoscale.rb
neetodeploy-autoscale-1.0.3 lib/neetodeploy-autoscale.rb
neetodeploy-autoscale-1.0.2 lib/neetodeploy-autoscale.rb
neetodeploy-autoscale-1.0.1 lib/neetodeploy-autoscale.rb
neetodeploy-autoscale-1.0.0 lib/neetodeploy-autoscale.rb