class Boxafe::Config

Constants

OPTION_KEYS

TODO: document unmount_delay TODO: add option to chdir, boxes relative to working directory when calling start by default

Attributes

boxes[R]
options[R]

Public Class Methods

new(options = {}) click to toggle source
# File lib/boxafe/config.rb, line 10
def initialize options = {}
  @boxes = []
  @options = { encfs: 'encfs', umount: 'umount', umount_delay: 0.5 }.merge options
end

Public Instance Methods

configure(file = nil, &block) click to toggle source
# File lib/boxafe/config.rb, line 15
def configure file = nil, &block
  DSL.new(self).tap do |dsl|
    dsl.instance_eval File.read(file), file if file
    dsl.instance_eval &block if block
  end
  self
end
file() click to toggle source
# File lib/boxafe/config.rb, line 27
def file
  File.expand_path [ @options[:config], ENV['BOXAFE_CONFIG'], "~/.boxafe.rb" ].compact.first
end
load() click to toggle source
# File lib/boxafe/config.rb, line 23
def load
  configure file
end