在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:Gazler/githug开源软件地址:https://github.com/Gazler/githug开源编程语言:Shell 62.4%开源软件介绍:GithugGit Your Game On AboutGithug is designed to give you a practical way of learning git. It has a series of levels, each requiring you to use git commands to arrive at a correct answer. Playing GithugGithug should work on Linux, OS X and Windows. PrerequisitesGithug requires Ruby 1.8.7 or higher. You can check which version of Ruby is installed with the following command:
If ruby is not installed, follow the installation instructions on ruby-lang.org. InstallationTo install Githug, run
If you get a complaint about permissions, you can rerun the command with
Usage with DockerAn unofficial Docker image for this project by @odiraneyya is available on (Docker Hub). Starting the GameAfter the gem is installed change directory to the location where you want the game-related assets to be stored.
Then run
You will be prompted to create a directory.
Type CommandsGithug has 4 game commands:
Change LogThe change log is available on the wiki. Change log ContributingTo suggest a level or create a level that has been suggested, check out the wiki. Get yourself on the contributors list by doing the following:
Todo List
Writing LevelsGithug has a DSL for writing levels. Here is an example: difficulty 1
description "There is a file in your folder called README, you should add it to your staging area"
setup do
repo.init
FileUtils.touch("README")
end
solution do
return false unless repo.status.files.keys.include?("README")
return false if repo.status.files["README"].untracked
true
end
hint do
puts "You can type `git` in your shell to get a list of available git commands"
end
You can include multiple hints like this: hints [
"You can type `git` in your shell to get a list of available git commands",
"Check the man for `git add`"] By default, You can call All methods called on Another method exists called setup do
init_from_level
end This will copy the contents of a repository specified in the levels folder for your level. For example, if your level is called "merge" then it will copy the contents of the "merge" folder. It is recommended that you perform the following steps:
After doing this, your level should be able to copy the contents from that git repository and use those for your level. See the "blame" level for an example of this. Testing LevelsThe easiest way to test a level is:
Please note that the It would be ideal if you add an integration test for your level. These tests live in |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论