Class: EacGit::Rspec::StubbedGitLocalRepo::Directory

Inherits:
FsObject
  • Object
show all
Defined in:
lib/eac_git/rspec/stubbed_git_local_repo/directory.rb

Instance Attribute Summary

Attributes inherited from FsObject

#git, #subpath

Instance Method Summary collapse

Methods inherited from FsObject

#initialize, #path

Constructor Details

This class inherits a constructor from EacGit::Rspec::StubbedGitLocalRepo::FsObject

Instance Method Details

#createself

Returns:

  • (self)


10
11
12
13
# File 'lib/eac_git/rspec/stubbed_git_local_repo/directory.rb', line 10

def create
  ::FileUtils.mkdir_p(path)
  self
end

#deleteself

Returns:

  • (self)


16
17
18
19
# File 'lib/eac_git/rspec/stubbed_git_local_repo/directory.rb', line 16

def delete
  ::FileUtils.rm_rf(path)
  self
end

#directory(*subpath) ⇒ EacGit::Rspec::StubbedGitLocalRepo::Directory

Parameters:

  • subpath (Array<String>)

Returns:



23
24
25
# File 'lib/eac_git/rspec/stubbed_git_local_repo/directory.rb', line 23

def directory(*subpath)
  git.directory(*self.subpath, *subpath)
end

#file(*subpath) ⇒ EacGit::Rspec::StubbedGitLocalRepo::File

Parameters:

  • subpath (Array<String>)

Returns:



29
30
31
# File 'lib/eac_git/rspec/stubbed_git_local_repo/directory.rb', line 29

def file(*subpath)
  git.file(*self.subpath, *subpath)
end