Module: FCSHD::FlexHome
Instance Method Summary collapse
- #[](*components) ⇒ Object
- #default ⇒ Object
-
#fcsh ⇒ Object
——————————————————.
-
#find_component(name) ⇒ Object
——————————————————.
- #framework_lib_dirs ⇒ Object
- #halo_swc ⇒ Object
- #known? ⇒ Boolean
- #to_s ⇒ Object
- #value ⇒ Object
Instance Method Details
#[](*components) ⇒ Object
28 29 30 |
# File 'lib/fcshd/flex-home.rb', line 28 def [](*components) File.join(value, *components) end |
#default ⇒ Object
7 8 9 |
# File 'lib/fcshd/flex-home.rb', line 7 def default "/usr/local/flex" end |
#fcsh ⇒ Object
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_dirs ⇒ Object
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_swc ⇒ Object
46 47 48 |
# File 'lib/fcshd/flex-home.rb', line 46 def halo_swc self["frameworks/themes/Halo/halo.swc"] end |
#known? ⇒ Boolean
11 12 13 |
# File 'lib/fcshd/flex-home.rb', line 11 def known? !value.nil? end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/fcshd/flex-home.rb', line 24 def to_s value end |
#value ⇒ Object
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 |