Class: GitTest::Proj
- Inherits:
-
Git::Base
- Object
- Git::Base
- GitTest::Proj
- Defined in:
- lib/git_test/proj.rb
Instance Attribute Summary collapse
-
#notify ⇒ Object
Returns the value of attribute notify.
Instance Method Summary collapse
- #check_repo_status! ⇒ Object
- #clone_to(path) ⇒ Object (also: #clone_to_test)
-
#initialize(options = {}, notify = Notify.new) ⇒ Proj
constructor
A new instance of Proj.
- #path ⇒ Object
- #real_pull(remote = 'origin', branch = 'master') ⇒ Object
-
#repo_name ⇒ Object
def test_directory File.join(path, ‘..’, “.tmp-git-test-dir-for-##repo_name”) end.
- #show(branch, file) ⇒ Object
- #username ⇒ Object
Constructor Details
Instance Attribute Details
#notify ⇒ Object
Returns the value of attribute notify.
3 4 5 |
# File 'lib/git_test/proj.rb', line 3 def notify @notify end |
Instance Method Details
#check_repo_status! ⇒ Object
28 29 30 |
# File 'lib/git_test/proj.rb', line 28 def check_repo_status! repo_status_checked = true end |
#clone_to(path) ⇒ Object Also known as: clone_to_test
44 45 46 |
# File 'lib/git_test/proj.rb', line 44 def clone_to(path) Git.clone(self.repo, path) end |
#path ⇒ Object
32 33 34 |
# File 'lib/git_test/proj.rb', line 32 def path dir.to_s end |
#real_pull(remote = 'origin', branch = 'master') ⇒ Object
23 24 25 26 |
# File 'lib/git_test/proj.rb', line 23 def real_pull(remote = 'origin', branch = 'master') check_repo_status! self.lib.send :command, 'pull', [remote, branch] end |
#repo_name ⇒ Object
def test_directory
File.join(path, '..', ".tmp-git-test-dir-for-#{repo_name}")
end
40 41 42 |
# File 'lib/git_test/proj.rb', line 40 def repo_name path.split('/').last end |
#show(branch, file) ⇒ Object
18 19 20 |
# File 'lib/git_test/proj.rb', line 18 def show(branch, file) self.lib.send :command, "show", "#{branch}:#{file}" end |
#username ⇒ Object
10 11 12 |
# File 'lib/git_test/proj.rb', line 10 def username config["user.name"] end |