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)


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

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

#deleteself

Returns:

  • (self)


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

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

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

Parameters:

  • subpath (Array<String>)

Returns:



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

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

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

Parameters:

  • subpath (Array<String>)

Returns:



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

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