Rake Task Management Essentials
eBook - ePub

Rake Task Management Essentials

Andrey Koleshko

Share book
  1. 122 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Rake Task Management Essentials

Andrey Koleshko

Book details
Book preview
Table of contents
Citations

About This Book

In Detail

Rake is a build automation tool written in Ruby. It allows you to specify tasks and describe dependencies as well as group tasks in a namespace. Rake uses Ruby's anonymous function blocks to define various tasks, allowing the use of the Ruby syntax. Rake's goal is to automate build processes quickly and expressively.

"Rake Task Management Essentials" is a practical guide that covers the latest techniques in building, testing, and debugging rake tasks to solve real-world automation challenges. The book starts with a basic knowledge of Rake, allowing you to solve repetitive tasks. Then it provides you with information about processes performed with files, which is crucial for understanding the application of the tool. It includes demonstrations to show you how tasks can be run in parallel and how they can be applied in practice. Thereafter, it integrates Rake with Ruby with the help of simple and clear examples. By the end of this book, you will know how Rake has changed the programming world, especially in the Ruby community.

Approach

A step-by-step and interactive approach explaining the Rake essentials along with code examples and advanced features.

Who this book is for

If you are a developer who is acquainted with the Ruby language and want to speed up writing the code concerned with files, then this book is for you. To start reading this book, a basic knowledge of Ruby is required; however, an extensive experience with the language is not necessary.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Rake Task Management Essentials an online PDF/ePUB?
Yes, you can access Rake Task Management Essentials by Andrey Koleshko in PDF and/or ePUB format, as well as other popular books in Informatique & Programmation en Ruby. We have over one million books available in our catalogue for you to explore.

Information

Year
2014
ISBN
9781783280773

Rake Task Management Essentials


Table of Contents

Rake Task Management Essentials
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. The Software Task Management Tool – Rake
Installing Rake
Introducing rake tasks
The command-line arguments
Using global Rakefiles to run tasks anywhere
Defining custom rake tasks
Task dependencies – prerequisites
Multiple tasks definitions
Passing arguments to the tasks
The first alternative
The second variant
The structure of a Rake project
Using the import method to load other Rakefiles
Running rake tasks from other tasks
The code conventions of Rake
Summary
2. Working with Files
Using file tasks to work with files
The characteristics of the file task dependencies
Creating a folder with the directory method
Using Rake's file utilities
Using the FileList module functionality to collect the files
Using pathmap to transform file lists
Introducing the FileUtils module
A practical example of automatically generating a config file
Summary
3. Working with Rules
Understanding the duplication of the file tasks
Using a rule to get rid of the duplicated file tasks
Detecting a source for the rule dynamically
Using a regular expression to match more tasks
Summary
4. Cleaning Up a Build
Setting up a project
The cleaning tasks
Summary
5. Running Tasks in Parallel
Defining tasks with parallel prerequisites
Thread safety of multitasks
Multiple task definitions with a common prerequisite
Applying multitasks in practice
Summary
6. Debugging Rake Tasks
Using command-line arguments for debugging
Getting a dependency's resolution with --prereqs
Using the --rules option to trace the rule resolution
Using the Ruby approach to debug a Rake project
Summary
7. Integration with Rails
Introducing Rake's integration with Rails
Custom rake tasks in a Rails project
Recurrent running of tasks
Summary
8. Testing Rake Tasks
The need for tests
Writing tests for rake tasks
Summary
9. Continuous Integration
Introducing Jenkins
Setting up Jenkins
Configuring Jenkins to run rake tasks
Summary
10. Relentless Automation
Examples of Rake being used by famous gems
The pain of task execution
Sinatra using Rake to run tests
Sinatra using Rake to generate documentation
Capistrano extending the Rake implementation
Other examples of Sinatra using Rake
Thor – the next generation of Rake
Summary
Index

Rake Task Management Essentials

Copyright © 2014 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2014
Production Reference: 1140414
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78328-077-3
www.packtpub.com
Cover Image by Kim Nousaine ()

Credits

Author
Andrey Koleshko
Reviewers
Mario Miguel AgĂŒero Obando
Stuart Ellis
Avinasha Sastry
Commissioning Editor
Grant Mizen
Acquisition Editor
Neha Nagwekar
Content Development Editor
Priya Singh
Technical Editor
Dennis John
Copy Editor
Stuti Srivastava
Project Coordinator
Harshal Ved
Proofreaders
Simran Bhogal
Ameesha Green
Indexer
Mehreen Deshmukh
Graphics
Sheetal Aute
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta

About the Author

Andrey Koleshko had his first touch with programming while at school, when he worked on Pascal. He had been solving basic algorithmic tasks. The first programming language he used at the beginning of his career was Java. He worked with this language for a year and then migrated to the Ruby language, which he worked with for the next four years. Of these four years, he worked with Altoros for three. He had an amazing time there, learning the language and technologies deeply.
Currently, he works at a local cloud hosting company. The company change provided him with the opportunity to deal with a lot of challenges concerning application architecture, code testing, debugging, and deployment processes. As a result, he has been able to contribute to some famous Ruby libraries. More detailed information about his contributions can be found on GitHub at http://github.com/ka8725.
He mostly works with the Rails framework. He openly shares all of his thoughts and his most interesting experiences through his blog at http://railsguides.net. He has recently started to learn the Python programming language.
He lives in Minsk, Belarus, and likes to watch and play sports such as soccer, ping-pong, and volleyball. He also likes travelling to tropical countries with his wife. Teaching people gives him immense pleasure.

Acknowledgements

I'm thankful to many people who've helped me write this book. But firstly, I would like to thank the publishers who offered me an opportunity to write this book. If it wasn't for them, who knows what would have happened with this book. Thankfully, the Packt Publishing team was very supportive and helped me deliver this useful book with high quality. A big thanks goes to Sergey Avseyev, who always supported me in the technical and difficult parts of the book. He also made me believe...

Table of contents