Module: Tango::Contexts::Helpers

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

Instance Method Summary collapse

Instance Method Details

#as_user(user, &block) ⇒ Object



17
18
19
# File 'lib/tango/contexts/helpers.rb', line 17

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

#in_context(context, &block) ⇒ Object



5
6
7
# File 'lib/tango/contexts/helpers.rb', line 5

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

#in_directory(directory, &block) ⇒ Object



9
10
11
# File 'lib/tango/contexts/helpers.rb', line 9

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

#with_umask(umask, &block) ⇒ Object



13
14
15
# File 'lib/tango/contexts/helpers.rb', line 13

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