Module: Lab42::Tmux::Helpers

Included in:
Lab42::Tmux
Defined in:
lib/lab42/tmux/helpers.rb

Instance Method Summary collapse

Instance Method Details

#expand_dir(dir) ⇒ Object



9
10
11
12
# File 'lib/lab42/tmux/helpers.rb', line 9

def expand_dir dir
  return dir if %r{\A/} === dir
  File.join project_home, dir
end

#if_dir(dir, &blk) ⇒ Object



4
5
6
7
# File 'lib/lab42/tmux/helpers.rb', line 4

def if_dir dir, &blk
  return unless File.directory? expand_dir dir
  instance_eval_or_call blk
end