Sha256: 48adafbd5ec075658d4ea5fec2eee6150cfd7f3a78f036e33d62ce8854ef2164

Contents?: true

Size: 634 Bytes

Versions: 15

Compression:

Stored size: 634 Bytes

Contents

module Uricp::Strategy
  
  class LocalLink

    include Uricp::Strategy::Common

    def appropriate?
      return proposal if all_local_files? && !format_change? && linkable?
      debug "#{self.class.name}: not appropriate"
      false
    end

    def command
      "ln -fT #{from.path} #{to.path};"
    end

    def proposal
      @proposed_options = options.dup
      @proposed_options['from_uri'] = @proposed_options['to_uri']
      self
    end

    def linkable?
      File.stat(File.dirname(from.path)).dev == File.stat(File.dirname(to.path)).dev &&
      (!File.exist?(to.path) || File.file?(to.path))
    end

  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
uricp-0.0.15 lib/uricp/strategy/local_link.rb
uricp-0.0.14 lib/uricp/strategy/local_link.rb
uricp-0.0.13 lib/uricp/strategy/local_link.rb
uricp-0.0.12 lib/uricp/strategy/local_link.rb
uricp-0.0.11 lib/uricp/strategy/local_link.rb
uricp-0.0.10 lib/uricp/strategy/local_link.rb
uricp-0.0.9 lib/uricp/strategy/local_link.rb
uricp-0.0.8 lib/uricp/strategy/local_link.rb
uricp-0.0.7 lib/uricp/strategy/local_link.rb
uricp-0.0.6 lib/uricp/strategy/local_link.rb
uricp-0.0.5 lib/uricp/strategy/local_link.rb
uricp-0.0.4 lib/uricp/strategy/local_link.rb
uricp-0.0.3 lib/uricp/strategy/local_link.rb
uricp-0.0.2 lib/uricp/strategy/local_link.rb
uricp-0.0.1 lib/uricp/strategy/local_link.rb