Class: RakeGitCrypt::Home

Inherits:
Object
  • Object
show all
Defined in:
lib/rake_git_crypt/home.rb

Instance Method Summary collapse

Constructor Details

#initialize(work_directory, home_directory) ⇒ Home

Returns a new instance of Home.



5
6
7
8
# File 'lib/rake_git_crypt/home.rb', line 5

def initialize(work_directory, home_directory)
  @work_directory = work_directory
  @home_directory = home_directory
end

Instance Method Details

#with_resolved_directoryObject



10
11
12
13
14
15
16
17
# File 'lib/rake_git_crypt/home.rb', line 10

def with_resolved_directory(&)
  if @home_directory == :temporary
    Dir.mktmpdir('home', @work_directory, &)
  else
    FileUtils.mkdir_p(@home_directory) if @home_directory
    yield @home_directory
  end
end