githug 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8d94eb08289627d4acc9a7af8b5fcfdd2994501
4
- data.tar.gz: 4be2995f158cee6c89acbce3e9a6414a7df071d5
3
+ metadata.gz: 5e6b48271a2bda230ebd1706f27995f9fee4a28e
4
+ data.tar.gz: 0d3dbd6ed1913a20478bac74f0820cbc007e0715
5
5
  SHA512:
6
- metadata.gz: 7891476804389f2a977ed64fab255f8623ae9aa7777e7f71ccb2111e5b9b111fb639c5c0d4ee72a110d2313f54a5acb49ec5536384f997f18269301b4e5c002b
7
- data.tar.gz: 604b7ae4993d21505ae5851335103334d1a6d390ca035c65cca3322833853e649c87deb506385c83d6310937834e039dfb77ff8c63af86b4134436a31c779911
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
- ## Installation
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
- After the gem is installed, run `githug`. You will be prompted to create a directory. Githug should work on Linux, OS X and Windows.
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
- ## Commands
39
+ You will be prompted to create a directory.
14
40
 
15
- Githug has 5 commands:
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).
@@ -9,7 +9,7 @@ setup do
9
9
  end
10
10
 
11
11
  solution do
12
- "https://github.com/githug/not_a_repo" == request("What is the url of the remote repository?")
12
+ !!(request("What is the url of the remote repository?") =~ /https:\/\/github.com\/githug\/not_a_repo\/?/)
13
13
  end
14
14
 
15
15
  hint do
@@ -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
- repo.commits[3].message == "First commit" &&
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
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Githug
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  end
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
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: 2015-02-13 00:00:00.000000000 Z
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.2.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.