From d3d6974b7b5146fcf3b49d7dc1281088392070b8 Mon Sep 17 00:00:00 2001 From: mail6543210 Date: Tue, 19 Sep 2017 20:29:06 +0800 Subject: [PATCH] Rename `content` to `source` It is a instance of Pathname, not binary content --- lib/homesick/cli.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/homesick/cli.rb b/lib/homesick/cli.rb index 159d470..43d401f 100644 --- a/lib/homesick/cli.rb +++ b/lib/homesick/cli.rb @@ -27,13 +27,13 @@ module Homesick # Hack in support for diffing symlinks # Also adds support for checking if destination or content is a directory shell_metaclass = class << shell; self; end - shell_metaclass.send(:define_method, :show_diff) do |destination, content| + shell_metaclass.send(:define_method, :show_diff) do |destination, source| destination = Pathname.new(destination) - content = Pathname.new(content) - return 'Unable to create diff: destination or content is a directory' if destination.directory? || content.directory? - return super(destination, content) unless destination.symlink? + source = Pathname.new(source) + return 'Unable to create diff: destination or content is a directory' if destination.directory? || source.directory? + return super(destination, source) unless destination.symlink? say "- #{destination.readlink}", :red, true - say "+ #{content.expand_path}", :green, true + say "+ #{source.expand_path}", :green, true end end