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.
48 49 50 51 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 48 def initialize(git, subpath) @git = git @subpath = subpath end |
Instance Attribute Details
#git ⇒ Object (readonly)
Returns the value of attribute git.
46 47 48 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 46 def git @git end |
#subpath ⇒ Object (readonly)
Returns the value of attribute subpath.
46 47 48 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 46 def subpath @subpath end |
Instance Method Details
#delete ⇒ Object
61 62 63 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 61 def delete path.unlink end |
#path ⇒ Object
53 54 55 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 53 def path git.root_path.join(*subpath) end |
#touch ⇒ Object
57 58 59 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 57 def touch ::FileUtils.touch(path.to_path) end |
#write(content) ⇒ Object
65 66 67 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 65 def write(content) path.write(content) end |