Sha256: 0aa7d99e0fdd49815bcdebc116e367d6ac85fd61cd238bfb99ebeeb5ab8cc690

Contents?: true

Size: 775 Bytes

Versions: 1

Compression:

Stored size: 775 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'webgen/item_tracker'

module Webgen
  class ItemTracker

    # This class is used to track changes to a file.
    #
    # The item for this tracker is the name of the file, i.e. add an item like this:
    #
    #   website.ext.item_tracker.add(some_node, :file, '/home/me/file.jpg')
    #
    class File

      def initialize(website) #:nodoc:
        @website = website
      end

      def item_id(filename) #:nodoc:
        filename
      end

      def item_data(filename) #:nodoc:
        ::File.mtime(filename)
      end

      def changed?(filename, old_mtime) #:nodoc:
        ::File.mtime(filename) > old_mtime
      end

      def node_referenced?(filename, mtime, node_alcn) #:nodoc:
        false
      end

    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
webgen-1.0.0.beta1 lib/webgen/item_tracker/file.rb