Permalink
Browse files

Renamed from gitscrub to githug

  • Loading branch information...
1 parent f2b4231 commit 1621f85e9c12df251ae0e800a5a289fc1d0f8acb @Gazler Gazler committed Mar 14, 2012
Showing with 143 additions and 144 deletions.
  1. +10 −10 README.md
  2. +4 −0 bin/githug
  3. +0 −4 bin/gitscrub
  4. +4 −4 gitscrub.gemspec → githug.gemspec
  5. 0 levels/blame/{.gitscrub → .githug}/COMMIT_EDITMSG
  6. 0 levels/blame/{.gitscrub → .githug}/HEAD
  7. 0 levels/blame/{.gitscrub → .githug}/config
  8. 0 levels/blame/{.gitscrub → .githug}/description
  9. 0 levels/blame/{.gitscrub → .githug}/hooks/applypatch-msg.sample
  10. 0 levels/blame/{.gitscrub → .githug}/hooks/commit-msg.sample
  11. 0 levels/blame/{.gitscrub → .githug}/hooks/post-commit.sample
  12. 0 levels/blame/{.gitscrub → .githug}/hooks/post-receive.sample
  13. 0 levels/blame/{.gitscrub → .githug}/hooks/post-update.sample
  14. 0 levels/blame/{.gitscrub → .githug}/hooks/pre-applypatch.sample
  15. 0 levels/blame/{.gitscrub → .githug}/hooks/pre-commit.sample
  16. 0 levels/blame/{.gitscrub → .githug}/hooks/pre-rebase.sample
  17. 0 levels/blame/{.gitscrub → .githug}/hooks/prepare-commit-msg.sample
  18. 0 levels/blame/{.gitscrub → .githug}/hooks/update.sample
  19. BIN levels/blame/{.gitscrub → .githug}/index
  20. 0 levels/blame/{.gitscrub → .githug}/info/exclude
  21. 0 levels/blame/{.gitscrub → .githug}/logs/HEAD
  22. 0 levels/blame/{.gitscrub → .githug}/logs/refs/heads/master
  23. BIN levels/blame/{.gitscrub → .githug}/objects/00/d6bf5341b263ccaf32e7973be55126eb30a343
  24. BIN levels/blame/{.gitscrub → .githug}/objects/05/07c26fed4d111a8344763be9af68af90f0ecf2
  25. 0 levels/blame/{.gitscrub → .githug}/objects/09/4094808dc6dc336c93c8602190a9e5f7bd6a11
  26. BIN levels/blame/{.gitscrub → .githug}/objects/21/15d78864000292628872941b14521f90187eed
  27. 0 levels/blame/{.gitscrub → .githug}/objects/31/11dda1f5b08d50ac44b99acabfa54f1e6e72b0
  28. BIN levels/blame/{.gitscrub → .githug}/objects/50/8db115ba34a0e4e8667653aebe0265bb4f7e80
  29. BIN levels/blame/{.gitscrub → .githug}/objects/5e/8863df752e3b7f2150df7c78f12bef6f1ff00e
  30. BIN levels/blame/{.gitscrub → .githug}/objects/67/788a4b90180c7588d7bd0ad8032957b0f429ba
  31. BIN levels/blame/{.gitscrub → .githug}/objects/70/d00535a3a25b0ac1736dd3d306d6271e5427ed
  32. 0 levels/blame/{.gitscrub → .githug}/objects/97/bdd0cccf9f4b8730f78cb53a81a74f205dbcc2
  33. BIN levels/blame/{.gitscrub → .githug}/objects/ab/08819ba3ffaeba17d4f870dc3a458a904519f4
  34. BIN levels/blame/{.gitscrub → .githug}/objects/be/96fe46de646f6a5c728f90cc884aef96fa1d6f
  35. BIN levels/blame/{.gitscrub → .githug}/objects/cd/9c6b9ab1a6f56cccc69b6aa661f1d67ba5fb46
  36. 0 levels/blame/{.gitscrub → .githug}/objects/dd/df1d8ebd60eec169c15a5b23cb49a58d2ed5a0
  37. 0 levels/blame/{.gitscrub → .githug}/objects/ff/d39c2dbfd94bdbca06d48686e0cbda642f3de7
  38. 0 levels/blame/{.gitscrub → .githug}/refs/heads/master
  39. +2 −2 levels/contribute.rb
  40. 0 levels/diff/{.gitscrub → .githug}/COMMIT_EDITMSG
  41. 0 levels/diff/{.gitscrub → .githug}/HEAD
  42. 0 levels/diff/{.gitscrub → .githug}/config
  43. 0 levels/diff/{.gitscrub → .githug}/description
  44. 0 levels/diff/{.gitscrub → .githug}/hooks/applypatch-msg.sample
  45. 0 levels/diff/{.gitscrub → .githug}/hooks/commit-msg.sample
  46. 0 levels/diff/{.gitscrub → .githug}/hooks/post-commit.sample
  47. 0 levels/diff/{.gitscrub → .githug}/hooks/post-receive.sample
  48. 0 levels/diff/{.gitscrub → .githug}/hooks/post-update.sample
  49. 0 levels/diff/{.gitscrub → .githug}/hooks/pre-applypatch.sample
  50. 0 levels/diff/{.gitscrub → .githug}/hooks/pre-commit.sample
  51. 0 levels/diff/{.gitscrub → .githug}/hooks/pre-rebase.sample
  52. 0 levels/diff/{.gitscrub → .githug}/hooks/prepare-commit-msg.sample
  53. 0 levels/diff/{.gitscrub → .githug}/hooks/update.sample
  54. BIN levels/diff/{.gitscrub → .githug}/index
  55. 0 levels/diff/{.gitscrub → .githug}/info/exclude
  56. 0 levels/diff/{.gitscrub → .githug}/logs/HEAD
  57. 0 levels/diff/{.gitscrub → .githug}/logs/refs/heads/master
  58. BIN levels/diff/{.gitscrub → .githug}/objects/1b/6582364621c92707b587409cedbc4f77fc0cee
  59. 0 levels/diff/{.gitscrub → .githug}/objects/4f/703ca9bd25781b6758eeb3c42ed5348610ba6d
  60. 0 levels/diff/{.gitscrub → .githug}/objects/dc/aa55e97af34402e84d5336da37abcccc23cba6
  61. 0 levels/diff/{.gitscrub → .githug}/refs/heads/master
  62. +11 −0 lib/githug.rb
  63. +10 −10 lib/{gitscrub → githug}/cli.rb
  64. +2 −2 lib/{gitscrub → githug}/game.rb
  65. +3 −3 lib/{gitscrub → githug}/level.rb
  66. +1 −1 lib/{gitscrub → githug}/profile.rb
  67. +2 −2 lib/{gitscrub → githug}/repository.rb
  68. +1 −1 lib/{gitscrub → githug}/ui.rb
  69. +3 −0 lib/githug/version.rb
  70. +0 −11 lib/gitscrub.rb
  71. +0 −3 lib/gitscrub/version.rb
  72. +19 −19 spec/{gitscrub → githug}/cli_spec.rb
  73. +8 −8 spec/{gitscrub → githug}/game_spec.rb
  74. +15 −15 spec/{gitscrub → githug}/level_spec.rb
  75. +36 −0 spec/githug/profile_spec.rb
  76. +7 −8 spec/{gitscrub → githug}/repository_spec.rb
  77. +4 −4 spec/{gitscrub → githug}/ui_spec.rb
  78. +0 −36 spec/gitscrub/profile_spec.rb
  79. +1 −1 spec/spec_helper.rb
