Module: Debian::Build::HelperMethods

Instance Method Summary collapse

Instance Method Details

#get(url) ⇒ Object



21
22
23
# File 'lib/debian/build/helper_methods.rb', line 21

def get(url)
  sh "wget -m --no-directories #{url}"  
end

#sudo(*args) ⇒ Object



4
5
6
# File 'lib/debian/build/helper_methods.rb', line 4

def sudo(*args)
  sh (["sudo"] + args).join(' ')
end

#uncompress(archive) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/debian/build/helper_methods.rb', line 8

def uncompress(archive)
  case archive
  when /\.tar\.bz2$/
    sh "tar -xjf #{archive}"
  when /\.tar\.gz$/
    sh "tar -xzf #{archive}"
  when /\.zip$/
    sh "unzip -o -qq #{archive}"
  else
    raise "Unsupported archive type: #{archive}"
  end
end