Class: Buffer::Setup

Inherits:
Object
  • Object
show all
Defined in:
lib/buffer/setup.rb

Instance Method Summary collapse

Constructor Details

#initialize(args = "~/.bufferapprc") ⇒ Setup



5
6
7
8
9
10
11
12
# File 'lib/buffer/setup.rb', line 5

def initialize(args="~/.bufferapprc")
  @path = Pathname.new(args)
  if exists?
    @content = YAML.load_file(File.expand_path path)
  else
    raise Buffer::Error::ConfigFileMissing
  end
end

Instance Method Details

#exists?Boolean



18
19
20
# File 'lib/buffer/setup.rb', line 18

def exists?
  File.exists?(File.expand_path path)
end

#pathObject



14
15
16
# File 'lib/buffer/setup.rb', line 14

def path
  @path.to_s
end