Class: Inprovise::MockExecutionContext
Instance Attribute Summary
#config, #node, #script
Instance Method Summary
collapse
#as, #binary_exists?, #env, #exec, #for_user, #in_dir, #init_config, #initialize, #local, #log, #remote, #run_local, #template, #trigger
Instance Method Details
#copy(from, to) ⇒ Object
266
267
268
|
# File 'lib/inprovise/execution_context.rb', line 266
def copy(from, to)
@log.mock_execute("COPY: #{from} #{to}")
end
|
#download(from, to) ⇒ Object
254
255
256
|
# File 'lib/inprovise/execution_context.rb', line 254
def download(from, to)
@log.mock_execute("DOWLOAD: #{to} <= #{from}")
end
|
#mkdir(path) ⇒ Object
258
259
260
|
# File 'lib/inprovise/execution_context.rb', line 258
def mkdir(path)
@log.mock_execute("MKDIR: #{path}")
end
|
#remove(path) ⇒ Object
262
263
264
|
# File 'lib/inprovise/execution_context.rb', line 262
def remove(path)
@log.mock_execute("REMOVE: #{path}")
end
|
#run(cmd) ⇒ Object
240
241
242
243
|
# File 'lib/inprovise/execution_context.rb', line 240
def run(cmd)
@log.mock_execute(cmd)
''
end
|
#set_owner(path, user, group = nil) ⇒ Object
274
275
276
|
# File 'lib/inprovise/execution_context.rb', line 274
def set_owner(path, user, group=nil)
@log.mock_execute("SET_OWNER: #{path} #{user} #{group ? " #{group}" : ''}")
end
|
#set_permissions(path, mask) ⇒ Object
270
271
272
|
# File 'lib/inprovise/execution_context.rb', line 270
def set_permissions(path, mask)
@log.mock_execute("SET_PERMISSIONS: #{path} #{'%o' % mask}")
end
|
#sudo(cmd) ⇒ Object
245
246
247
248
|
# File 'lib/inprovise/execution_context.rb', line 245
def sudo(cmd)
@log.mock_execute "sudo #{cmd}"
''
end
|
#upload(from, to) ⇒ Object
250
251
252
|
# File 'lib/inprovise/execution_context.rb', line 250
def upload(from, to)
@log.mock_execute("UPLOAD: #{from} => #{to}")
end
|