Removed the homesick shell module and folded its code in elsewhere.

This commit is contained in:
Jeremy Cook
2014-06-14 15:03:57 -04:00
parent 2e8d431ab5
commit ee04b5788a
3 changed files with 13 additions and 19 deletions

View File

@@ -1,5 +1,4 @@
# -*- encoding : utf-8 -*- # -*- encoding : utf-8 -*-
require 'homesick/shell'
require 'homesick/actions/file_actions' require 'homesick/actions/file_actions'
require 'homesick/actions/git_actions' require 'homesick/actions/git_actions'
require 'homesick/version' require 'homesick/version'

View File

@@ -19,7 +19,19 @@ module Homesick
def initialize(args = [], options = {}, config = {}) def initialize(args = [], options = {}, config = {})
super super
self.shell = Homesick::Shell.new self.shell = Thor::Shell::Color.new
# Hack in support for diffing symlinks
class << shell
def show_diff(destination, content)
destination = Pathname.new(destination)
if destination.symlink?
say "- #{destination.readlink}", :red, true
say "+ #{content.expand_path}", :green, true
else
super
end
end
end
end end
desc 'clone URI', 'Clone +uri+ as a castle for homesick' desc 'clone URI', 'Clone +uri+ as a castle for homesick'

View File

@@ -1,17 +0,0 @@
require 'thor'
module Homesick
# Hack in support for diffing symlinks
class Shell < Thor::Shell::Color
def show_diff(destination, content)
destination = Pathname.new(destination)
if destination.symlink?
say "- #{destination.readlink}", :red, true
say "+ #{content.expand_path}", :green, true
else
super
end
end
end
end