Sha256: 6f2527f363c86d395086b7331c8e705c8beebe221b24c3bd9f6f6680bc471669
Contents?: true
Size: 523 Bytes
Versions: 34
Compression:
Stored size: 523 Bytes
Contents
module Flydata module PluginSupport class SourcePositionFile attr_accessor :path def initialize(path) @path = path end def exists? File.exists?(@path) end def read File.open(@path) {|f| f.read } end def pos if exists? self.class::SOURCE_POS_CLASS.load(read) else nil end end def save(*args) c = self.class::SOURCE_POS_CLASS.new(*args) File.open(@path, 'w') {|f| f.write(c.to_s) } c end end end end
Version data entries
34 entries across 34 versions & 1 rubygems