Class: EacGit::Rspec::StubbedGitLocalRepo::StubbedGitRepositoryFile
- Inherits:
-
Object
- Object
- EacGit::Rspec::StubbedGitLocalRepo::StubbedGitRepositoryFile
- Defined in:
- lib/eac_git/rspec/stubbed_git_local_repo.rb
Instance Attribute Summary collapse
-
#git ⇒ Object
readonly
Returns the value of attribute git.
-
#subpath ⇒ Object
readonly
Returns the value of attribute subpath.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(git, subpath) ⇒ StubbedGitRepositoryFile
constructor
A new instance of StubbedGitRepositoryFile.
- #path ⇒ Object
- #touch ⇒ Object
- #write(content) ⇒ Object
Constructor Details
#initialize(git, subpath) ⇒ StubbedGitRepositoryFile
Returns a new instance of StubbedGitRepositoryFile.
37 38 39 40 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 37 def initialize(git, subpath) @git = git @subpath = subpath end |
Instance Attribute Details
#git ⇒ Object (readonly)
Returns the value of attribute git.
35 36 37 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 35 def git @git end |
#subpath ⇒ Object (readonly)
Returns the value of attribute subpath.
35 36 37 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 35 def subpath @subpath end |
Instance Method Details
#delete ⇒ Object
50 51 52 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 50 def delete path.unlink end |
#path ⇒ Object
42 43 44 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 42 def path git.root_path.join(*subpath) end |
#touch ⇒ Object
46 47 48 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 46 def touch ::FileUtils.touch(path.to_path) end |
#write(content) ⇒ Object
54 55 56 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 54 def write(content) path.write(content) end |