module CW::FileDetails

Constants

ABBREVIATIONS
AUDIO_DIR
BOOKMARK_FILE
CALLS
CALLS_FILENAME
CODE
CODE_FILENAME
CONFIG_FILENAME
CONFIG_PATH
DASH_FILENAME
DATA
DEF_AUDIO_FILENAME
DICT_DIR
DICT_FILENAME
DOT_AUDIO_DIR
DOT_CW_DIR
DOT_FILENAME
E_SPACE_FILENAME
HERE
Q_CODES
ROOT
SPACE_FILENAME
TEXT
USER_CONFIG_PATH
WORK_DIR

Public Instance Methods

audio_dir() click to toggle source
# File lib/cw/file_details.rb, line 87
def audio_dir
  @audio_dir ||= process_audio_dir
end
audio_filename() click to toggle source
# File lib/cw/file_details.rb, line 91
def audio_filename
  @audio_filename ||=
    Cfg.config["audio_filename"] ?
      Cfg.config["audio_filename"] :
      DEF_AUDIO_FILENAME
end
dash_path() click to toggle source
# File lib/cw/file_details.rb, line 58
def dash_path
  File.join dot_audio_dir, DASH_FILENAME
end
default_audio_dir() click to toggle source
# File lib/cw/file_details.rb, line 70
def default_audio_dir
  Dir.mkdir(AUDIO_DIR) unless File.exists? AUDIO_DIR
  AUDIO_DIR
end
dot_audio_dir() click to toggle source
# File lib/cw/file_details.rb, line 50
def dot_audio_dir
  @dot_audio_dir ||= process_dot_audio
end
dot_cw_dir() click to toggle source
# File lib/cw/file_details.rb, line 41
def dot_cw_dir
  @dot_cw_dir ||= process_dot_cw
end
dot_path() click to toggle source
# File lib/cw/file_details.rb, line 54
def dot_path
  File.join dot_audio_dir, DOT_FILENAME
end
e_space_path() click to toggle source
# File lib/cw/file_details.rb, line 66
def e_space_path
  File.join dot_audio_dir, E_SPACE_FILENAME
end
init_filenames() click to toggle source
# File lib/cw/file_details.rb, line 31
def init_filenames
  @repeat_tone     = File.join(AUDIO_DIR, "rpt.mp3")
  @r_tone          = File.join(AUDIO_DIR, "r.mp3")
end
process_audio_dir() click to toggle source
# File lib/cw/file_details.rb, line 75
def process_audio_dir
  Cfg.config['audio_dir'] ? user_audio_dir : default_audio_dir
end
process_dot_audio() click to toggle source
# File lib/cw/file_details.rb, line 45
def process_dot_audio
  Dir.mkdir(DOT_AUDIO_DIR) unless(dot_cw_dir && File.exists?(DOT_AUDIO_DIR))
  DOT_AUDIO_DIR
end
process_dot_cw() click to toggle source
# File lib/cw/file_details.rb, line 36
def process_dot_cw
  Dir.mkdir(DOT_CW_DIR) unless File.exists? DOT_CW_DIR
  DOT_CW_DIR
end
progress_file() click to toggle source
# File lib/cw/file_details.rb, line 98
def progress_file
  File.join(dot_cw_dir, BOOKMARK_FILE)
end
space_path() click to toggle source
# File lib/cw/file_details.rb, line 62
def space_path
  File.join dot_audio_dir, SPACE_FILENAME
end
user_audio_dir() click to toggle source
# File lib/cw/file_details.rb, line 79
def user_audio_dir
  @user_audio_dir ||=
    unless File.exists? Cfg.config['audio_dir']
      Dir.mkdir Cfg.config['audio_dir']
    end
  Cfg.config['audio_dir']
end