Sha256: 470dc4ccc113964d0a8dd942020779976fdf60a2d238c94dfa2f618e13ddd34e

Contents?: true

Size: 750 Bytes

Versions: 268

Compression:

Stored size: 750 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.exist?
      # 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

268 entries across 121 versions & 8 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/haml-3.1.6/vendor/sass/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.5 vendor/bundle/gems/sass-3.1.15/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.5 vendor/bundle/gems/haml-3.1.4/vendor/sass/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.5 vendor/bundle/gems/haml-3.1.5/vendor/sass/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.4 vendor/bundle/gems/sass-3.1.15/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.4 vendor/bundle/gems/haml-3.1.6/vendor/sass/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.4 vendor/bundle/gems/haml-3.1.5/vendor/sass/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.4 vendor/bundle/gems/haml-3.1.4/vendor/sass/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.3 vendor/bundle/gems/haml-3.1.4/vendor/sass/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.3 vendor/bundle/gems/sass-3.1.15/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.3 vendor/bundle/gems/haml-3.1.5/vendor/sass/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.3 vendor/bundle/gems/haml-3.1.6/vendor/sass/vendor/fssm/lib/fssm/state/file.rb
sadui-0.0.4 vendor/bundle/ruby/2.0.0/gems/fssm-0.2.10/lib/fssm/state/file.rb
sadui-0.0.4 vendor/bundle/ruby/2.1.0/gems/fssm-0.2.10/lib/fssm/state/file.rb
torquebox-console-0.3.0 vendor/bundle/jruby/1.9/gems/haml-3.1.8/vendor/sass/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.2 vendor/bundle/gems/haml-3.1.4/vendor/sass/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.2 vendor/bundle/gems/haml-3.1.6/vendor/sass/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.2 vendor/bundle/gems/haml-3.1.5/vendor/sass/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.2 vendor/bundle/gems/sass-3.1.15/vendor/fssm/lib/fssm/state/file.rb
classiccms-0.7.1 vendor/bundle/gems/sass-3.1.15/vendor/fssm/lib/fssm/state/file.rb