Module: FCSHD::FlexHome

Extended by:
FlexHome
Included in:
FlexHome
Defined in:
lib/fcshd/flex-home.rb

Instance Method Summary collapse

Instance Method Details

#[](*components) ⇒ Object



28
29
30
# File 'lib/fcshd/flex-home.rb', line 28

def [](*components)
  File.join(value, *components)
end

#defaultObject



7
8
9
# File 'lib/fcshd/flex-home.rb', line 7

def default
  "/usr/local/flex"
end

#fcshObject




34
35
36
# File 'lib/fcshd/flex-home.rb', line 34

def fcsh
  self["bin/fcsh"]
end

#find_component(name) ⇒ Object




52
53
54
55
56
57
# File 'lib/fcshd/flex-home.rb', line 52

def find_component(name)
  Find.find(self["frameworks/projects"]) do |filename|
    break File.dirname(filename).sub(%r{.+/src/}, "").gsub("/", ".") if
      File.basename(filename).sub(/\..*/, "") == name
  end
end

#framework_lib_dirsObject



38
39
40
41
42
43
44
# File 'lib/fcshd/flex-home.rb', line 38

def framework_lib_dirs
  [].tap do |result|
    Find.find(self["frameworks/libs"]) do |file|
      result << file if File.directory? file
    end
  end
end

#halo_swcObject



46
47
48
# File 'lib/fcshd/flex-home.rb', line 46

def halo_swc
  self["frameworks/themes/Halo/halo.swc"]
end

#known?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/fcshd/flex-home.rb', line 11

def known?
  !value.nil?
end

#to_sObject



24
25
26
# File 'lib/fcshd/flex-home.rb', line 24

def to_s
  value
end

#valueObject



15
16
17
18
19
20
21
22
# File 'lib/fcshd/flex-home.rb', line 15

def value
  ENV["FLEX_HOME"] or
    if File.directory? default
      default
    else
      nil
    end
end