Class: RakeGitCrypt::Home
- Inherits:
-
Object
- Object
- RakeGitCrypt::Home
- Defined in:
- lib/rake_git_crypt/home.rb
Instance Method Summary collapse
-
#initialize(work_directory, home_directory) ⇒ Home
constructor
A new instance of Home.
- #with_resolved_directory ⇒ Object
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_directory ⇒ Object
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 |