SlideShare uma empresa Scribd logo
1 de 31
Baixar para ler offline
rake
Not your father’s build tool




                               1
whatchutalk’nboutwillis

• Where it came from
• What it’s related to
• How to use it


                          2
What’s in a name?

• Usually the first thing people learn about
  rake is the etymology of the name: “Ruby
  Make”.
• But it’s much more than a catchy turn of
  phrase.
• It’s a fully featured Build Language. That
  almost never existed...


                                               3
Ruby Version of Make?


• Jim tells the birth of rake as code he never
  intended to write.
• It started with a simple itch to scratch...


                                                 4
Jim Thought “What if...”
"What if you could specify the make tasks in Ruby, like this ..."


   task "build" do
     java_compile(...args, etc ...)
   end


  "The task function would register "build" as a target to be made,
  and the block would be the action executed whenever the build
  system determined that it was time to do the build target."



                                                                      5
100 Lines Later

• It worked!
• Rake’s prototype lives in the repo:
  doc/proto_rake.rdoc
• But it didn’t have timebased file
  dependencies... so back to the text-editor.
• And the rest is in the commit history.

                                                6
A Build Language

• The basic unit of a build language are tasks.
• A build has source files that it uses to
  produce a desired product.
• The two most common other build
  languages are make and ant.



                                                  7
Comparison

    make                 ant                rake
Imperative Style    Imperative Style   Dependency Based


 External DSL        External DSL        Internal DSL


Custom Syntax      XML based Syntax      Ruby Syntax




                                                          8
Imperative Style




                   9
Imperative Style

• Both the code_generation methods will be
  called during test.
• At best that will waste time.
• At worst that can produce undesired
  results.



                                             10
Dependency Based




                   11
Dependency Based

• A dependency based system gives the test
  method the power to evaluate what
  prerequisites it has.
• Then because ruby can evaluate the code
  without running it, it can prepare it to be
  run in the correct order that will only run
  each task once.


                                                12
Comparison

    make                 ant                rake
Imperative Style    Imperative Style   Dependency Based


 External DSL        External DSL        Internal DSL


Custom Syntax      XML based Syntax      Ruby Syntax




                                                          13
External vs Internal DSL


• With make and ant you need to use
  external scripts or nasty syntax to be
  creative.
• Rake can use full power of Ruby at any
  time.




                                           14
Hello World




              15
Building Blocks of Rake
•   task        •   FileUtils

•   file         •   clean

•   directory   •   clobber

•   namespace

•   multitask




                                16
task




In the DSL of rake, a task is a method that takes
two arguments. The first argument is a hash, and
the second is a block.



                                                    17
task dependencies




                    18
file



Rake file tasks are most similar to tasks in make.
They get run only when needed. File tasks are
declared using a string rather than a symbol. The
following file task creates a executable program
(named prog) given two object files name a.o and
b.o.


                                                    19
directory




It is common to need to create directories upon
demand. The directory convenience method is a
short-hand for creating a FileTask that creates the
directory.


                                                      20
directory




The directory method does not accept prerequisites
or actions, but both prerequisites and actions can
be added later.


                                                     21
namespaces




             22
multitask




Multitask can help you save time by running tasks
in your build that are safe to run in parallel.


                                                    23
multitask




It even has the ability to determine any
prerequisites that need to be run before hand. It
will complete this prep_for_copy only once then the
three tasks would begin to run together.


                                                      24
FileUtils

• Use the FileUtils module and rake gives you
  the most common filesystem commands:
  • cd, pwd, mkdir, mkdir_p, rmdir, ln, ln_s,
     ln_sf, cp, cp_r, mv, rm, rm_r, rm_rf, install,
     chmod, touch
