Cleaned up some of the language.

This commit is contained in:
Joshua Nichols
2010-03-10 10:24:25 -05:00
parent e73260f1f9
commit 8c1a1b8541

View File

@@ -27,7 +27,7 @@ class Homesick < Thor
GIT_URI_PATTERN = /^git:\/\// GIT_URI_PATTERN = /^git:\/\//
GITHUB_NAME_REPO_PATTERN = /([A-Za-z_-]+)\/([A-Za-z_-]+)/ GITHUB_NAME_REPO_PATTERN = /([A-Za-z_-]+)\/([A-Za-z_-]+)/
desc "clone URI", "Clone home's +uri+ for use with homesick" desc "clone URI", "Clone +uri+ as a castle for homesick"
def clone(uri) def clone(uri)
empty_directory repos_dir, :verbose => false empty_directory repos_dir, :verbose => false
inside repos_dir do inside repos_dir do
@@ -39,9 +39,9 @@ class Homesick < Thor
end end
end end
desc "link NAME", "Links everything" desc "link NAME", "Symlinks all dotfiles from the specified castle"
def link(home) def link(home)
inside home_dir(home) do inside castle_dir(home) do
files = Pathname.glob('.*')[2..-1] # skip . and .., ie the first two files = Pathname.glob('.*')[2..-1] # skip . and .., ie the first two
files.each do |path| files.each do |path|
absolute_path = path.expand_path absolute_path = path.expand_path
@@ -55,7 +55,7 @@ class Homesick < Thor
end end
end end
desc "list", "List installed widgets" desc "list", "List cloned castles"
def list def list
inside repos_dir do inside repos_dir do
Pathname.glob('*') do |home| Pathname.glob('*') do |home|
@@ -64,6 +64,8 @@ class Homesick < Thor
end end
end end
no_tasks do
# class method, so it's convenient to stub out during tests # class method, so it's convenient to stub out during tests
def self.user_dir def self.user_dir
@user_dir ||= Pathname.new('~').expand_path @user_dir ||= Pathname.new('~').expand_path
@@ -73,7 +75,6 @@ class Homesick < Thor
@repos_dir ||= Pathname.new('~/.homesick/repos').expand_path @repos_dir ||= Pathname.new('~/.homesick/repos').expand_path
end end
no_tasks do
def repos_dir def repos_dir
self.class.repos_dir self.class.repos_dir
end end
@@ -122,7 +123,7 @@ class Homesick < Thor
self.class.user_dir self.class.user_dir
end end
def home_dir(name) def castle_dir(name)
repos_dir.join(name, 'home') repos_dir.join(name, 'home')
end end