Class: Dir
Class Method Summary collapse
- .chdir(dir) ⇒ Object
- .home ⇒ Object
- .pwd ⇒ Object (also: getwd)
Class Method Details
.chdir(dir) ⇒ Object
3 4 5 6 7 8 9 |
# File 'opal/opal/corelib/dir.rb', line 3 def chdir(dir) prev_cwd = `Opal.current_dir` `Opal.current_dir = #{dir}` yield ensure `Opal.current_dir = #{prev_cwd}` end |
.home ⇒ Object
15 16 17 |
# File 'opal/opal/corelib/dir.rb', line 15 def home ::ENV['HOME'] || '.' end |
.pwd ⇒ Object Also known as: getwd
11 12 13 |
# File 'opal/opal/corelib/dir.rb', line 11 def pwd `Opal.current_dir || '.'` end |