Rake

Rake
Γενικά
Διανομή
Έκδοση13.4.2 (16 Απριλίου 2026)[1]
Λειτουργικά
Ανάπτυξη
Άδεια χρήσηςΆδεια MIT
Σύνδεσμοι
Επίσημος ιστότοπος
https://ruby.github.io/rake
Αποθετήριο κώδικα
https://github.com/ruby/rake

Το Rake είναι ένα εργαλείο για τη διεύθυνση εργασιών λογισμικού. Επιτρέπει τον ορισμό εργασιών και την περιγραφή εξαρτήσεων ενώ μπορεί να ομαδοποιήσει εργασίες σε χώρους ονομάτων (namespaces).

Αν και μοιάζει με το SCons και το make, έχει κάποιες διαφορές. Το εργαλείο έχει γραφεί στη γλώσσα προγραμματισμού Ruby και τα Rakefiles (αντίστοιχα των Makefiles του make) χρησιμοποιούν σύνταξη Ruby. Αρχικά αναπτύχθηκε από τον Jim Weirich.

Το Rake χρησιμοποιεί τα μπλοκ ανώνυμων συναρτήσεων της Ruby για τον ορισμό διάφορων εργασιών, επιτρέποντας σύνταξη Ruby. Διαθέτει μια βιβλιοθήκη από κοινές εργασίες όπως συναρτήσεις για κοινές εργασίες με αρχεία και μια βιβλιοθήκη που αφαιρεί τα μεταγλωττισμένα αρχεία (η εργασία "clean"). Όπως το Make, το Rake μπορεί να συνθέσει εργασίες με βάση πρότυπα (patterns), για παράδειγμα μπορεί να κατασκευάζει αυτόματα μια εργασία μεταγλώττισης αρχείων με βάση πρότυπα ονομάτων αρχείων. Το Rake αποτελεί μέρος της βασικής βιβλιοθήκης της Ruby από την έκδοση 1.9.

Παράδειγμα

Ακολουθεί ένα παράδειγμα ενός απλού σεναρίου Rake που κατασκευάζει ένα πρόγραμμα HelloWorld σε C:

  file 'hello.o' => ['hello.c'] do
    sh 'cc -c -o hello.o hello.c'
  end
  file 'hello' => ['hello.o'] do
    sh 'cc -o hello hello.o'
  end

Ακολουθεί ένα παράδειγμα μιας συνταγής σε rake:

namespace :cake do
  desc 'make pancakes'
  task :pancake => [:flour,:milk,:egg,:baking_powder] do
     puts "sizzle"
  end
  task :butter do
    puts "cut 3 tablespoons of butter into tiny squares"
  end
  task :flour => :butter do
    puts "use hands to knead butter squares into 1 1/2 cup flour"
  end
  task :milk do
    puts "add 1 1/4 cup milk"
  end
  task :egg do
   puts " 1 egg "
  end
  task :baking_powder do
   puts " 3 1/2 teaspoons baking powder"
  end
end

Δείτε επίσης

Εξωτερικοί σύνδεσμοι

  1. «Release 13.4.2». 16 Απριλίου 2026. Ανακτήθηκε στις 16 Απριλίου 2026. 

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.