Sha256: 06d38577e75378cf05159dda362a4e00ff96cf2f4bde8b19eb409498554e8de5

Contents?: true

Size: 1.3 KB

Versions: 184

Compression:

Stored size: 1.3 KB

Contents

class Bundler::ConnectionPool
  class Wrapper < ::BasicObject
    METHODS = [:with, :pool_shutdown, :wrapped_pool]

    def initialize(options = {}, &block)
      @pool = options.fetch(:pool) { ::Bundler::ConnectionPool.new(options, &block) }
    end

    def wrapped_pool
      @pool
    end

    def with(&block)
      @pool.with(&block)
    end

    def pool_shutdown(&block)
      @pool.shutdown(&block)
    end

    def pool_size
      @pool.size
    end

    def pool_available
      @pool.available
    end

    def respond_to?(id, *args)
      METHODS.include?(id) || with { |c| c.respond_to?(id, *args) }
    end

    # rubocop:disable Style/MissingRespondToMissing
    if ::RUBY_VERSION >= "3.0.0"
      def method_missing(name, *args, **kwargs, &block)
        with do |connection|
          connection.send(name, *args, **kwargs, &block)
        end
      end
    elsif ::RUBY_VERSION >= "2.7.0"
      ruby2_keywords def method_missing(name, *args, &block)
        with do |connection|
          connection.send(name, *args, &block)
        end
      end
    else
      def method_missing(name, *args, &block)
        with do |connection|
          connection.send(name, *args, &block)
        end
      end
    end
    # rubocop:enable Style/MethodMissingSuper
    # rubocop:enable Style/MissingRespondToMissing
  end
end

Version data entries

184 entries across 184 versions & 6 rubygems

Version Path
harbr-0.1.67 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.66 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.65 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.64 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.63 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.62 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.61 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.60 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.59 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.58 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.57 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.56 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.55 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.54 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.53 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.52 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.50 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.49 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.48 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
harbr-0.1.47 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb