Class: Conjoiner::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/conjoiner/configuration.rb

Overview

Frontend for determining the configuration of conjoiner. Either using defaults specified in this file, or overridden by configuration located in:

~/.config/conjoiner/

Instance Method Summary collapse

Instance Method Details

#aspectsArray<String>

Returns:

  • (Array<String>)


10
11
12
# File 'lib/conjoiner/configuration.rb', line 10

def aspects
  %w[prime sugar]
end

#dated_repository_names(aspect) ⇒ Array<String>

Parameters:

  • aspect (String)

Returns:

  • (Array<String>)


32
33
34
35
36
37
38
# File 'lib/conjoiner/configuration.rb', line 32

def dated_repository_names(aspect)
  if aspect == 'prime'
    %w[gpx log misc]
  else
    %w[log]
  end
end

#default_aspectString

Returns:

  • (String)


15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/conjoiner/configuration.rb', line 15

def default_aspect
  return @default_aspect if @default_aspect

  default_aspect_pathname =
    Pathname.new(Dir.home).join('.config', 'conjoiner', 'default_aspect')

  @default_aspect =
    if default_aspect_pathname.readable?
      default_aspect_pathname.read.strip
    else
      'prime'
    end
end