githug 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/levels/fetch.rb +3 -3
- data/levels/merge_squash.rb +1 -0
- data/levels/push_branch.rb +1 -1
- data/levels/rebase.rb +1 -1
- data/levels/squash.rb +1 -1
- data/levels/submodule.rb +20 -0
- data/lib/githug/level.rb +2 -1
- data/lib/githug/version.rb +1 -1
- data/spec/githug_spec.rb +5 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8d94eb08289627d4acc9a7af8b5fcfdd2994501
|
4
|
+
data.tar.gz: 4be2995f158cee6c89acbce3e9a6414a7df071d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7891476804389f2a977ed64fab255f8623ae9aa7777e7f71ccb2111e5b9b111fb639c5c0d4ee72a110d2313f54a5acb49ec5536384f997f18269301b4e5c002b
|
7
|
+
data.tar.gz: 604b7ae4993d21505ae5851335103334d1a6d390ca035c65cca3322833853e649c87deb506385c83d6310937834e039dfb77ff8c63af86b4134436a31c779911
|
data/levels/fetch.rb
CHANGED
@@ -52,13 +52,13 @@ solution do
|
|
52
52
|
# after a git fetch command, each branch will be stored in in the .git/FETCH_HEAD file. Each branch is on its own line
|
53
53
|
# This command will count the number of lines, which will give the number of branches
|
54
54
|
if File.file?('.git/FETCH_HEAD') #checks for file existance
|
55
|
-
num_remote =
|
55
|
+
num_remote = File.read(".git/FETCH_HEAD").split("\n").count
|
56
56
|
else
|
57
|
-
num_remote =
|
57
|
+
num_remote = 0
|
58
58
|
end
|
59
59
|
|
60
60
|
# there should be 1 local branch and 2 remote branches for a success condition
|
61
|
-
if local_branches == 1 and num_remote
|
61
|
+
if local_branches == 1 and num_remote == 2
|
62
62
|
result = true
|
63
63
|
else
|
64
64
|
result = false
|
data/levels/merge_squash.rb
CHANGED
data/levels/push_branch.rb
CHANGED
@@ -60,7 +60,7 @@ solution do
|
|
60
60
|
|
61
61
|
#each branch consits of one line, `wc -l counts the number of lines in order to get the number of remote branches`
|
62
62
|
#At the moment Grit doesn't support remote branch references but is on the ToDo list. This should be revisited when Grit implements the change
|
63
|
-
num_remote_branches = `git branch -r
|
63
|
+
num_remote_branches = `git branch -r`.split("\n").count
|
64
64
|
|
65
65
|
# counts the number of commits in the remote master branch'
|
66
66
|
remote_master_commits = repo.commits('origin/master').count
|
data/levels/rebase.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
difficulty 2
|
2
2
|
|
3
|
-
description "We are using a git rebase workflow and the feature branch is ready to go into master. Let's rebase the
|
3
|
+
description "We are using a git rebase workflow and the feature branch is ready to go into master. Let's rebase the feature branch onto our master branch."
|
4
4
|
|
5
5
|
setup do
|
6
6
|
init_from_level
|
data/levels/squash.rb
CHANGED
data/levels/submodule.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
difficulty 2
|
2
|
+
description "You want to include the files from the following repo: `https://github.com/jackmaney/githug-include-me` into a the folder `./githug-include-me`. Do this without cloning the repo or copying the files from the repo into this repo."
|
3
|
+
|
4
|
+
setup do
|
5
|
+
repo.init
|
6
|
+
end
|
7
|
+
|
8
|
+
solution do
|
9
|
+
return false if not File.directory?("./githug-include-me")
|
10
|
+
return false if not File.exist?("./githug-include-me/README.md")
|
11
|
+
return false if not File.exist?("./githug-include-me/.git")
|
12
|
+
return false if File.directory?("./githug-include-me/.git")
|
13
|
+
return false if not File.exist?(".gitmodules")
|
14
|
+
|
15
|
+
return true
|
16
|
+
end
|
17
|
+
|
18
|
+
hint do
|
19
|
+
puts "Take a look at `git submodule`."
|
20
|
+
end
|
data/lib/githug/level.rb
CHANGED
@@ -11,7 +11,8 @@ module Githug
|
|
11
11
|
"checkout", "checkout_tag", "checkout_tag_over_branch", "branch_at",
|
12
12
|
"delete_branch", "push_branch", "merge", "fetch", "rebase", "repack", "cherry-pick",
|
13
13
|
"grep", "rename_commit", "squash", "merge_squash", "reorder", "bisect",
|
14
|
-
"stage_lines", "find_old_branch", "revert", "restore", "conflict",
|
14
|
+
"stage_lines", "find_old_branch", "revert", "restore", "conflict",
|
15
|
+
"submodule","contribute"]
|
15
16
|
|
16
17
|
attr_accessor :level_no, :level_path, :level_name
|
17
18
|
|
data/lib/githug/version.rb
CHANGED
data/spec/githug_spec.rb
CHANGED
@@ -298,6 +298,11 @@ describe "The Game" do
|
|
298
298
|
skip_level
|
299
299
|
end
|
300
300
|
|
301
|
+
it "solves the submodule level" do
|
302
|
+
`git submodule add https://github.com/jackmaney/githug-include-me`
|
303
|
+
`githug`.should be_solved
|
304
|
+
end
|
305
|
+
|
301
306
|
it "solves the contribute level" do
|
302
307
|
skip_level
|
303
308
|
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
|
+
version: 0.4.4
|
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: 2015-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -465,6 +465,7 @@ files:
|
|
465
465
|
- levels/stash/.githug/refs/heads/master
|
466
466
|
- levels/stash/lyrics.txt
|
467
467
|
- levels/status.rb
|
468
|
+
- levels/submodule.rb
|
468
469
|
- levels/tag.rb
|
469
470
|
- lib/githug.rb
|
470
471
|
- lib/githug/cli.rb
|