View
@@ -1,37 +1,37 @@
-#Gitscrub
+#Githug
Git Your Game On
##About
-Gitscrub is designed to give you a practical way of learning git. It has a series of levels, each utilizing git commands to ensure a correct answer.
+Githug is designed to give you a practical way of learning git. It has a series of levels, each utilizing git commands to ensure a correct answer.
##Installation
-To install Gitscrub
+To install Githug
- gem install gitscrub
+ gem install githug
-After the gem is installed, you can run `gitscrub` where you will be prompted to create a directory.
+After the gem is installed, you can run `githug` where you will be prompted to create a directory.
##Commands
-Gitscrub has 3 commands:
+Githug has 3 commands:
* play - This is the default command and it will check your solution for the current level.
* hint - Gives you a hint (if available) for the current level
* reset - Reset the current level
##Contributing
- Get yourself on the [contributors list](https://github.com/Gazler/gitscrub/contributors) by doing the following:
+ Get yourself on the [contributors list](https://github.com/Gazler/githug/contributors) by doing the following:
* Fork the repository
* Make a level using the DSL (covered below)
- * Add your level to the LEVELS array inside `lib/gitscrub/level.rb` in a position that makes sense (the "commit" level after the "add" and "init" levels for example)
+ * Add your level to the LEVELS array inside `lib/githug/level.rb` in a position that makes sense (the "commit" level after the "add" and "init" levels for example)
* Make sure your level works (covered below)
* Submit a pull request
##DSL
-Gitscrub has a DSL for writing levels
+Githug has a DSL for writing levels
An example level:
@@ -83,7 +83,7 @@ This will copy the contents of a repository specified in the levels folder for y
* cd "yourlevel"
* git init
* some git stuff
- * **important** rename ".git" to ".gitscrub" so it does not get treated as a submodule
+ * **important** rename ".git" to ".githug" so it does not get treated as a submodule
* cd "../"
* git add "yourlevel"
View
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+require 'githug/cli'
+
+Githug::CLI.start
View
@@ -1,4 +0,0 @@
-#!/usr/bin/env ruby
-require 'gitscrub/cli'
-
-Gitscrub::CLI.start
@@ -1,17 +1,17 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
-require "gitscrub/version"
+require "githug/version"
Gem::Specification.new do |s|
- s.name = "gitscrub"
- s.version = Gitscrub::VERSION
+ s.name = "githug"
+ s.version = Githug::VERSION
s.authors = ["Gary Rennie"]
s.email = ["webmaster@gazler.com"]
s.homepage = ""
s.summary = %q{An interactive way to learn git.}
s.description = %q{An interactive way to learn git.}
- s.rubyforge_project = "gitscrub"
+ s.rubyforge_project = "githug"
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -2,10 +2,10 @@
description "Contribute to this repository by making a pull request on Github"
solution do
- location = "/tmp/gitscrub"
+ location = "/tmp/githug"
FileUtils.rm_rf(location)
puts "Cloning repository to #{location}"
- `git clone git@github.com:Gazler/gitscrub.git #{location}`
+ `git clone git@github.com:Gazler/githug.git #{location}`
contributor = false
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -0,0 +1,11 @@
+require 'grit'
+require "githug/version"
+
+require 'githug/ui'
+require 'githug/game'
+require 'githug/profile'
+require 'githug/level'
+require 'githug/repository'
+
+Githug::UI.in_stream = STDIN
+Githug::UI.out_stream = STDOUT
@@ -1,6 +1,6 @@
require 'thor'
-require 'gitscrub'
-module Gitscrub
+require 'githug'
+module Githug
class CLI < Thor
@@ -9,7 +9,7 @@ class CLI < Thor
desc :play, "Initialize the game"
def play
- UI.word_box("Gitscrub")
+ UI.word_box("Githug")
make_directory
game = Game.new
game.play_level
@@ -27,7 +27,7 @@ def hint
def reset
if level = load_level
- UI.word_box("Gitscrub")
+ UI.word_box("Githug")
UI.puts("resetting level")
level.setup_level
level.full_description
@@ -43,15 +43,15 @@ def load_level
def make_directory
- if File.exists?("./git_scrub")
- UI.puts "Please change into the git_scrub directory"
+ if File.exists?("./git_hug")
+ UI.puts "Please change into the git_hug directory"
exit
end
- unless File.basename(Dir.pwd) == "git_scrub"
- if UI.ask("No gitscrub directory found, do you wish to create one?")
- Dir.mkdir("./git_scrub")
- Dir.chdir("git_scrub")
+ unless File.basename(Dir.pwd) == "git_hug"
+ if UI.ask("No githug directory found, do you wish to create one?")
+ Dir.mkdir("./git_hug")
+ Dir.chdir("git_hug")
File.open(".gitignore", "w") do |file|
file.write(".profile.yml")
end
@@ -1,4 +1,4 @@
-module Gitscrub
+module Githug
class Game
attr_accessor :profile
@@ -10,7 +10,7 @@ def initialize
def play_level
solve = true
if profile.level == 0
- UI.puts("Welcome to Gitscrub")
+ UI.puts("Welcome to Githug")
solve = false
level_bump
else
@@ -1,4 +1,4 @@
-module Gitscrub
+module Githug
class Level
include UI
@@ -23,7 +23,7 @@ def load(level_no)
def init_from_level
FileUtils.cp_r("#{level_path}/.", ".")
- FileUtils.mv(".gitscrub", ".git")
+ FileUtils.mv(".githug", ".git")
end
def difficulty(num)
@@ -72,7 +72,7 @@ def solve
def show_hint
- UI.word_box("Gitscrub")
+ UI.word_box("Githug")
if @hint
@hint.call
else
@@ -1,5 +1,5 @@
require 'yaml'
-module Gitscrub
+module Githug
class Profile
PROFILE_FILE = ".profile.yml"
@@ -1,4 +1,4 @@
-module Gitscrub
+module Githug
class Repository
attr_accessor :grit
@@ -11,7 +11,7 @@ def initialize(location = ".")
def reset
dont_delete = ["..", ".", ".gitignore", ".profile.yml"]
- if File.basename(Dir.pwd) == "git_scrub"
+ if File.basename(Dir.pwd) == "git_hug"
Dir.entries(Dir.pwd).each do |file|
FileUtils.rm_rf(file) unless dont_delete.include?(file)
end
@@ -1,4 +1,4 @@
-module Gitscrub
+module Githug
module UI
@@out_stream
View
@@ -0,0 +1,3 @@
+module Githug
+ VERSION = "0.0.9"
+end
View
@@ -1,11 +0,0 @@
-require 'grit'
-require "gitscrub/version"
-
-require 'gitscrub/ui'
-require 'gitscrub/game'
-require 'gitscrub/profile'
-require 'gitscrub/level'
-require 'gitscrub/repository'
-
-Gitscrub::UI.in_stream = STDIN
-Gitscrub::UI.out_stream = STDOUT
View
@@ -1,3 +0,0 @@
-module Gitscrub
- VERSION = "0.0.8"
-end
@@ -1,42 +1,42 @@
require 'spec_helper'
-require 'gitscrub/cli'
+require 'githug/cli'
-describe Gitscrub::CLI do
+describe Githug::CLI do
before(:each) do
game = mock.as_null_object
- @cli = Gitscrub::CLI.new
- Gitscrub::Game.stub(:new).and_return(game)
+ @cli = Githug::CLI.new
+ Githug::Game.stub(:new).and_return(game)
end
it "should print the logo" do
- Gitscrub::UI.should_receive(:word_box).with("Gitscrub")
+ Githug::UI.should_receive(:word_box).with("Githug")
@cli.stub(:make_directory)
@cli.play
end
it "should create a directory if one does not exist" do
- Gitscrub::UI.stub(:ask).and_return(true)
- Dir.should_receive(:mkdir).with("./git_scrub")
- Dir.should_receive(:chdir).with("git_scrub")
+ Githug::UI.stub(:ask).and_return(true)
+ Dir.should_receive(:mkdir).with("./git_hug")
+ Dir.should_receive(:chdir).with("git_hug")
File.should_receive(:open).with(".gitignore", "w").and_return(true)
@cli.make_directory
end
it "should not make a directory if you are in the game directory" do
- Dir.stub(:pwd).and_return("/home/git_scrub")
- Gitscrub::UI.should_not_receive(:ask)
+ Dir.stub(:pwd).and_return("/home/git_hug")
+ Githug::UI.should_not_receive(:ask)
@cli.make_directory
end
it "should exit if the user selects no" do
- Gitscrub::UI.stub(:ask).and_return(false)
+ Githug::UI.stub(:ask).and_return(false)
lambda {@cli.make_directory}.should raise_error(SystemExit)
end
it "should prompt to change into the directory if it exists" do
File.stub(:exists?).and_return(true)
- Gitscrub::UI.should_receive(:puts).with("Please change into the git_scrub directory")
+ Githug::UI.should_receive(:puts).with("Please change into the git_hug directory")
lambda {@cli.make_directory}.should raise_error(SystemExit)
end
@@ -45,8 +45,8 @@
@level = mock
@profile = mock
@profile.stub(:level).and_return(1)
- Gitscrub::Profile.stub(:load).and_return(@profile)
- Gitscrub::Level.stub(:load).and_return(@level)
+ Githug::Profile.stub(:load).and_return(@profile)
+ Githug::Level.stub(:load).and_return(@level)
end
it "should call the hint method on the level" do
@@ -60,17 +60,17 @@
it "should reset the current level" do
@level.should_receive(:setup_level)
@level.should_receive(:full_description)
- Gitscrub::UI.should_receive(:word_box).with("Gitscrub")
- Gitscrub::UI.should_receive(:puts).with("resetting level")
+ Githug::UI.should_receive(:word_box).with("Githug")
+ Githug::UI.should_receive(:puts).with("resetting level")
@cli.reset
end
it "should not reset if the level cannot be loaded" do
- Gitscrub::Level.stub(:load).and_return(false)
+ Githug::Level.stub(:load).and_return(false)
@level.should_not_receive(:setup_level)
@level.should_not_receive(:full_description)
- Gitscrub::UI.should_not_receive(:word_box).with("Gitscrub")
- Gitscrub::UI.should_not_receive(:puts).with("resetting level")
+ Githug::UI.should_not_receive(:word_box).with("Githug")
+ Githug::UI.should_not_receive(:puts).with("resetting level")
@cli.reset
end
end
@@ -1,18 +1,18 @@
require 'spec_helper'
-describe Gitscrub::Game do
+describe Githug::Game do
before(:each) do
@profile = mock
- Gitscrub::Profile.stub(:new).and_return(@profile)
- @game = Gitscrub::Game.new
+ Githug::Profile.stub(:new).and_return(@profile)
+ @game = Githug::Game.new
@profile.stub(:level).and_return(1)
@profile.stub(:save)
@level = mock
@level.stub(:full_description)
@level.stub(:setup_level)
- Gitscrub::UI.stub(:puts)
- Gitscrub::Level.stub(:load).and_return(@level)
+ Githug::UI.stub(:puts)
+ Githug::Level.stub(:load).and_return(@level)
end
it "should have a profile" do
@@ -23,21 +23,21 @@
@level.should_not_receive(:solve)
@profile.stub(:level).and_return(0)
@profile.should_receive(:save)
- Gitscrub::UI.should_receive(:puts).with("Welcome to Gitscrub")
+ Githug::UI.should_receive(:puts).with("Welcome to Githug")
@profile.should_receive(:level=).with(1)
@game.play_level
end
it "should echo congratulations if the level is solved" do
@level.stub(:solve).and_return(true)
@profile.should_receive(:level=).with(2)
- Gitscrub::UI.should_receive(:success).with("Congratulations, you have solved the level")
+ Githug::UI.should_receive(:success).with("Congratulations, you have solved the level")
@game.play_level
end
it "should echo congratulations if the level is solved" do
@level.stub(:solve).and_return(false)
- Gitscrub::UI.should_receive(:error).with("Sorry, this solution is not quite right!")
+ Githug::UI.should_receive(:error).with("Sorry, this solution is not quite right!")
@game.play_level
end
Oops, something went wrong.

0 comments on commit 1621f85

Please sign in to comment.