Class: Inprovise::MockExecutionContext

Inherits:
ExecutionContext show all
Defined in:
lib/inprovise/execution_context.rb

Instance Attribute Summary

Attributes inherited from ExecutionContext

#config, #node, #script

Instance Method Summary collapse

Methods inherited from ExecutionContext

#as, #binary_exists?, #env, #exec, #exec_config, #for_user, #in_dir, #initialize, #local, #log, #move, #remote, #resolve_action_ref, #run_local, #setup_for_node!, #template, #trigger

Constructor Details

This class inherits a constructor from Inprovise::ExecutionContext

Instance Method Details

#copy(from, to) ⇒ Object



277
278
279
# File 'lib/inprovise/execution_context.rb', line 277

def copy(from, to)
  @log.mock_execute("COPY: #{from} #{to}")
end

#download(from, to) ⇒ Object



265
266
267
# File 'lib/inprovise/execution_context.rb', line 265

def download(from, to)
  @log.mock_execute("DOWLOAD: #{to} <= #{from}")
end

#mkdir(path) ⇒ Object



269
270
271
# File 'lib/inprovise/execution_context.rb', line 269

def mkdir(path)
  @log.mock_execute("MKDIR: #{path}")
end

#remove(path) ⇒ Object



273
274
275
# File 'lib/inprovise/execution_context.rb', line 273

def remove(path)
  @log.mock_execute("REMOVE: #{path}")
end

#run(cmd) ⇒ Object



251
252
253
254
# File 'lib/inprovise/execution_context.rb', line 251

def run(cmd)
  @log.mock_execute(cmd)
  ''
end

#set_owner(path, user, group = nil) ⇒ Object



285
286
287
# File 'lib/inprovise/execution_context.rb', line 285

def set_owner(path, user, group=nil)
  @log.mock_execute("SET_OWNER: #{path} #{user} #{group ? " #{group}" : ''}")
end

#set_permissions(path, mask) ⇒ Object



281
282
283
# File 'lib/inprovise/execution_context.rb', line 281

def set_permissions(path, mask)
  @log.mock_execute("SET_PERMISSIONS: #{path} #{'%o' % mask}")
end

#sudo(cmd) ⇒ Object



256
257
258
259
# File 'lib/inprovise/execution_context.rb', line 256

def sudo(cmd)
  @log.mock_execute "sudo #{cmd}"
  ''
end

#upload(from, to) ⇒ Object



261
262
263
# File 'lib/inprovise/execution_context.rb', line 261

def upload(from, to)
  @log.mock_execute("UPLOAD: #{from} => #{to}")
end