Sha256: d67398b5f027e6bcf13aaa88c93a14c7b1d252ccce8189f63db8dff2347672a0

Contents?: true

Size: 349 Bytes

Versions: 6

Compression:

Stored size: 349 Bytes

Contents

# backtick_javascript: true

class ::Dir
  class << self
    def chdir(dir)
      prev_cwd = `Opal.current_dir`
      `Opal.current_dir = #{dir}`
      yield
    ensure
      `Opal.current_dir = #{prev_cwd}`
    end

    def pwd
      `Opal.current_dir || '.'`
    end

    def home
      ::ENV['HOME'] || '.'
    end

    alias getwd pwd
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opal-1.8.3.rc1 opal/corelib/dir.rb
opal-1.8.2 opal/corelib/dir.rb
opal-1.8.1 opal/corelib/dir.rb
opal-1.8.0 opal/corelib/dir.rb
opal-1.8.0.beta1 opal/corelib/dir.rb
opal-1.8.0.alpha1 opal/corelib/dir.rb