Module: Lexdrill::Config

Defined in:
lib/lexdrill/config.rb

Constant Summary collapse

FILENAME =
".drill.txt"
COUNTER_FILENAME =
".drill.counter"
DRILL_PATH =
File.join(base_path, FILENAME)
COUNTER_PATH =
File.join(base_path, COUNTER_FILENAME)

Class Method Summary collapse

Class Method Details

.base_pathObject



12
13
14
# File 'lib/lexdrill/config.rb', line 12

def self.base_path
  ENV.fetch("LEXDRILL_PATH", nil) || dir_path || Dir.home
end

.dir_pathObject



7
8
9
10
# File 'lib/lexdrill/config.rb', line 7

def self.dir_path
  cwd = Dir.pwd
  cwd if File.exist?(File.join(cwd, FILENAME))
end