Module: Dapp::Dimg::Dimg::Path

Included in:
Dapp::Dimg::Dimg
Defined in:
lib/dapp/dimg/dimg/path.rb

Instance Method Summary collapse

Instance Method Details

#build_path(*path) ⇒ Object Also known as: build_dir



18
19
20
# File 'lib/dapp/dimg/dimg/path.rb', line 18

def build_path(*path)
  dapp.build_path(*path).expand_path.tap { |p| p.parent.mkpath }
end

#container_dapp_path(*path) ⇒ Object



22
23
24
# File 'lib/dapp/dimg/dimg/path.rb', line 22

def container_dapp_path(*path)
  make_path('/.dapp', *path)
end

#container_tmp_path(*path) ⇒ Object



26
27
28
# File 'lib/dapp/dimg/dimg/path.rb', line 26

def container_tmp_path(*path)
  container_dapp_path('tmp', *path)
end

#home_path(*path) ⇒ Object



5
6
7
# File 'lib/dapp/dimg/dimg/path.rb', line 5

def home_path(*path)
  dapp.path(*path).expand_path
end

#tmp_dir_exists?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/dapp/dimg/dimg/path.rb', line 9

def tmp_dir_exists?
  @tmp_path != nil
end

#tmp_path(*path) ⇒ Object Also known as: tmp_dir



13
14
15
16
# File 'lib/dapp/dimg/dimg/path.rb', line 13

def tmp_path(*path)
  @tmp_path ||= Dir.mktmpdir('dapp-', dapp.tmp_base_dir)
  make_path(@tmp_path, *path).expand_path.tap { |p| p.parent.mkpath }
end