Sha256: ef0d3b35c6710a7a0fe509c86bc69f524c44ac276c1370c827793807cb68d799

Contents?: true

Size: 624 Bytes

Versions: 14

Compression:

Stored size: 624 Bytes

Contents

# encoding: utf-8

module FileWatch module Stat
  class Generic

    attr_reader :inode, :modified_at, :size, :inode_struct

    def initialize(source)
      @source = source # Pathname
      restat
    end

    def restat
      stat = @source.stat
      @inode = stat.ino.to_s
      @modified_at = stat.mtime.to_f
      @size = stat.size
      @inode_struct = InodeStruct.new(@inode, stat.dev_major, stat.dev_minor)
    end

    def windows?
      false
    end

    def inspect
      "<#{self.class.name} size=#{@size}, modified_at=#{@modified_at}, inode='#{@inode}', inode_struct=#{@inode_struct}>"
    end
  end
end end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
logstash-input-file-4.4.6 lib/filewatch/stat/generic.rb
logstash-input-file-4.4.5 lib/filewatch/stat/generic.rb
logstash-input-file-4.4.4 lib/filewatch/stat/generic.rb
logstash-input-file-4.4.3 lib/filewatch/stat/generic.rb
logstash-input-file-4.4.2 lib/filewatch/stat/generic.rb
logstash-input-file-4.4.1 lib/filewatch/stat/generic.rb
logstash-input-file-4.4.0 lib/filewatch/stat/generic.rb
logstash-input-file-4.3.1 lib/filewatch/stat/generic.rb
logstash-input-file-4.3.0 lib/filewatch/stat/generic.rb
logstash-input-file-4.2.4 lib/filewatch/stat/generic.rb
logstash-input-file-4.2.3 lib/filewatch/stat/generic.rb
logstash-input-file-4.2.2 lib/filewatch/stat/generic.rb
logstash-input-file-4.2.1 lib/filewatch/stat/generic.rb
logstash-input-file-4.2.0 lib/filewatch/stat/generic.rb