Class: Avm::Git::SpecHelper::StubbedGitRepositoryFile

Inherits:
Object
  • Object
show all
Defined in:
lib/avm/git/spec_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(git, subpath) ⇒ StubbedGitRepositoryFile

Returns a new instance of StubbedGitRepositoryFile.



34
35
36
37
# File 'lib/avm/git/spec_helper.rb', line 34

def initialize(git, subpath)
  @git = git
  @subpath = subpath
end

Instance Attribute Details

#gitObject (readonly)

Returns the value of attribute git.



32
33
34
# File 'lib/avm/git/spec_helper.rb', line 32

def git
  @git
end

#subpathObject (readonly)

Returns the value of attribute subpath.



32
33
34
# File 'lib/avm/git/spec_helper.rb', line 32

def subpath
  @subpath
end

Instance Method Details

#deleteObject



47
48
49
# File 'lib/avm/git/spec_helper.rb', line 47

def delete
  ::File.unlink(path)
end

#pathObject



39
40
41
# File 'lib/avm/git/spec_helper.rb', line 39

def path
  ::File.join(git, *subpath)
end

#touchObject



43
44
45
# File 'lib/avm/git/spec_helper.rb', line 43

def touch
  ::FileUtils.touch(path)
end

#write(content) ⇒ Object



51
52
53
# File 'lib/avm/git/spec_helper.rb', line 51

def write(content)
  ::File.write(path, content)
end