Class: Tapsoob::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/tapsoob/config.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.chunksizeObject

Returns the value of attribute chunksize.



20
21
22
# File 'lib/tapsoob/config.rb', line 20

def chunksize
  @chunksize
end

.database_urlObject

Returns the value of attribute database_url.



19
20
21
# File 'lib/tapsoob/config.rb', line 19

def database_url
  @database_url
end

.dump_pathObject

Returns the value of attribute dump_path.



19
20
21
# File 'lib/tapsoob/config.rb', line 19

def dump_path
  @dump_path
end

.loginObject

Returns the value of attribute login.



19
20
21
# File 'lib/tapsoob/config.rb', line 19

def 
  @login
end

.passwordObject

Returns the value of attribute password.



19
20
21
# File 'lib/tapsoob/config.rb', line 19

def password
  @password
end

.tapsoob_database_urlObject

Returns the value of attribute tapsoob_database_url.



18
19
20
# File 'lib/tapsoob/config.rb', line 18

def tapsoob_database_url
  @tapsoob_database_url
end

Class Method Details

.verify_database_url(db_url = nil) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/tapsoob/config.rb', line 22

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