Sha256: dba956fd51d4a61b07f7d4bf341a7b6f7a2ea62e3a6199a5c5c7c17a84e45ee1

Contents?: true

Size: 751 Bytes

Versions: 330

Compression:

Stored size: 751 Bytes

Contents

module FSSM::State
  class File
    attr_reader :path

    def initialize(path)
      @path = path
    end

    def refresh(base=nil, skip_callbacks=false)
      base ||= @path.to_pathname
      used_to_exist, @exists = @exists, base.exists?
      # this handles bad symlinks without failing. why handle bad symlinks at
      # all? well, we could still be interested in their creation and deletion.
      old_mtime, @mtime = @mtime, base.symlink? ? Time.at(0) : base.mtime if @exists

      unless skip_callbacks
        @path.delete(@path.to_s) if used_to_exist && !@exists
        @path.create(@path.to_s) if !used_to_exist && @exists
        @path.update(@path.to_s) if used_to_exist && @exists && old_mtime != @mtime
      end
    end

  end
end

Version data entries

330 entries across 330 versions & 7 rubygems

Version Path
haml-3.1.3 vendor/sass/vendor/fssm/lib/fssm/state/file.rb
haml-3.2.0.alpha.8 vendor/sass/vendor/fssm/lib/fssm/state/file.rb
sass-3.1.4 vendor/fssm/lib/fssm/state/file.rb
sass-3.2.0.alpha.11 vendor/fssm/lib/fssm/state/file.rb
sass-3.1.3 vendor/fssm/lib/fssm/state/file.rb
sass-3.2.0.alpha.9 vendor/fssm/lib/fssm/state/file.rb
sass-3.2.0.alpha.8 vendor/fssm/lib/fssm/state/file.rb
haml-3.2.0.alpha.5 vendor/sass/vendor/fssm/lib/fssm/state/file.rb
haml-3.2.0.alpha.4 vendor/sass/vendor/fssm/lib/fssm/state/file.rb
haml-3.1.2 vendor/sass/vendor/fssm/lib/fssm/state/file.rb
sass-3.1.2 vendor/fssm/lib/fssm/state/file.rb
sass-3.2.0.alpha.7 vendor/fssm/lib/fssm/state/file.rb
sass-3.2.0.alpha.6 vendor/fssm/lib/fssm/state/file.rb
radiant-1.0.0.rc1 vendor/plugins/haml/vendor/fssm/lib/fssm/state/file.rb
haml-3.2.0.alpha.3 vendor/sass/vendor/fssm/lib/fssm/state/file.rb
sass-3.2.0.alpha.4 vendor/fssm/lib/fssm/state/file.rb
sass-3.2.0.alpha.3 vendor/fssm/lib/fssm/state/file.rb
sass-3.1.1 vendor/fssm/lib/fssm/state/file.rb
haml-3.2.0.alpha.2 vendor/sass/vendor/fssm/lib/fssm/state/file.rb
haml-3.1.1 vendor/sass/vendor/fssm/lib/fssm/state/file.rb