Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39c5142ee7 | ||
|
|
a7d2dfebb3 | ||
|
|
8add88a1dc | ||
|
|
c6a517e100 | ||
|
|
863567382a |
9
ChangeLog.markdown
Normal file
9
ChangeLog.markdown
Normal file
@@ -0,0 +1,9 @@
|
||||
# 0.1.1
|
||||
|
||||
* Fixed trying to link against castles that don't exist
|
||||
* Fixed linking, which tries to exclude . and .. from the list of files to
|
||||
link (thanks Martinos)
|
||||
|
||||
# 0.1.0
|
||||
|
||||
* Initial release
|
||||
12
Rakefile
12
Rakefile
@@ -12,16 +12,22 @@ require 'rake'
|
||||
require 'jeweler'
|
||||
Jeweler::Tasks.new do |gem|
|
||||
gem.name = "homesick"
|
||||
gem.summary = %Q{TODO: one-line summary of your gem}
|
||||
gem.description = %Q{TODO: longer description of your gem}
|
||||
gem.summary = %Q{A man's home is his castle. Never leave your dotfiles behind.}
|
||||
gem.description = %Q{
|
||||
A man’s home (directory) is his castle, so don’t leave home with out it.
|
||||
|
||||
Homesick is sorta like rip, but for dotfiles. It uses git to clone a repository containing dotfiles, and saves them in ~/.homesick. It then allows you to symlink all the dotfiles into place with a single command.
|
||||
|
||||
}
|
||||
gem.email = "josh@technicalpickles.com"
|
||||
gem.homepage = "http://github.com/technicalpickles/homesick"
|
||||
gem.authors = ["Joshua Nichols"]
|
||||
gem.version = "0.1.0"
|
||||
gem.version = "0.1.1"
|
||||
# Have dependencies? Add them to Gemfile
|
||||
|
||||
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
||||
end
|
||||
Jeweler::GemcutterTasks.new
|
||||
|
||||
|
||||
require 'spec/rake/spectask'
|
||||
|
||||
62
homesick.gemspec
Normal file
62
homesick.gemspec
Normal file
@@ -0,0 +1,62 @@
|
||||
# Generated by jeweler
|
||||
# DO NOT EDIT THIS FILE DIRECTLY
|
||||
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = %q{homesick}
|
||||
s.version = "0.1.1"
|
||||
|
||||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
||||
s.authors = ["Joshua Nichols"]
|
||||
s.date = %q{2010-03-17}
|
||||
s.default_executable = %q{homesick}
|
||||
s.description = %q{
|
||||
A man’s home (directory) is his castle, so don’t leave home with out it.
|
||||
|
||||
Homesick is sorta like rip, but for dotfiles. It uses git to clone a repository containing dotfiles, and saves them in ~/.homesick. It then allows you to symlink all the dotfiles into place with a single command.
|
||||
|
||||
}
|
||||
s.email = %q{josh@technicalpickles.com}
|
||||
s.executables = ["homesick"]
|
||||
s.extra_rdoc_files = [
|
||||
"ChangeLog.markdown",
|
||||
"LICENSE",
|
||||
"README.rdoc"
|
||||
]
|
||||
s.files = [
|
||||
".document",
|
||||
".gitignore",
|
||||
"ChangeLog.markdown",
|
||||
"Gemfile",
|
||||
"LICENSE",
|
||||
"README.rdoc",
|
||||
"Rakefile",
|
||||
"bin/homesick",
|
||||
"homesick.gemspec",
|
||||
"lib/homesick.rb",
|
||||
"spec/homesick/homesick_spec.rb",
|
||||
"spec/spec.opts",
|
||||
"spec/spec_helper.rb"
|
||||
]
|
||||
s.homepage = %q{http://github.com/technicalpickles/homesick}
|
||||
s.rdoc_options = ["--charset=UTF-8"]
|
||||
s.require_paths = ["lib"]
|
||||
s.rubygems_version = %q{1.3.6}
|
||||
s.summary = %q{A man's home is his castle. Never leave your dotfiles behind.}
|
||||
s.test_files = [
|
||||
"spec/homesick/homesick_spec.rb",
|
||||
"spec/spec_helper.rb"
|
||||
]
|
||||
|
||||
if s.respond_to? :specification_version then
|
||||
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
||||
s.specification_version = 3
|
||||
|
||||
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
||||
else
|
||||
end
|
||||
else
|
||||
end
|
||||
end
|
||||
|
||||
@@ -41,18 +41,26 @@ class Homesick < Thor
|
||||
|
||||
desc "link NAME", "Symlinks all dotfiles from the specified castle"
|
||||
def link(home)
|
||||
inside castle_dir(home) do
|
||||
files = Pathname.glob('.*')[2..-1] # skip . and .., ie the first two
|
||||
files.each do |path|
|
||||
absolute_path = path.expand_path
|
||||
unless castle_dir(home).exist?
|
||||
say_status :error, "Castle #{home} did not exist in #{repos_dir}", :red
|
||||
|
||||
inside user_dir do
|
||||
adjusted_path = (user_dir + path).basename
|
||||
exit(1)
|
||||
|
||||
symlink absolute_path, adjusted_path
|
||||
else
|
||||
inside castle_dir(home) do
|
||||
files = Pathname.glob('.*').reject{|a| [".",".."].include?(a.to_s)}
|
||||
files.each do |path|
|
||||
absolute_path = path.expand_path
|
||||
|
||||
inside user_dir do
|
||||
adjusted_path = (user_dir + path).basename
|
||||
|
||||
symlink absolute_path, adjusted_path
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
desc "list", "List cloned castles"
|
||||
|
||||
Reference in New Issue
Block a user