Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
yucao24hours committed Nov 14, 2015
1 parent 4c24909 commit f653a35
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
11 changes: 10 additions & 1 deletion scripts/rebuilder/rebuilder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def dest_dir(str)
year = str[0..3]
month = str[4..5]
day = str[6..7]
"attendees/#{year}/#{month}/#{day}"
"#{meetups}/attendees/#{year}/#{month}/#{day}"
end

def run_rebuilder
Expand Down Expand Up @@ -35,4 +35,13 @@ def run_rebuilder
Dir.chdir('..')
end
end

private

def meetups
Dir.chdir(File.dirname(__FILE__))
Dir.chdir("../../")

Dir.pwd
end
end
12 changes: 9 additions & 3 deletions scripts/rebuilder/test/test_rebuilder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ def setup
end

def test_dest_dir
src = "20140722_no28"
dest = "attendees/2014/07/22"
src_dir = "20140722_no28"
# XXX 各自の環境に依存している
dest = "/Users/yucao24hours/work/yochiyochi/meetups/attendees/2014/07/22"
assert_equal @rebuilder.dest_dir(src_dir), dest
end

def test_copy_dir
expected = !File.directory?("/Users/yucao24hours/work/yochiyochi/meetups/attendees/2014/07/22")

assert_equal @rebuilder.dest_dir(src), dest
assert expected
end
end

0 comments on commit f653a35

Please sign in to comment.