class Uricp::Strategy::LocalLink
Public Instance Methods
appropriate?()
click to toggle source
# File lib/uricp/strategy/local_link.rb, line 5 def appropriate? return proposal if !compression_required? && all_local_files? && !format_change? && linkable? debug "#{self.class.name}: not appropriate" false end
command()
click to toggle source
# File lib/uricp/strategy/local_link.rb, line 15 def command "ln -fT #{from.path} #{to.path};" end
linkable?()
click to toggle source
# File lib/uricp/strategy/local_link.rb, line 25 def linkable? from_path_dir = File.dirname(from.path) to_path_dir = File.dirname(to.path) File.directory?(from_path_dir) && File.directory?(to_path_dir) && File.stat(from_path_dir).dev == File.stat(to_path_dir).dev && (!File.exist?(to.path) || File.file?(to.path)) end
proposal()
click to toggle source
# File lib/uricp/strategy/local_link.rb, line 19 def proposal @proposed_options = options.dup @proposed_options['from_uri'] = @proposed_options['to_uri'] self end