From 7c99ed8bf57643d974323b9120739c4961fc286e Mon Sep 17 00:00:00 2001 From: psyche Date: Thu, 9 Oct 2008 04:06:57 +0400 Subject: [PATCH] Expanded filepath for lock, unlock and info commands. Removed first argument (filepath) in lock and unlock commands. Using @options instead. --- lib/piston/commands/lock_unlock.rb | 4 ++-- lib/piston/working_copy.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/piston/commands/lock_unlock.rb b/lib/piston/commands/lock_unlock.rb index 60b9173..5a7f34f 100644 --- a/lib/piston/commands/lock_unlock.rb +++ b/lib/piston/commands/lock_unlock.rb @@ -5,8 +5,8 @@ module Commands class LockUnlock < Piston::Commands::Base attr_reader :options - def run(wcdir, lock) - working_copy = working_copy!(wcdir) + def run(lock) + working_copy = working_copy!(File.expand_path(options[:wcdir])) values = working_copy.recall values["lock"] = lock diff --git a/lib/piston/working_copy.rb b/lib/piston/working_copy.rb index 6fef179..6b6b77d 100644 --- a/lib/piston/working_copy.rb +++ b/lib/piston/working_copy.rb @@ -18,7 +18,7 @@ def guess(path) end raise UnhandledWorkingCopy, "Don't know what working copy type #{path} is." if handler.nil? - handler.new(path) + handler.new(File.expand_path(path)) end @@handlers = Array.new @@ -55,7 +55,7 @@ def to_s def exist? @path.exist? && @path.directory? end - + def pistonized? yaml_path.exist? && yaml_path.file? end @@ -119,7 +119,7 @@ def recall def finalize logger.debug {"Finalizing #{path}"} end - + # Returns basic information about this working copy. def info recall