Moved code to a more logical home.

This commit is contained in:
Jeremy Cook
2019-01-19 23:21:27 -05:00
parent a44a514007
commit ee4388b0f4
2 changed files with 16 additions and 16 deletions

View File

@@ -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

View File

@@ -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