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 |
.pwd ⇒ Object Also known as: getwd
11 12 13 |
# File 'opal/opal/corelib/dir.rb', line 11 def pwd `Opal.current_dir || '.'` end |