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