diff --git a/lib/homesick.rb b/lib/homesick.rb index 43fdd53..cc03e81 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -245,7 +245,7 @@ class Homesick < Thor end def subdir_file(castle) - castle_dir(castle).join(SUBDIR_FILENAME) + repos_dir.join(castle, SUBDIR_FILENAME) end def subdirs(castle) @@ -313,9 +313,6 @@ class Homesick < Thor absolute_path = path.expand_path castle_home = castle_dir(castle) - # ignore subdir file - next if absolute_path == castle_home.join(SUBDIR_FILENAME) - # make ignore dirs ignore_dirs = [] subdirs.each do |subdir| diff --git a/spec/homesick_spec.rb b/spec/homesick_spec.rb index 7493d94..0d5c83a 100644 --- a/spec/homesick_spec.rb +++ b/spec/homesick_spec.rb @@ -247,7 +247,7 @@ describe "homesick" do some_nested_file = home.file('some/nested/file.txt') homesick.track(some_nested_file.to_s, 'castle_repo') - subdir_file = castle.join(Homesick::SUBDIR_FILENAME) + subdir_file = castle.parent.join(Homesick::SUBDIR_FILENAME) File.open(subdir_file, 'r') do |f| f.readline.should == "some/nested\n" end @@ -261,7 +261,7 @@ describe "homesick" do homesick.track(some_nested_file.to_s, 'castle_repo') homesick.track(other_nested_file.to_s, 'castle_repo') - subdir_file = castle.join(Homesick::SUBDIR_FILENAME) + subdir_file = castle.parent.join(Homesick::SUBDIR_FILENAME) File.open(subdir_file, 'r') do |f| f.readlines.size.should == 1 end @@ -275,7 +275,7 @@ describe "homesick" do homesick.track(some_nested_file.to_s, 'castle_repo') homesick.track(nested_parent.to_s, 'castle_repo') - subdir_file = castle.join(Homesick::SUBDIR_FILENAME) + subdir_file = castle.parent.join(Homesick::SUBDIR_FILENAME) File.open(subdir_file, 'r') do |f| f.each_line { |line| line.should_not == "some/nested\n" } end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9dfb5cb..1c78cf3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -22,14 +22,13 @@ RSpec.configure do |config| Dir.chdir(castle) do system "git init >/dev/null 2>&1" system "git remote add origin git://github.com/technicalpickles/#{name}.git >/dev/null 2>&1" - castle_home = castle.directory("home") if subdirs then - subdir_file = castle_home.join(Homesick::SUBDIR_FILENAME) + subdir_file = castle.join(Homesick::SUBDIR_FILENAME) subdirs.each do |subdir| system "echo #{subdir} >> #{subdir_file}" end end - return castle_home + return castle.directory("home") end end end