Class: AtkPaths

Inherits:
Object
  • Object
show all
Defined in:
lib/atk/atk_info.rb

Class Method Summary collapse

Class Method Details

.[](name) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/atk/atk_info.rb', line 6

def self.[](name)
    # convert symbols to strings
    name = name.to_s
    case name
        when 'atk'
            return HOME/"atk"
        when 'temp'
            return self['atk']/"temp"
        when 'info'
            return HOME/"info.yaml"
        when 'ruby'
            atk_path_settings = ATK.info["paths"]
            if atk_path_settings.is_a?(Hash) and atk_path_settings["ruby"].is_a?(String)
                ruby_path = atk_path_settings["ruby"]
            elsif OS.is?(:unix)
                ruby_path = "/usr/bin/ruby"
            else
                # TODO: fix this case
                ruby_path = ""
            end
            return ruby_path
    end
end