• Create a map of files with FileList:
 • FileList[‘**/*.rb’].each {|f| puts f}
                                                      25
Clean/Clobber

• require 'rake/clean'
• Use a pair of file lists: CLEAN and CLOBBER.
• You can then add items to the file lists with
  expressions like CLEAN.include('*.o').
• Remember that the clean task removes everything
  in the clean list, and clobber removes everything in
  both lists.



                                                         26
Built In Tasks


• GemPackageTask (in Ruby Gems now)
• PackageTask
• RdocTask (in Rdoc now)
• TestTask

                                      27
Rake & Rails

• The default task for a rails project runs
  your test suite.
• If you want to see how the rake tasks you
  enjoy with Rails are built search for .rake in
  the gem source.
• Because as we all know, Rails is Magic!

                                                   28
rake

• Jim Weirich created in 2003.
• Similar to make and ant. With the power of
  Ruby.
• Hope you’ve got some ideas on how you’d
  like to use it.



                                               29
Credits

• Jim Weirich - Rake
  http://rake.rubyforge.org/
• Martin Fowler - Using the Rake Build
  Language
  http://martinfowler.com/articles/rake.html
• Josh Nichols - Rake: The Familiar Stranger
  http://vimeo.com/2496890


                                               30
Thank You


• tyler.bird@gmail.com
• @filmprog
• filmprog.com


                         31

Mais conteúdo relacionado

Mais procurados

Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Mark Menard
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mrubyHiroshi SHIBATA
 
Large-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesLarge-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesHiroshi SHIBATA
 
An introduction and future of Ruby coverage library
An introduction and future of Ruby coverage libraryAn introduction and future of Ruby coverage library
An introduction and future of Ruby coverage librarymametter
 
tDiary annual report 2009 - Sapporo Ruby Kaigi02
tDiary annual report 2009 - Sapporo Ruby Kaigi02tDiary annual report 2009 - Sapporo Ruby Kaigi02
tDiary annual report 2009 - Sapporo Ruby Kaigi02Hiroshi SHIBATA
 
How to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHow to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHiroshi SHIBATA
 
Geecon 2019 - Taming Code Quality in the Worst Language I Know: Bash
Geecon 2019 - Taming Code Quality  in the Worst Language I Know: BashGeecon 2019 - Taming Code Quality  in the Worst Language I Know: Bash
Geecon 2019 - Taming Code Quality in the Worst Language I Know: BashMichał Kordas
 
The Future of Dependency Management for Ruby
The Future of Dependency Management for RubyThe Future of Dependency Management for Ruby
The Future of Dependency Management for RubyHiroshi SHIBATA
 
The Future of Bundled Bundler
The Future of Bundled BundlerThe Future of Bundled Bundler
The Future of Bundled BundlerHiroshi SHIBATA
 
The details of CI/CD environment for Ruby
The details of CI/CD environment for RubyThe details of CI/CD environment for Ruby
The details of CI/CD environment for RubyHiroshi SHIBATA
 
Building Awesome CLI apps in Go
Building Awesome CLI apps in GoBuilding Awesome CLI apps in Go
Building Awesome CLI apps in GoSteven Francia
 
The Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyThe Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyHiroshi SHIBATA
 
MacRuby: What is it? and why should you care?
MacRuby: What is it? and why should you care?MacRuby: What is it? and why should you care?
MacRuby: What is it? and why should you care?Joshua Ballanco
 
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)SATOSHI TAGOMORI
 
The Future of library dependency management of Ruby
 The Future of library dependency management of Ruby The Future of library dependency management of Ruby
The Future of library dependency management of RubyHiroshi SHIBATA
 
Ractor's speed is not light-speed
Ractor's speed is not light-speedRactor's speed is not light-speed
Ractor's speed is not light-speedSATOSHI TAGOMORI
 
JRuby: Pushing the Java Platform Further
JRuby: Pushing the Java Platform FurtherJRuby: Pushing the Java Platform Further
JRuby: Pushing the Java Platform FurtherCharles Nutter
 
OSS Security the hard way
OSS Security the hard wayOSS Security the hard way
OSS Security the hard wayHiroshi SHIBATA
 

Mais procurados (20)

Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
 
What's new in RubyGems3
What's new in RubyGems3What's new in RubyGems3
What's new in RubyGems3
 
Large-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesLarge-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 Minutes
 
An introduction and future of Ruby coverage library
An introduction and future of Ruby coverage libraryAn introduction and future of Ruby coverage library
An introduction and future of Ruby coverage library
 
tDiary annual report 2009 - Sapporo Ruby Kaigi02
tDiary annual report 2009 - Sapporo Ruby Kaigi02tDiary annual report 2009 - Sapporo Ruby Kaigi02
tDiary annual report 2009 - Sapporo Ruby Kaigi02
 
How to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHow to Begin to Develop Ruby Core
How to Begin to Develop Ruby Core
 
Geecon 2019 - Taming Code Quality in the Worst Language I Know: Bash
Geecon 2019 - Taming Code Quality  in the Worst Language I Know: BashGeecon 2019 - Taming Code Quality  in the Worst Language I Know: Bash
Geecon 2019 - Taming Code Quality in the Worst Language I Know: Bash
 
The Future of Dependency Management for Ruby
The Future of Dependency Management for RubyThe Future of Dependency Management for Ruby
The Future of Dependency Management for Ruby
 
The Future of Bundled Bundler
The Future of Bundled BundlerThe Future of Bundled Bundler
The Future of Bundled Bundler
 
The details of CI/CD environment for Ruby
The details of CI/CD environment for RubyThe details of CI/CD environment for Ruby
The details of CI/CD environment for Ruby
 
Building Awesome CLI apps in Go
Building Awesome CLI apps in GoBuilding Awesome CLI apps in Go
Building Awesome CLI apps in Go
 
The Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyThe Future of library dependency manageement of Ruby
The Future of library dependency manageement of Ruby
 
MacRuby: What is it? and why should you care?
MacRuby: What is it? and why should you care?MacRuby: What is it? and why should you care?
MacRuby: What is it? and why should you care?
 
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
 
The Future of library dependency management of Ruby
 The Future of library dependency management of Ruby The Future of library dependency management of Ruby
The Future of library dependency management of Ruby
 
Git Internals
Git InternalsGit Internals
Git Internals
 
Ractor's speed is not light-speed
Ractor's speed is not light-speedRactor's speed is not light-speed
Ractor's speed is not light-speed
 
JRuby: Pushing the Java Platform Further
JRuby: Pushing the Java Platform FurtherJRuby: Pushing the Java Platform Further
JRuby: Pushing the Java Platform Further
 
OSS Security the hard way
OSS Security the hard wayOSS Security the hard way
OSS Security the hard way
 

Destaque (20)

Afp19
Afp19Afp19
Afp19
 
Carolinas country cooking
Carolinas country cookingCarolinas country cooking
Carolinas country cooking
 
Betty crocker cooking basics recipes
Betty crocker cooking basics recipesBetty crocker cooking basics recipes
Betty crocker cooking basics recipes
 
Country cooking
Country cookingCountry cooking
Country cooking
 
Favorite dishes
Favorite dishesFavorite dishes
Favorite dishes
 
New jersey hotdog
New jersey hotdogNew jersey hotdog
New jersey hotdog
 
101 recipes from god's garden
101 recipes from god's garden101 recipes from god's garden
101 recipes from god's garden
 
Gifts in a jar
Gifts in a jarGifts in a jar
Gifts in a jar
 
De re coquinaria
De re coquinariaDe re coquinaria
De re coquinaria
 
Hotdog recipes
Hotdog recipesHotdog recipes
Hotdog recipes
 
GSWRC Cookie training 2013
GSWRC Cookie training 2013GSWRC Cookie training 2013
GSWRC Cookie training 2013
 
Japanese recipes 1
Japanese recipes 1Japanese recipes 1
Japanese recipes 1
 
on-the-grill
 on-the-grill on-the-grill
on-the-grill
 
Generaccion edicion-132-gastronomia-863
Generaccion edicion-132-gastronomia-863Generaccion edicion-132-gastronomia-863
Generaccion edicion-132-gastronomia-863
 
Healthy gourmet recipes
Healthy gourmet recipesHealthy gourmet recipes
Healthy gourmet recipes
 
Recipes tried and true (1894 cookbook)
Recipes tried and true (1894 cookbook)Recipes tried and true (1894 cookbook)
Recipes tried and true (1894 cookbook)
 
Healthy, thrifty meals
Healthy, thrifty mealsHealthy, thrifty meals
Healthy, thrifty meals
 
Diabetic recipes
Diabetic recipesDiabetic recipes
Diabetic recipes
 
Lifestyle to health
Lifestyle to healthLifestyle to health
Lifestyle to health
 
All dinner span
All dinner spanAll dinner span
All dinner span
 

Semelhante a Rake: Not Your Father's Build Tool

10 Things you should know about Ruby
10 Things you should know about Ruby10 Things you should know about Ruby
10 Things you should know about Rubysikachu
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Nilesh Panchal
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Espen Brækken
 
An introduction to Rails 3
An introduction to Rails 3An introduction to Rails 3
An introduction to Rails 3Blazing Cloud
 
RubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on RailsRubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on Railselliando dias
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLBarry Jones
 
Docker for the Rubyist
Docker for the RubyistDocker for the Rubyist
Docker for the RubyistBrian DeHamer
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorialknoppix
 
Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Charles Nutter
 
Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to Rubykim.mens
 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First MileGourab Mitra
 

Semelhante a Rake: Not Your Father's Build Tool (20)

10 Things you should know about Ruby
10 Things you should know about Ruby10 Things you should know about Ruby
10 Things you should know about Ruby
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
 
Why ruby
Why rubyWhy ruby
Why ruby
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
 
ruby pentest
ruby pentestruby pentest
ruby pentest
 
An introduction to Rails 3
An introduction to Rails 3An introduction to Rails 3
An introduction to Rails 3
 
Ruby and Security
Ruby and SecurityRuby and Security
Ruby and Security
 
RubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on RailsRubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on Rails
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
Docker for the Rubyist
Docker for the RubyistDocker for the Rubyist
Docker for the Rubyist
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorial
 
Polyglot Grails
Polyglot GrailsPolyglot Grails
Polyglot Grails
 
Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016
 
Cucumber presenation
Cucumber presenationCucumber presenation
Cucumber presenation
 
Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to Ruby
 
Rustbridge
RustbridgeRustbridge
Rustbridge
 
2 Basics
2 Basics2 Basics
2 Basics
 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First Mile
 
ruby-cocoa
ruby-cocoaruby-cocoa
ruby-cocoa
 

Último

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 

Último (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 

Rake: Not Your Father's Build Tool

  • 2. whatchutalk’nboutwillis • Where it came from • What it’s related to • How to use it 2
  • 3. What’s in a name? • Usually the first thing people learn about rake is the etymology of the name: “Ruby Make”. • But it’s much more than a catchy turn of phrase. • It’s a fully featured Build Language. That almost never existed... 3
  • 4. Ruby Version of Make? • Jim tells the birth of rake as code he never intended to write. • It started with a simple itch to scratch... 4
  • 5. Jim Thought “What if...” "What if you could specify the make tasks in Ruby, like this ..." task "build" do java_compile(...args, etc ...) end "The task function would register "build" as a target to be made, and the block would be the action executed whenever the build system determined that it was time to do the build target." 5
  • 6. 100 Lines Later • It worked! • Rake’s prototype lives in the repo: doc/proto_rake.rdoc • But it didn’t have timebased file dependencies... so back to the text-editor. • And the rest is in the commit history. 6
  • 7. A Build Language • The basic unit of a build language are tasks. • A build has source files that it uses to produce a desired product. • The two most common other build languages are make and ant. 7
  • 8. Comparison make ant rake Imperative Style Imperative Style Dependency Based External DSL External DSL Internal DSL Custom Syntax XML based Syntax Ruby Syntax 8
  • 10. Imperative Style • Both the code_generation methods will be called during test. • At best that will waste time. • At worst that can produce undesired results. 10
  • 12. Dependency Based • A dependency based system gives the test method the power to evaluate what prerequisites it has. • Then because ruby can evaluate the code without running it, it can prepare it to be run in the correct order that will only run each task once. 12
  • 13. Comparison make ant rake Imperative Style Imperative Style Dependency Based External DSL External DSL Internal DSL Custom Syntax XML based Syntax Ruby Syntax 13
  • 14. External vs Internal DSL • With make and ant you need to use external scripts or nasty syntax to be creative. • Rake can use full power of Ruby at any time. 14
  • 16. Building Blocks of Rake • task • FileUtils • file • clean • directory • clobber • namespace • multitask 16
  • 17. task In the DSL of rake, a task is a method that takes two arguments. The first argument is a hash, and the second is a block. 17
  • 19. file Rake file tasks are most similar to tasks in make. They get run only when needed. File tasks are declared using a string rather than a symbol. The following file task creates a executable program (named prog) given two object files name a.o and b.o. 19
  • 20. directory It is common to need to create directories upon demand. The directory convenience method is a short-hand for creating a FileTask that creates the directory. 20
  • 21. directory The directory method does not accept prerequisites or actions, but both prerequisites and actions can be added later. 21
  • 23. multitask Multitask can help you save time by running tasks in your build that are safe to run in parallel. 23
  • 24. multitask It even has the ability to determine any prerequisites that need to be run before hand. It will complete this prep_for_copy only once then the three tasks would begin to run together. 24
  • 25. FileUtils • Use the FileUtils module and rake gives you the most common filesystem commands: • cd, pwd, mkdir, mkdir_p, rmdir, ln, ln_s, ln_sf, cp, cp_r, mv, rm, rm_r, rm_rf, install, chmod, touch • Create a map of files with FileList: • FileList[‘**/*.rb’].each {|f| puts f} 25
  • 26. Clean/Clobber • require 'rake/clean' • Use a pair of file lists: CLEAN and CLOBBER. • You can then add items to the file lists with expressions like CLEAN.include('*.o'). • Remember that the clean task removes everything in the clean list, and clobber removes everything in both lists. 26
  • 27. Built In Tasks • GemPackageTask (in Ruby Gems now) • PackageTask • RdocTask (in Rdoc now) • TestTask 27
  • 28. Rake & Rails • The default task for a rails project runs your test suite. • If you want to see how the rake tasks you enjoy with Rails are built search for .rake in the gem source. • Because as we all know, Rails is Magic! 28
  • 29. rake • Jim Weirich created in 2003. • Similar to make and ant. With the power of Ruby. • Hope you’ve got some ideas on how you’d like to use it. 29
  • 30. Credits • Jim Weirich - Rake http://rake.rubyforge.org/ • Martin Fowler - Using the Rake Build Language http://martinfowler.com/articles/rake.html • Josh Nichols - Rake: The Familiar Stranger http://vimeo.com/2496890 30
  • 31. Thank You • tyler.bird@gmail.com • @filmprog • filmprog.com 31