Class: PuppetModule::Pkg::Tasks::System

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_module/pkg/tasks/system.rb

Instance Method Summary collapse

Instance Method Details

#cp(src, dest) ⇒ Object



9
10
11
# File 'lib/puppet_module/pkg/tasks/system.rb', line 9

def cp(src, dest)
  FileUtils.cp_r only_existing_entries_of(ensure_array(src)), dest
end

#ls(path) ⇒ Object



22
23
24
# File 'lib/puppet_module/pkg/tasks/system.rb', line 22

def ls(path)
  Dir.new(path).entries.reject { |d| d =~ /^\.*$/ }
end

#mkdir(path) ⇒ Object



5
6
7
# File 'lib/puppet_module/pkg/tasks/system.rb', line 5

def mkdir(path)
  FileUtils.mkdir_p path
end

#rm(path) ⇒ Object



13
14
15
# File 'lib/puppet_module/pkg/tasks/system.rb', line 13

def rm(path)
  FileUtils.rm_rf path
end

#sh(cmd) ⇒ Object



17
18
19
20
# File 'lib/puppet_module/pkg/tasks/system.rb', line 17

def sh(cmd)
  # TODO: This should be supported through an external logger!
  puts `#{cmd}`
end