If we use HTTPS it is a lot easier for corporate worlds to manage proxies since its usually already done for us. Also HTTPS cloning is just as fast as the git protocol as of more recent versions.
When a user tracks a file or directory that is in
a nested folder, Homesick creates a .manifest in the
user's castle (if there isn't one already) and adds
an entry listing the file or directory's parent
directory (if it isn't already listed).
homesick list fails on ruby 2.0.0-rc2, I think because they fixed this
bug: https://bugs.ruby-lang.org/issues/6977, changing the way recursive
globs work. Test case:
```ruby
require "homesick"
require "pathname"
repos = Homesick.new.send :repos_dir
Dir.glob("#{repos}/**/*/.git") # => []
Dir.glob("#{repos}/**/*/.git", File::FNM_DOTMATCH) # => ["/home/eric/.homesick/repos/dotfiles/.git"]
```
This change, however, then broke 1.9.3, but removing the extra "/*"
works on both 1.9 and 2.0.
On ruby 1.9, the argument of String#start_with? does not automatically
get coerced into a string. In Homesick#clone, we use start_with? with a
Pathname instance, which now always returns false.
Further abstracted locating castles into Homesick.all_castles which globs as
before, but after that rejects any paths that lie in other paths. This way
castles that have submodules don't cause extra output in e.g. list.
Abstracted the logic for doing some operation for all castles into
Homesick.inside_each_castle() which takes a block argument. Homesick.list() is
also reimplemented to use this new method, because that's where the logic was
stolen from. The actual updating is also moved to the private method
update_castle() to make pull() shorter.
* Moves a specified file into the specified castle.
* Symlinks it into its original position.
Signed-off-by: Joshua Nichols <josh@technicalpickles.com>