Sha256: 547eade3adcac89bc7fab432a0e48dc5c3af49350e4b6e3c1fe34f2bca38024b

Contents?: true

Size: 725 Bytes

Versions: 26

Compression:

Stored size: 725 Bytes

Contents

require 'sequel'
require 'sqlite3'

module Taps
	def self.version_yml
		@@version_yml ||= YAML.load(File.read(File.dirname(__FILE__) + '/../../VERSION.yml'))
	end

	def self.version
		"#{version_yml[:major]}.#{version_yml[:minor]}.#{version_yml[:patch]}"
	end

	def self.compatible_version
		"#{version_yml[:major]}.#{version_yml[:minor]}"
	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 = Sequel.connect(self.database_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

26 entries across 26 versions & 3 rubygems

Version Path
ricardochimal-taps-0.2.12 lib/taps/config.rb
ricardochimal-taps-0.2.13 lib/taps/config.rb
ricardochimal-taps-0.2.14 lib/taps/config.rb
ricardochimal-taps-0.2.15 lib/taps/config.rb
ricardochimal-taps-0.2.16 lib/taps/config.rb
ricardochimal-taps-0.2.18 lib/taps/config.rb
ricardochimal-taps-0.2.19 lib/taps/config.rb
ricardochimal-taps-0.2.9 lib/taps/config.rb
taps-0.2.25 lib/taps/config.rb
taps-0.2.24 lib/taps/config.rb
taps-0.2.23 lib/taps/config.rb
taps-0.2.22 lib/taps/config.rb
taps-0.2.21 lib/taps/config.rb
taps-0.2.20 lib/taps/config.rb
matthewtodd-taps-0.2.19 lib/taps/config.rb
taps-0.2.19 lib/taps/config.rb
taps-0.2.11 lib/taps/config.rb
taps-0.2.12 lib/taps/config.rb
taps-0.2.10 lib/taps/config.rb
taps-0.2.13 lib/taps/config.rb