From aa95ffac82249d7837a8a6025619a61e68151d7a Mon Sep 17 00:00:00 2001 From: bcd87 Date: Mon, 23 Sep 2013 20:30:10 +0200 Subject: [PATCH 1/3] Using the homesick clone github shortcut now clones to ~/.homesick/repos/repo/, in stead of ~/.homesick/repos/username/repo/ --- lib/homesick.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/homesick.rb b/lib/homesick.rb index 74a9e88..d09ceb8 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -33,7 +33,7 @@ class Homesick < Thor ln_s uri, destination elsif uri =~ GITHUB_NAME_REPO_PATTERN - destination = Pathname.new($1) + destination = Pathname.new($1.split("/")[1]) git_clone "https://github.com/#{$1}.git", :destination => destination elsif uri =~ /%r([^%r]*?)(\.git)?\Z/ destination = Pathname.new($1) From d953a964cd32d3f3056c7f1ec45000ecbfc5ee8d Mon Sep 17 00:00:00 2001 From: bcd87 Date: Mon, 23 Sep 2013 20:58:16 +0200 Subject: [PATCH 2/3] Changed the spec, bundle exec rake works --- spec/homesick_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/homesick_spec.rb b/spec/homesick_spec.rb index 1770c64..1d60226 100644 --- a/spec/homesick_spec.rb +++ b/spec/homesick_spec.rb @@ -94,7 +94,7 @@ describe 'homesick' do end it 'should clone a github repo' do - homesick.should_receive(:git_clone).with('https://github.com/wfarr/dotfiles.git', :destination => Pathname.new('wfarr/dotfiles')) + homesick.should_receive(:git_clone).with('https://github.com/wfarr/dotfiles.git', :destination => Pathname.new('dotfiles')) homesick.clone 'wfarr/dotfiles' end From b750094934d4071a1205744007a3e9f6f979fa66 Mon Sep 17 00:00:00 2001 From: bcd87 Date: Tue, 24 Sep 2013 08:15:56 +0200 Subject: [PATCH 3/3] Rake now passes on Ruby 1.8.7 on my machine --- lib/homesick.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/homesick.rb b/lib/homesick.rb index d09ceb8..275f742 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -33,7 +33,7 @@ class Homesick < Thor ln_s uri, destination elsif uri =~ GITHUB_NAME_REPO_PATTERN - destination = Pathname.new($1.split("/")[1]) + destination = Pathname.new(uri).basename git_clone "https://github.com/#{$1}.git", :destination => destination elsif uri =~ /%r([^%r]*?)(\.git)?\Z/ destination = Pathname.new($1)