Class: BranchDb::SqliteSwitcher

Inherits:
Switcher
  • Object
show all
Defined in:
lib/branch_db/sqlite_switcher.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Switcher

branches, #copy_from, create, #create_empty_database, #delete_database, #exists?, #initialize, #switch!, which

Constructor Details

This class inherits a constructor from BranchDb::Switcher

Class Method Details

.can_handle?(config) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/branch_db/sqlite_switcher.rb', line 7

def self.can_handle?(config)
  (config['adapter'] =~ /^sqlite/) == 0
end

Instance Method Details

#currentObject



11
12
13
14
# File 'lib/branch_db/sqlite_switcher.rb', line 11

def current
  current_branch = branch_db_exists?(@branch) ? @branch : 'master'
  puts "#{@rails_env}: #{rails_root_relative(branch_db(current_branch))} (SQLite)"
end