move castle/home/.homesick_subdir to castle/.homesick_subdir

This commit is contained in:
muratayusuke
2013-06-06 12:39:41 +00:00
parent da0958d455
commit 360e8185f7
3 changed files with 6 additions and 10 deletions

View File

@@ -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|

View File

@@ -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

View File

@@ -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