From ee4388b0f437f303e47b36da8b2ae45c50defdf7 Mon Sep 17 00:00:00 2001 From: Jeremy Cook Date: Sat, 19 Jan 2019 23:21:27 -0500 Subject: [PATCH] Moved code to a more logical home. --- lib/homesick.rb | 16 ++++++++++++++++ lib/homesick/utils.rb | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/homesick.rb b/lib/homesick.rb index 2385172..67d1767 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -3,6 +3,7 @@ require 'homesick/actions/git_actions' require 'homesick/version' require 'homesick/utils' require 'homesick/cli' +require 'fileutils' # Homesick's top-level module module Homesick @@ -10,4 +11,19 @@ module Homesick SUBDIR_FILENAME = '.homesick_subdir'.freeze DEFAULT_CASTLE_NAME = 'dotfiles'.freeze + QUIETABLE = [:say_status].freeze + + PRETENDABLE = [:system].freeze + + QUIETABLE.each do |method_name| + define_method(method_name) do |*args| + super(*args) unless options[:quiet] + end + end + + PRETENDABLE.each do |method_name| + define_method(method_name) do |*args| + super(*args) unless options[:pretend] + end + end end diff --git a/lib/homesick/utils.rb b/lib/homesick/utils.rb index 031b4ec..2bbc594 100644 --- a/lib/homesick/utils.rb +++ b/lib/homesick/utils.rb @@ -3,22 +3,6 @@ require 'pathname' module Homesick # Various utility methods that are used by Homesick module Utils - QUIETABLE = [:say_status].freeze - - PRETENDABLE = [:system].freeze - - QUIETABLE.each do |method_name| - define_method(method_name) do |*args| - super(*args) unless options[:quiet] - end - end - - PRETENDABLE.each do |method_name| - define_method(method_name) do |*args| - super(*args) unless options[:pretend] - end - end - protected def home_dir