MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / get_absolute_path

Method get_absolute_path

ruby/engine/embedded_help.rb:26–42  ·  view source on GitHub ↗
(p)

Source from the content-addressed store, hash-verified

24 end
25
26 def self.get_absolute_path(p)
27 absolute_path = ""
28 if p.to_s.chars.first == ':' then
29 p2 = String.new(p.to_s)
30 p2[0] = ''
31 absolute_path = File.expand_path p2
32
33 # strip Windows drive letters
34 if /^[A-Za-z]\:/.match(absolute_path.strip)
35 absolute_path = absolute_path[2..-1]
36 end
37 absolute_path = ':' + absolute_path
38 else
39 absolute_path = File.expand_path p
40 end
41 return absolute_path
42 end
43
44 def self.preprocess_ruby_script(s)
45#puts "self.preprocess_ruby_script before: #{s}"

Callers 14

require_relativeMethod · 0.80
openMethod · 0.80
readMethod · 0.80
openMethod · 0.80
expand_pathMethod · 0.80
absolute_pathMethod · 0.80
realpathMethod · 0.80
directory?Method · 0.80
file?Method · 0.80
globMethod · 0.80
chdirMethod · 0.80

Calls 2

to_sMethod · 0.80
expand_pathMethod · 0.80

Tested by

no test coverage detected