Sha256: c8a803edf88f90fb43476ababb4667c2eb993fd1d44494353d3746807aea2940

Contents?: true

Size: 674 Bytes

Versions: 13

Compression:

Stored size: 674 Bytes

Contents

require 'sequel'
require 'sqlite3'
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

13 entries across 13 versions & 1 rubygems

Version Path
taps-0.3.23 lib/taps/config.rb
taps-0.3.23.pre1 lib/taps/config.rb
taps-0.3.22.pre2 lib/taps/config.rb
taps-0.3.22.pre1 lib/taps/config.rb
taps-0.3.21 lib/taps/config.rb
taps-0.3.20 lib/taps/config.rb
taps-0.3.20.pre2 lib/taps/config.rb
taps-0.3.20.pre1 lib/taps/config.rb
taps-0.3.19 lib/taps/config.rb
taps-0.3.19.pre1 lib/taps/config.rb
taps-0.3.18 lib/taps/config.rb
taps-0.3.17 lib/taps/config.rb
taps-0.3.15 lib/taps/config.rb