Sha256: 98f719529db397ce82270c4fb5d03e078f4e19deec8822cf1211c217ce58f568

Contents?: true

Size: 393 Bytes

Versions: 20

Compression:

Stored size: 393 Bytes

Contents

class File

  def self.read path
    %x(
        var Paths = Java.type('java.nio.file.Paths');
        var Files = Java.type('java.nio.file.Files');
        var lines = Files.readAllLines(Paths.get(path), Java.type('java.nio.charset.StandardCharsets').UTF_8);
        var data = [];
        lines.forEach(function(line) { data.push(line); });
        return data.join("\n");
      )
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
opal-0.10.6 stdlib/nashorn/file.rb
opal-0.10.6.beta stdlib/nashorn/file.rb
opal-0.10.5 stdlib/nashorn/file.rb
opal-0.10.4 stdlib/nashorn/file.rb
opal-0.10.3 stdlib/nashorn/file.rb
opal-0.10.2 stdlib/nashorn/file.rb
opal-0.10.1 stdlib/nashorn/file.rb
opal-0.10.0 stdlib/nashorn/file.rb
opal-0.10.0.rc2 stdlib/nashorn/file.rb
opal-0.9.4 stdlib/nashorn/file.rb
opal-0.9.3 stdlib/nashorn/file.rb
opal-0.10.0.rc1 stdlib/nashorn/file.rb
opal-0.10.0.beta5 stdlib/nashorn/file.rb
opal-0.10.0.beta4 stdlib/nashorn/file.rb
opal-0.10.0.beta3 stdlib/nashorn/file.rb
opal-0.10.0.beta2 stdlib/nashorn/file.rb
opal-0.10.0.beta1 stdlib/nashorn/file.rb
opal-0.9.2 stdlib/nashorn/file.rb
opal-0.9.0 stdlib/nashorn/file.rb
opal-0.9.0.rc1 stdlib/nashorn/file.rb