Sha256: 4f7a9eac87b25e2e31ac6e0ce4314c91be9ebd674af636eacf9ad4985929f8d3

Contents?: true

Size: 914 Bytes

Versions: 31

Compression:

Stored size: 914 Bytes

Contents

# == ShellManager::Symlink
#
# A ShellManager driver providing access to the symbolic link +ln_s+ command
# found on Unix-like systems.
class AutomateIt::ShellManager::Symlink < AutomateIt::ShellManager::BaseLink
  depends_on \
    :libraries => %w(pathname),
    :callbacks => [lambda{
      # JRuby can make symlinks but can't read them.
      RUBY_PLATFORM !~ /java|mswin/i and File.respond_to?(:symlink)
    }]

  def suitability(method, *args) # :nodoc:
    # Level must be higher than Portable
    return available? ? 2 : 0
  end

  # See ShellManager#provides_symlink?
  def provides_symlink?
    available? ? true : false
  end

  # See ShellManager#ln_s
  def ln_s(sources, target, opts={})
    _ln(sources, target, {:symbolic => true}.merge(opts))
  end

  # See ShellManager#ln_sf
  def ln_sf(sources, target, opts={})
    _ln(sources, target, {:symbolic => true, :force => true}.merge(opts))
  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
automate-it-0.9.2 lib/automateit/shell_manager/symlink.rb
automate-it-0.9.1 lib/automateit/shell_manager/symlink.rb
automate-it-0.9.0 lib/automateit/shell_manager/symlink.rb
automateit-0.71003 lib/automateit/shell_manager/symlink.rb
automateit-0.70923 lib/automateit/shell_manager/symlink.rb
automateit-0.70928 lib/automateit/shell_manager/symlink.rb
automateit-0.70930 lib/automateit/shell_manager/symlink.rb
automateit-0.71030 lib/automateit/shell_manager/symlink.rb
automateit-0.71031.1 lib/automateit/shell_manager/symlink.rb
automateit-0.71031.2 lib/automateit/shell_manager/symlink.rb
automateit-0.71017 lib/automateit/shell_manager/symlink.rb
automateit-0.71021 lib/automateit/shell_manager/symlink.rb
automateit-0.71012 lib/automateit/shell_manager/symlink.rb
automateit-0.71006 lib/automateit/shell_manager/symlink.rb
automateit-0.71103 lib/automateit/shell_manager/symlink.rb
automateit-0.71101.1 lib/automateit/shell_manager/symlink.rb
automateit-0.71031 lib/automateit/shell_manager/symlink.rb
automateit-0.71101 lib/automateit/shell_manager/symlink.rb
automateit-0.71101.2 lib/automateit/shell_manager/symlink.rb
automateit-0.71102 lib/automateit/shell_manager/symlink.rb