Sha256: 5ca1a995acaffb77c212274771717c5f29abab7367c083e473525cbda65ffd30
Contents?: true
Size: 755 Bytes
Versions: 20
Compression:
Stored size: 755 Bytes
Contents
`/* global Java */` require 'corelib/file' 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 def self.file?(path) %x{ var Files = Java.type('java.nio.file.Files'); return Files.exists(path) && Files.isRegularFile(path); } end def self.readable?(path) %x{ var Files = Java.type('java.nio.file.Files'); return Files.exists(path) && Files.isReadable(path); } end end
Version data entries
20 entries across 20 versions & 1 rubygems