githug 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +15 -1
- data/levels/rename_commit.rb +22 -0
- data/lib/githug/level.rb +1 -1
- data/lib/githug/version.rb +1 -1
- metadata +3 -2
data/README.md
CHANGED
@@ -13,15 +13,18 @@ After the gem is installed, you can run `githug` where you will be prompted to c
|
|
13
13
|
|
14
14
|
##Commands
|
15
15
|
|
16
|
-
Githug has
|
16
|
+
Githug has 4 commands:
|
17
17
|
|
18
18
|
* play - This is the default command and it will check your solution for the current level.
|
19
19
|
* hint - Gives you a hint (if available) for the current level
|
20
20
|
* reset - Reset the current level
|
21
|
+
* test - Used to test levels in development, please see the Testing Levels section.
|
21
22
|
|
22
23
|
|
23
24
|
##Contributing
|
24
25
|
|
26
|
+
If you want to suggest a level or make a level that has been suggested, check out [the wiki](https://github.com/Gazler/githug/wiki).
|
27
|
+
|
25
28
|
Get yourself on the [contributors list](https://github.com/Gazler/githug/contributors) by doing the following:
|
26
29
|
|
27
30
|
* Fork the repository
|
@@ -101,3 +104,14 @@ This will copy the contents of a repository specified in the levels folder for y
|
|
101
104
|
* git add "yourlevel"
|
102
105
|
|
103
106
|
After doing this, your level should be able to copy the contents from that git repository and use those for your level. You can see the "blame" level for an example of this.
|
107
|
+
|
108
|
+
##Testing Levels
|
109
|
+
|
110
|
+
The easiest way to test a level is:
|
111
|
+
|
112
|
+
* change into your git_hug repository
|
113
|
+
* Run `githug reset PATH_TO_YOUR_LEVEL
|
114
|
+
* Solve the level
|
115
|
+
* Run `githug test PATH_TO_YOUR_LEVEL
|
116
|
+
|
117
|
+
Please note that the `githug test` command can be run as `githug test --errors` to get an error stacktrace from your solve method.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
difficulty 3
|
2
|
+
description "Correct the typos in the message of your last commit."
|
3
|
+
|
4
|
+
setup do
|
5
|
+
repo.init
|
6
|
+
|
7
|
+
FileUtils.touch "README"
|
8
|
+
repo.add "README"
|
9
|
+
repo.commit_all "Adding README"
|
10
|
+
|
11
|
+
FileUtils.touch "file1"
|
12
|
+
repo.add "file1"
|
13
|
+
repo.commit_all "A fresh commmit"
|
14
|
+
end
|
15
|
+
|
16
|
+
solution do
|
17
|
+
repo.commits.first.message == "A fresh commit"
|
18
|
+
end
|
19
|
+
|
20
|
+
hint do
|
21
|
+
puts "Take a look the -i flag of the rebase command"
|
22
|
+
end
|
data/lib/githug/level.rb
CHANGED
@@ -6,7 +6,7 @@ module Githug
|
|
6
6
|
"clone_to_folder", "ignore", "status", "rm", "rm_cached", "rename",
|
7
7
|
"log", "tag", "commit_ammend", "reset", "checkout_file", "remote",
|
8
8
|
"remote_url", "remote_add", "diff", "blame", "branch", "checkout",
|
9
|
-
"branch_at", "merge", "squash", "contribute"]
|
9
|
+
"branch_at", "merge", "rename_commit", "squash", "contribute"]
|
10
10
|
|
11
11
|
attr_accessor :level_no, :level_path
|
12
12
|
|
data/lib/githug/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: githug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Gary Rennie
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-03-
|
13
|
+
date: 2012-03-20 00:00:00 +00:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -181,6 +181,7 @@ files:
|
|
181
181
|
- levels/remote_add.rb
|
182
182
|
- levels/remote_url.rb
|
183
183
|
- levels/rename.rb
|
184
|
+
- levels/rename_commit.rb
|
184
185
|
- levels/reset.rb
|
185
186
|
- levels/rm.rb
|
186
187
|
- levels/rm_cached.rb
|