Module: Tango::Contexts::Helpers

Included in:
Chain, Runner
Defined in:
lib/tango/contexts/helpers.rb

Instance Method Summary collapse

Instance Method Details

#as_user(umask, &block) ⇒ Object



19
20
21
# File 'lib/tango/contexts/helpers.rb', line 19

def as_user(umask, &block)
  in_context(User.new(umask), &block)
end

#in_context(context, &block) ⇒ Object



7
8
9
# File 'lib/tango/contexts/helpers.rb', line 7

def in_context(context, &block)
  Chain.new.in_context(context, &block)
end

#in_directory(directory, &block) ⇒ Object



11
12
13
# File 'lib/tango/contexts/helpers.rb', line 11

def in_directory(directory, &block)
  in_context(Directory.new(directory), &block)
end

#with_umask(umask, &block) ⇒ Object



15
16
17
# File 'lib/tango/contexts/helpers.rb', line 15

def with_umask(umask, &block)
  in_context(Umask.new(umask), &block)
end