Class: Dutiful::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/dutiful/config.rb

Constant Summary collapse

PATH =
File.expand_path '~/.dutiful/config.toml'

Class Method Summary collapse

Class Method Details

.osx?Boolean



15
16
17
# File 'lib/dutiful/config.rb', line 15

def self.osx?
  `uname -s`.strip == 'Darwin'
end

.storageObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/dutiful/config.rb', line 4

def self.storage
  @storage ||= if content[:storage]
    name = content[:storage][:name]
    path = content[:storage][:path]

    Dutiful::Storage.new name: name, path: path
  else
    Dutiful::Storage.find { |storage| storage.available? }
  end
end