Sha256: f9b14e91684fd7f7d9a3e5e02134979b9557c73cc91fcfa17b8e826386350d8e

Contents?: true

Size: 656 Bytes

Versions: 4

Compression:

Stored size: 656 Bytes

Contents

require 'sequel'
require 'taps/version'

Sequel.datetime_class = DateTime

module Taps
  def self.exiting=(val)
    @@exiting = val
  end

  def exiting?
    (@@exiting ||= false) == true
  end

  class Config
    class << self
      attr_accessor :taps_database_url
      attr_accessor :login, :password, :database_url, :remote_url
      attr_accessor :chunksize

      def verify_database_url(db_url=nil)
        db_url ||= self.database_url
        db = Sequel.connect(db_url)
        db.tables
        db.disconnect
      rescue Object => e
        puts "Failed to connect to database:\n  #{e.class} -> #{e}"
        exit 1
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 4 rubygems

Version Path
tinroof-taps-0.3.24 lib/taps/config.rb
tapsicle-0.4.1 lib/taps/config.rb
taps-taps-0.3.24 lib/taps/config.rb
taps-0.3.24 lib/taps/config.rb