Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'colorize'
- task default: %w[test]
- def title task
- puts task.to_s.colorize :green
- end
- def subtitle task
- puts task.to_s.colorize :cyan
- end
- namespace :linux do
- desc "list files"
- task :list do |t|
- title t
- %x(ls).each_line do |data|
- puts "I founded #{data}"
- end
- end
- desc "update list of new packets"
- task :update do |t|
- title t
- system "sudo apt-get update"
- end
- desc "upgrade packets"
- task :upgrade => :update do |t|
- title t
- system "sudo apt-get upgrade"
- end
- desc "free space"
- task :clean do |t|
- title t
- %w(autoclean autoremove purge).each do |action|
- subtitle action
- system "sudo apt-get #{action}"
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement