-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathrestructure.rb
42 lines (31 loc) · 1.02 KB
/
restructure.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
difficulty 3
description "You added some files to your repository, but now realize that your project needs to be restructured. Make a new folder named `src` and use Git move all of the .html files into this folder."
setup do
repo.init
FileUtils.touch("about.html")
FileUtils.touch("contact.html")
FileUtils.touch("index.html")
repo.add("about.html")
repo.add("contact.html")
repo.add("index.html")
system "git branch -m master"
repo.commit_all("adding web content.")
end
solution do
index =
repo.status["index.html"].type == "D" &&
repo.status["index.html"].stage.nil? &&
repo.status["src/index.html"].type == "A"
about =
repo.status["about.html"].type == "D" &&
repo.status["about.html"].stage.nil? &&
repo.status["src/about.html"].type == "A"
contact =
repo.status["contact.html"].type == "D" &&
repo.status["contact.html"].stage.nil? &&
repo.status["src/contact.html"].type == "A"
index && about && contact
end
hint do
puts "You'll have to use mkdir, and `git mv`."
end