Sha256: 36f1119339ae19c51c970a20687037779d19fc56a36949e297cb996628fcc106

Contents?: true

Size: 805 Bytes

Versions: 15

Compression:

Stored size: 805 Bytes

Contents

require 'coin'
require 'sym/app/password/providers'

module Sym
  module App
    module Password
      module Providers
        class DrbProvider

          attr_accessor :coin

          def initialize(**opts)
            Coin.uri  = opts[:uri] || Sym::Configuration.config.password_cache_arguments[:drb][:opts][:uri]
            self.coin = Coin
            alive?
            self
          end

          def alive?
            self.read('bogus') rescue nil
            self.coin.server_running?
          end

          def write(*args)
            coin.server.send(:write, *args)
          end

          def read(*args)
            coin.send(:read, *args)
          end

          def clear
            coin.clear
          end
        end

        register DrbProvider
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sym-2.8.5 lib/sym/app/password/providers/drb_provider.rb
sym-2.8.4 lib/sym/app/password/providers/drb_provider.rb
sym-2.8.2 lib/sym/app/password/providers/drb_provider.rb
sym-2.8.1 lib/sym/app/password/providers/drb_provider.rb
sym-2.8.0 lib/sym/app/password/providers/drb_provider.rb
sym-2.7.0 lib/sym/app/password/providers/drb_provider.rb
sym-2.6.3 lib/sym/app/password/providers/drb_provider.rb
sym-2.6.2 lib/sym/app/password/providers/drb_provider.rb
sym-2.6.1 lib/sym/app/password/providers/drb_provider.rb
sym-2.6.0 lib/sym/app/password/providers/drb_provider.rb
sym-2.5.3 lib/sym/app/password/providers/drb_provider.rb
sym-2.5.1 lib/sym/app/password/providers/drb_provider.rb
sym-2.5.0 lib/sym/app/password/providers/drb_provider.rb
sym-2.4.3 lib/sym/app/password/providers/drb_provider.rb
sym-2.3.0 lib/sym/app/password/providers/drb_provider.rb