githug 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -6
- data/levels/remote_url.rb +1 -1
- data/levels/revert.rb +2 -4
- data/levels/squash.rb +3 -3
- data/lib/githug/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e6b48271a2bda230ebd1706f27995f9fee4a28e
|
4
|
+
data.tar.gz: 0d3dbd6ed1913a20478bac74f0820cbc007e0715
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 377a4ac9ee7cd899df4f6a0672c5122543299a6bef70d5d6d946b8f8a3cbdd5351f4a209f5a20d6782eba3fa09f03bc7ef105d3a1608d4eff243061fe9e3101f
|
7
|
+
data.tar.gz: 7892ecf73c3fdf941c72f1879a2f0dbd41f03abd12428d183e2bfba1562bfc1ea92efd3c5db6f441842e306eb2ebca26390c4f17b0e3ef1ab7218ef819e92c17
|
data/README.md
CHANGED
@@ -3,28 +3,58 @@ Git Your Game On [![Build Status](https://travis-ci.org/Gazler/githug.png?branch
|
|
3
3
|
## About
|
4
4
|
Githug 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.
|
5
5
|
|
6
|
-
##
|
6
|
+
## Playing Githug
|
7
|
+
|
8
|
+
Githug should work on Linux, OS X and Windows.
|
9
|
+
|
10
|
+
### Prerequisites
|
11
|
+
|
12
|
+
Githug requires Ruby 1.8.7 or higher.
|
13
|
+
|
14
|
+
You can check which version of Ruby is installed with the following command:
|
15
|
+
|
16
|
+
```
|
17
|
+
ruby --version
|
18
|
+
```
|
19
|
+
|
20
|
+
If ruby is not installed, follow the installation instructions on [ruby-lang.org](https://www.ruby-lang.org/en/documentation/installation/).
|
21
|
+
|
22
|
+
### Installation
|
23
|
+
|
7
24
|
To install Githug, run
|
8
25
|
|
9
26
|
gem install githug
|
10
27
|
|
11
|
-
|
28
|
+
If you get a complaint about permissions, you can rerun the command with `sudo`:
|
29
|
+
|
30
|
+
sudo gem install githug
|
31
|
+
|
32
|
+
### Starting the Game
|
33
|
+
|
34
|
+
After the gem is installed change directory to the location where you want the game-related assets to be stored.
|
35
|
+
Then run `githug`:
|
36
|
+
|
37
|
+
githug
|
12
38
|
|
13
|
-
|
39
|
+
You will be prompted to create a directory.
|
14
40
|
|
15
|
-
|
41
|
+
No githug directory found, do you wish to create one? [yn]
|
42
|
+
|
43
|
+
Type `y` (yes) to continue, `n` (no) to cancel and quit Githug.
|
44
|
+
|
45
|
+
### Commands
|
46
|
+
|
47
|
+
Githug has 4 game commands:
|
16
48
|
|
17
49
|
* play - The default command, checks your solution for the current level
|
18
50
|
* hint - Gives you a hint (if available) for the current level
|
19
51
|
* reset - Reset the current level or reset the level to a given name or path
|
20
52
|
* levels - List all the levels
|
21
|
-
* test - Test levels in development (please see the "Testing Levels" section below)
|
22
53
|
|
23
54
|
## Change Log
|
24
55
|
|
25
56
|
The change log is available on the wiki. [Change log](https://github.com/Gazler/githug/wiki/Change-Log)
|
26
57
|
|
27
|
-
|
28
58
|
## Contributing
|
29
59
|
|
30
60
|
To suggest a level or create a level that has been suggested, check out [the wiki](https://github.com/Gazler/githug/wiki).
|
data/levels/remote_url.rb
CHANGED
data/levels/revert.rb
CHANGED
@@ -20,11 +20,9 @@ end
|
|
20
20
|
|
21
21
|
solution do
|
22
22
|
valid = false
|
23
|
+
commit_messages = repo.commits.map(&:message)
|
23
24
|
valid = true if repo.commits.length > 3 &&
|
24
|
-
|
25
|
-
repo.commits[2].message == "Second commit" &&
|
26
|
-
repo.commits[1].message == "Bad commit" &&
|
27
|
-
repo.commits[0].message.split("\n").first == "Revert \"Bad commit\""
|
25
|
+
commit_messages.any? { |e| e =~ /(Revert )?"Bad commit"/ }
|
28
26
|
valid
|
29
27
|
end
|
30
28
|
|
data/levels/squash.rb
CHANGED
@@ -11,13 +11,13 @@ setup do
|
|
11
11
|
repo.commit_all("Adding README")
|
12
12
|
File.open("README", 'w') { |f| f.write("hey there") }
|
13
13
|
repo.add("README")
|
14
|
-
repo.commit_all("Updating README")
|
14
|
+
repo.commit_all("Updating README (squash this commit into Adding README)")
|
15
15
|
File.open("README", 'a') { |f| f.write("\nAdding some more text") }
|
16
16
|
repo.add("README")
|
17
|
-
repo.commit_all("Updating README")
|
17
|
+
repo.commit_all("Updating README (squash this commit into Adding README)")
|
18
18
|
File.open("README", 'a') { |f| f.write("\neven more text") }
|
19
19
|
repo.add("README")
|
20
|
-
repo.commit_all("Updating README")
|
20
|
+
repo.commit_all("Updating README (squash this commit into Adding README)")
|
21
21
|
end
|
22
22
|
|
23
23
|
solution do
|
data/lib/githug/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: githug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gary Rennie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -504,7 +504,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
504
504
|
version: '0'
|
505
505
|
requirements: []
|
506
506
|
rubyforge_project: githug
|
507
|
-
rubygems_version: 2.
|
507
|
+
rubygems_version: 2.0.6
|
508
508
|
signing_key:
|
509
509
|
specification_version: 4
|
510
510
|
summary: An interactive way to learn git.
|