Module: RakeNPM::Mixins::Directoried

Included in:
Tasks::Install, Tasks::RunScript
Defined in:
lib/rake_npm/mixins/directoried.rb

Instance Method Summary collapse

Instance Method Details

#in_directory(directory, &block) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/rake_npm/mixins/directoried.rb', line 6

def in_directory(directory, &block)
  if directory
    Dir.chdir(directory, &block)
  else
    block.call
  end
end