Class: Konfig
- Inherits:
-
Object
- Object
- Konfig
- Defined in:
- lib/myosx/konfig.rb
Instance Method Summary collapse
- #config_file ⇒ Object
- #create_workspace(directory) ⇒ Object
- #global ⇒ Object
- #workspace_directory ⇒ Object
Instance Method Details
#config_file ⇒ Object
8 9 10 |
# File 'lib/myosx/konfig.rb', line 8 def config_file ENV["MYOSX_CONFIG"] || File.('~/.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 |
#global ⇒ Object
12 13 14 |
# File 'lib/myosx/konfig.rb', line 12 def global YAML.load_file(config_file) end |
#workspace_directory ⇒ Object
16 17 18 |
# File 'lib/myosx/konfig.rb', line 16 def workspace_directory ENV['MYOSX_WORKSPACE'] || File.('~/.myosx/') end |