Sha256: f16bea20f933a0203c6e560b29c2b6b8736a87093e8804697a15d67d0616b375

Contents?: true

Size: 1.46 KB

Versions: 10

Compression:

Stored size: 1.46 KB

Contents

module Peatio
  module Bitgo
    module Hooks
      BLOCKCHAIN_VERSION_REQUIREMENT = "~> 1.0.0"
      WALLET_VERSION_REQUIREMENT = "~> 1.0.0"

      class << self
        def check_compatibility
          unless Gem::Requirement.new(BLOCKCHAIN_VERSION_REQUIREMENT)
                                 .satisfied_by?(Gem::Version.new(Peatio::Blockchain::VERSION))
            [
              "Bitgo blockchain version requirement was not satisfied by Peatio::Blockchain.",
              "Bitgo blockchain requires #{BLOCKCHAIN_VERSION_REQUIREMENT}.",
              "Peatio::Blockchain version is #{Peatio::Blockchain::VERSION}"
            ].join('\n').tap { |s| Kernel.abort s }
          end

          unless Gem::Requirement.new(WALLET_VERSION_REQUIREMENT)
                                 .satisfied_by?(Gem::Version.new(Peatio::Wallet::VERSION))
            [
              "Bitgo wallet version requirement was not satisfied by Peatio::Wallet.",
              "Bitgo wallet requires #{WALLET_VERSION_REQUIREMENT}.",
              "Peatio::Wallet version is #{Peatio::Wallet::VERSION}"
            ].join('\n').tap { |s| Kernel.abort s }
          end
        end

        def register
          Peatio::Blockchain.registry[:bitgo] = Bitgo::Blockchain
          Peatio::Wallet.registry[:bitgo] = Bitgo::Wallet
        end
      end

      if defined?(Rails::Railtie)
        require "peatio/bitgo/railtie"
      else
        check_compatibility
        register
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
ouroboros-peatio-bitgo-3.1.0 lib/peatio/bitgo/hooks.rb
peatio-bitgo-3.1.0 lib/peatio/bitgo/hooks.rb
peatio-bitgo-2.6.8 lib/peatio/bitgo/hooks.rb
peatio-bitgo-2.6.7 lib/peatio/bitgo/hooks.rb
peatio-bitgo-2.6.6 lib/peatio/bitgo/hooks.rb
peatio-bitgo-2.6.5 lib/peatio/bitgo/hooks.rb
peatio-bitgo-2.6.4 lib/peatio/bitgo/hooks.rb
peatio-bitgo-2.6.3 lib/peatio/bitgo/hooks.rb
peatio-bitgo-2.6.2 lib/peatio/bitgo/hooks.rb
peatio-bitgo-2.6.1 lib/peatio/bitgo/hooks.rb