Sha256: 67260af64dcf1e6a7ac57d88d7cc268c4110dfee71f4a2316caab8814df99fbc

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

desc 'Install dependencies'

def root_privileges_required!
  raise "Root privileges are required.\nPlease launch this task again as root." if ENV["USER"]!="root"
end

namespace :install_dependencies do
  # Not tested yet
  desc 'Install required packages on Debian'
  task :on_debian => :deb_packages


  # Tested successfully on 7.10 (gutsy)
  # odt2txt package not available on previous versions
  desc 'Install required packages on Ubuntu'
  task :on_ubuntu => :on_debian

  desc 'Install required gems and programs on Windows'
  task :on_windows_xp do
    #NOTE: Long way to go before it runs on XP.
    $stderr.puts "Implement me!"
  end

  desc 'Install required gems and packages on Mac Os'
  task :on_mac_os do
    $stderr.puts "Implement me!"
  end

  desc 'Install required .deb packages'
  task :deb_packages do
    root_privileges_required!
    #TODO: Should load this list from defined PlainTextExtractor's
    packages=%w{antiword poppler-utils odt2txt html2text catdoc unrtf mguesser libdbm-ruby1.8}.join(" ")
    puts "Installing "<<packages
    system("apt-get install "<<packages)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
picolena-0.1.7 lib/picolena/templates/lib/tasks/install_dependencies.rake
picolena-0.1.8 lib/picolena/templates/lib/tasks/install_dependencies.rake
picolena-0.2.0 lib/picolena/templates/lib/tasks/install_dependencies.rake