Module: TFClient::DotDir

Defined in:
lib/textflight-client/dot_dir.rb

Class Method Summary collapse

Class Method Details

.directoryObject



4
5
6
7
8
9
10
11
# File 'lib/textflight-client/dot_dir.rb', line 4

def self.directory
  home = TFClient::Environment.user_home_directory
  dir = File.join(home, ".textflight", "client")
  if !File.exist?(dir)
    FileUtils.mkdir_p(dir)
  end
  dir
end

.local_database_file(dev:) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/textflight-client/dot_dir.rb', line 13

def self.local_database_file(dev:)
  if dev
    File.expand_path(File.join(self.directory,"development.db"))
  else
    File.expand_path(File.join(self.directory,"production.db"))
  end
end