Sha256: 38a501270432c517f072f983b767bb4c0d8d363af7d357596904da1604e698c8

Contents?: true

Size: 1.51 KB

Versions: 17

Compression:

Stored size: 1.51 KB

Contents

require "glueby/version"
require "glueby/constants"
require 'tapyrus'

module Glueby
  autoload :Contract, 'glueby/contract'
  autoload :Generator, 'glueby/generator'
  autoload :Wallet, 'glueby/wallet'
  autoload :Internal, 'glueby/internal'
  autoload :AR, 'glueby/active_record'
  autoload :FeeProvider, 'glueby/fee_provider'
  autoload :Configuration, 'glueby/configuration'
  autoload :BlockSyncer, 'glueby/block_syncer'
  autoload :UtxoProvider, 'glueby/utxo_provider'

  if defined? ::Rails::Railtie
    require 'glueby/railtie'
  end

  module GluebyLogger
    def logger
      if defined?(Rails)
        Rails.logger
      else
        Logger.new(STDOUT)
      end
    end
  end

  # Add prefix to activerecord table names
  def self.table_name_prefix
    'glueby_'
  end

  # Returns the global [Configuration](RSpec/Core/Configuration) object.
  def self.configuration
    @configuration ||= Glueby::Configuration.new
  end

  # Yields the global configuration to a block.
  # @yield [Configuration] global configuration
  #
  # @example
  #     Glueby.configure do |config|
  #       config.wallet_adapter = :activerecord
  #       config.rpc_config = { schema: 'http', host: '127.0.0.1', port: 12381, user: 'user', password: 'pass' }
  #     end
  def self.configure
    yield configuration if block_given?
  end

  # Base error classes. These error classes must be used as a super class in all error classes that is defined and
  # raised in glueby library.
  class Error < StandardError; end
  class ArgumentError < Error; end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
glueby-1.2.3 lib/glueby.rb
glueby-1.2.2 lib/glueby.rb
glueby-1.2.1 lib/glueby.rb
glueby-1.2.0 lib/glueby.rb
glueby-1.2.0.beta.3 lib/glueby.rb
glueby-1.2.0.beta.2 lib/glueby.rb
glueby-1.2.0.beta.1 lib/glueby.rb
glueby-1.1.2 lib/glueby.rb
glueby-1.1.1 lib/glueby.rb
glueby-1.1.0 lib/glueby.rb
glueby-1.0.0 lib/glueby.rb
glueby-0.12.0 lib/glueby.rb
glueby-0.11.0 lib/glueby.rb
glueby-0.10.2 lib/glueby.rb
glueby-0.10.1 lib/glueby.rb
glueby-0.10.0 lib/glueby.rb
glueby-0.9.0 lib/glueby.rb