Class: Konfig

Inherits:
Object
  • Object
show all
Defined in:
lib/myosx/konfig.rb

Instance Method Summary collapse

Instance Method Details

#config_fileObject



8
9
10
# File 'lib/myosx/konfig.rb', line 8

def config_file
  ENV["MYOSX_CONFIG"] || File.expand_path('~/.myosx.cnf')
end

#create_workspace(directory) ⇒ Object



20
21
22
23
24
25
# File 'lib/myosx/konfig.rb', line 20

def create_workspace(directory)
  unless Dir.exists?(directory)
    puts "Creating workspace: #{directory}"
    Dir.mkdir("#{directory}", 0750)
  end
end

#globalObject



12
13
14
# File 'lib/myosx/konfig.rb', line 12

def global
  YAML.load_file(config_file)
end

#workspace_directoryObject



16
17
18
# File 'lib/myosx/konfig.rb', line 16

def workspace_directory
  ENV['MYOSX_WORKSPACE'] || File.expand_path('~/.myosx/')
end