• Contribute / Hire

custom rake tasks

How to Write a Custom Rake Task

Rake provides a great way to automate repetitive or complex tasks. Here's a look at creating a simple and a more complex task.

Rake is a nice, powerful tool for automating tasks in a ruby project.

We've chatted here about how to accept arguments within a rake task , and I suspect that will be of use coming out of this discussion. However, for the purposes of getting started with rake, let's consider some simple examples.

First, you need to get setup. If your project doesn't already have rake installed, then you'll need to add it to your project. I wrote an article on just that topic .

Rake Syntax

Rake tasks follow this convention:

Rake tasks have three main parts:

  • description

The description ( desc ) gives a brief description of what the task does, which comes in handy when you start adding a handful of tasks. The name is a unique way in which you identify the task. And last, the code block is the code that is executed when the task is run.

In addition, note that although rake tasks are written in ruby, their file extension is .rake , NOT .rb .

List Available Tasks

At any point you can see the available tasks by running:

Note: This ignores tasks without descriptions. To see all tasks (including tasks without description, you can add a v option:

Also note: If you are using rake from your Gemfile, it's best to use bundle exec to ensure we run the correct version of rake:

A Simple Task

Let's add the simplest of all the simple tasks ever there were. Our "Hello World" task will simply tell us "Hello."

Here's what it would look like:

lib/tasks/hello_world.rake

Let's list out our rake tasks to find the one we just wrote.

Along with any other tasks in your project, you should see this line:

This means you can run this test from your project's root like so:

Getting More Complicated

Really, rake is just a means by which you can execute ruby scripts. Therefore, it can do almost anything you can imagine to help you be more productive.

Let's take a task I put into most Ruby on Rails projects. This task finds all of the models in your application and creates CSV files for you to fill in seed data.

First let's look at the task, then we'll break it down.

lib/tasks/db.rake

A namespace simply segments the task. The task, named create_files would otherwise sit on its own and not give you much inclination as to what it did (other than create files). One alternative would be to name it create_db_seed_files , but instead I've put it in its own namespace.

This means this task would be called as rake db:seed:create_files , which fits in nicely with other db tasks.

Loading the Environment

In Rails, if you want access to ActiveRecord models, you have to load in the environment, which is done via => :environment . The line below doesn't just initiate the task. It also loads the environment.

Requiring Files

Inside the task, we first make sure we include all the files. glob steps through each file in the specified path, which we called the file variable, while we simply require it.

Creating Directories

Next, we make a new directory to place our files in, unless it already exists.

Stepping Through Models and Creating Files

The next thing (our guts) all happens in one loop. The loop begins by stepping through each ActiveRecord model, as we do with this line:

Now the model is available via the model object. We check to see if the seed file already exists:

And if it doesn't, then we write a new file.

Within that file (with the f object), With initialize it by make that models columns the headers in the file.

And last, we let the user know we created a file.

That's just one example, but you can see how you can take time-consuming tasks and turn them into repeatable solutions via a rake task.

Let's Connect

Keep reading.

custom rake tasks

4 Ways to Pass Arguments to a Rake Task

Always googling and forgetting how to pass arguments to rake tasks? Here's a up list of the various methods.

custom rake tasks

Add Rake To Any Project

Rake is an awesome tool. You may want to use it in a non-Ruby project or a project that isn't configured for it.

custom rake tasks

Disable Rake Commands in a Rails Project

Sometimes you want to disable some of the default rake tasks in a rails project. Here's a quick way to do just that.

DEV Community

DEV Community

Vinicius Stock

Posted on Nov 29, 2018

Customizing Rails rake tasks

Rails rake tasks are commands that automate specific actions to be used either by the developers or by other mechanisms (e.g.: a deploy that will invoke rake tasks). Many tasks come configured with Rails out of the box to provide important functionality. In this post, I will explain how to override tasks and change their steps to customize them for your own application.

Here are a few examples of out of the box tasks:

However, tasks can quite easily be overridden to execute different actions. This is useful for defining steps for a build process that might include more than running the test suite or simply for changing the behavior of an existing task.

Customizing rake tasks to fit your needs can improve your productivity and help to guarantee that everyone in the project is using a standardized process (or at least that they have the tools to easily do so).

How to do it?

Overriding rake tasks is pretty straight forward. It involves two things: clearing the original task and re-defining it. Any code can go inside the new definition, however I recommend to neatly organize each step with their own rake task for simplicity.

How to create a new rake task

User defined rake tasks live inside the lib/tasks folder. Any file ending in ".rake" will be automatically picked up and loaded by Rails.

Done! You can now invoke your new rake task using the command below. In the next section, we will go through on how to invoke it from other tasks.

How to override an existing task

To override a task, clear the current behavior and re-define it in Rakefile. The example below will override the default rake to invoke our custom task.

And there you have it! The default rake task can be configured to do whatever your application needs.

In the next section, I will go through my usual set up for Rails applications.

My preferred configuration

The configuration I like to use overrides both the default and the test rake tasks, integrating them with a few tools. The steps for each are described below (check individual tool set up and configuration in their respective repos).

If any of these steps break, build process is stopped and fails.

Steps run in the following order

  • Brakeman - Code analysis for security
  • Parallel tests - Runs tests in parallel
  • Rubocop - Code quality analysis
  • Rails best practices - Best practices for Rails analysis
  • Reek - Code smells analysis

This one simply replaces running tests to use parallel

Now that we went through the high level description, let's get to business. Here is the Rakefile with the overridden tasks and the individual task definitions themselves.

The brakeman rake task

The rails best practices rake task

The reek rake task

The Gemfile

Overridden rake tasks can boost productivity and help enforce good practices among members of a team. Take advantage of them!

What other tools would you integrate with rake tasks?

What other uses can this capability have?

Top comments (1)

pic

Templates let you quickly answer FAQs or store snippets for re-use.

ben profile image

  • Email [email protected]
  • Location NY
  • Education Mount Allison University
  • Pronouns He/him
  • Work Co-founder at Forem
  • Joined Dec 27, 2015

Fabulous post

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink .

Hide child comments as well

For further actions, you may consider blocking this person and/or reporting abuse

andrewbaisden profile image

React Custom Hooks vs. Helper Functions - When To Use Both

Andrew Baisden - Jul 3

sundarbadagala081 profile image

Image Lazy Loading

sundarbadagala - Jul 4

caleb_fadare profile image

Tackling CORS Issues: My Backend Development Challenge and HNG Internship Journey

Folajimi Fadare - Jun 30

vyan profile image

Deploying a React Application to Production: A Comprehensive Guide

Vishal Yadav - Jul 4

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

  • Browse Episodes
  • RailsCasts Pro
  • Notifications

RailsCasts Pro episodes are now free!

Learn more or hide this

#66 Custom Rake Tasks

  • mp4 Full Size H.264 Video (14.4 MB)
  • m4v Smaller H.264 Video (9.86 MB)
  • webm Full Size VP8 Video (32.9 MB)
  • ogv Full Size Theora Video (21.6 MB)
  • 55 Comments
  • Similar Episodes
  • Next Episode >
  • < Previous Episode
  • Rake Documentation
  • Rails Rake Tutorial
  • Using the Rake Building Language
  • Ruby on Rails

custom rake tasks

Ruby on Rails Tutorial: Understanding Rake and Task Automation

In the world of web development, efficiency is the name of the game. Developers are always on the lookout for tools and techniques that can help streamline their workflows, save time, and reduce errors. One such indispensable tool in the Ruby on Rails framework is Rake. In this tutorial, we’ll dive deep into Rake and explore how it can automate repetitive tasks and make your Ruby on Rails development experience smoother.

Ruby on Rails Tutorial: Understanding Rake and Task Automation

Table of Contents

1. Introduction to Rake

1.1. what is rake.

Rake is a build automation tool written in Ruby, primarily used in Ruby on Rails applications. It’s similar to Makefiles in Unix systems but is designed specifically for Ruby projects. Rake is a command-line tool that allows you to define and run tasks to automate various parts of your development process.

1.2. Why Use Rake?

Rake is a powerful ally for Ruby on Rails developers for several reasons:

  • Task Automation: Rake simplifies repetitive and complex tasks, making it easier to manage your application.
  • Consistency: Tasks are defined in code, ensuring that everyone on your team performs them consistently.
  • Extensibility: You can create custom tasks to fit your project’s unique needs.
  • Integration: Rake seamlessly integrates with Rails and other Ruby gems.

2. Getting Started with Rake

2.1. installation.

Rake comes pre-installed with Ruby, so there’s no need to install it separately. You can check if Rake is available on your system by running the following command:

2.2. Basic Rake Tasks

Let’s start with some basic Rake tasks. In your Rails application directory, you can run the default Rake task with:

This will list all available Rake tasks for your project. By default, Rails generates some essential tasks for database management, testing, and more.

To run a specific task, use the following command:

For instance, to migrate your database, use:

3. Writing Your Own Rake Tasks

3.1. the rakefile.

To create custom Rake tasks, you’ll need to work with the Rakefile. This file, usually located in your Rails application’s root directory, is where you define and organize your tasks. If your application doesn’t have a Rakefile, you can create one.

3.2. Defining Tasks

Defining a task in Rake is straightforward. You use the task method and provide a symbol as the task name, followed by a block of code that represents the task’s functionality. Here’s a simple example:

You can run this task using rake greet. It will output “Hello, Rake!” to the console.

3.3. Running Tasks

Rake tasks can also take arguments and options. For instance, suppose you want to pass a name to your greet task:

Now, you can run rake greet[“Alice”], and it will greet Alice. If you omit the name, it defaults to “Rake.”

4. Common Use Cases for Rake

4.1. database management.

One of the most common use cases for Rake in Ruby on Rails is database management. Rails provides several built-in tasks to help you migrate, seed, and reset your database.

To create and migrate the database:

To populate the database with seed data:

To reset the database:

These tasks help you keep your database schema up-to-date and ensure that your development and production databases are in sync.

4.2. Asset Compilation

In addition to database tasks, Rake can be used for asset compilation. When working with assets like JavaScript and CSS files, you can use Rake to precompile and manage them efficiently.

To precompile assets for production:

This task generates minified and concatenated versions of your assets, which can significantly improve your application’s performance in production.

4.3. Testing Automation

Automating tests is another area where Rake shines. Rails developers commonly use Rake tasks to run tests, generate code coverage reports, and manage testing-related tasks.

To run your test suite:

To generate a code coverage report:

By creating custom Rake tasks, you can extend and enhance your testing automation to suit your project’s specific needs.

5. Advanced Rake Techniques

5.1. namespaces.

Namespaces help organize your Rake tasks into logical groups. For example, if you have multiple database-related tasks, you can group them under a db namespace:

This allows you to run tasks like rake db:migrate and rake db:seed, keeping your Rake tasks organized and more readable.

5.2. Dependencies

You can specify task dependencies in Rake. This means that one task can depend on the successful completion of another task. For instance, you might want to run database migrations before seeding the database:

Now, when you run rake seed, Rake will first execute the migrate task and then proceed with seed.

5.3. Task Arguments

Tasks can accept arguments, making them more versatile. For example, you can create a task to generate a report based on a specific date:

You can then run this task with rake generate_report[2023-09-26] to generate a report for a specific date.

6. Rake in Real Projects

Example 1: database backup task.

Let’s consider a real-world example. You want to create a Rake task to backup your production database regularly. Here’s how you might define such a task:

You can run this task with rake backup_database, and it will create a backup of your production database with a timestamp in the filename.

Example 2: Automated Testing Suite

In a large Rails project, you might have a suite of Rake tasks for various testing scenarios. Here’s an example of how you can structure your testing tasks:

With this setup, you can run all unit tests with rake test:unit, all integration tests with rake test:integration, and generate a code coverage report for both with rake test:coverage.

7. Best Practices and Tips

7.1. organizing your rake tasks.

As your project grows, you may accumulate numerous Rake tasks. To maintain code readability and organization, consider placing tasks related to a specific area (e.g., database, testing) into their respective namespaces. Additionally, document your tasks with desc statements to provide clear descriptions for each task.

7.2. Error Handling

When writing Rake tasks, be sure to implement error handling to gracefully handle failures. You can use begin and rescue blocks to capture and handle exceptions, ensuring that tasks do not leave your application in an inconsistent state.

7.3. Documentation

Documenting your Rake tasks is essential, especially when working with a team. Include comments explaining the purpose and usage of each task in your Rakefile. This helps team members understand the tasks and use them effectively.

In the world of Ruby on Rails development, Rake is a powerful tool that can significantly improve your workflow by automating repetitive tasks and enhancing project organization. Whether you’re managing databases, compiling assets, or automating testing, Rake provides the flexibility and extensibility needed to make your development process smoother and more efficient.

By mastering Rake and incorporating it into your Rails projects, you’ll not only save time but also ensure consistency and reliability in your development tasks. So, don’t hesitate to explore Rake’s capabilities and start automating your Ruby on Rails projects today. Happy coding!

custom rake tasks

Ruby on Rails Home

How to Use Rake to Manage Tasks in Rails

How to Use Rake to Manage Tasks in Rails image

What is Rake?

Rake is a build tool written in Ruby that provides a simple way to manage tasks and their dependencies. It is similar to other build tools like Make, Ant, and Maven. Rake allows you to define tasks in a Ruby DSL, making it easier to write and maintain complex build scripts.

Why Use Rake in Rails?

Rails applications come with several built-in rake tasks that help developers automate common tasks, such as database migrations, running tests, and generating code templates. Additionally, Rake allows you to create custom tasks specific to your application's needs. This makes it a powerful tool for Rails developers to streamline their development process.

Getting Started with Rake

Rake is already included in Rails, so you don't need to install it separately. To see the list of available rake tasks in your Rails application, run the following command in your terminal:

Creating Custom Rake Tasks

To create a custom rake task, you need to create a file with the extension .rake inside the lib/tasks directory of your Rails application. The naming convention for Rake files is namespace_taskname.rake .

Let's create a custom rake task to display a "Hello, Rails!" message. Create a new file called hello.rake inside the lib/tasks directory and add the following code:

In the code above, we defined a namespace called greet and a task called hello inside it. The :environment dependency ensures that the Rails environment is loaded before executing the task. The desc method provides a description for the task that will be displayed when listing the available tasks using rake -T .

To run the custom task, use the following command:

Managing Task Dependencies

Rake allows you to define task dependencies, ensuring that tasks are executed in the correct order. Let's add a new task called goodbye in the hello.rake file and make it dependent on the hello task:

Now, when you run the goodbye task, Rake will first execute the hello task and then the goodbye task:

Rake is an essential tool for Rails developers, as it allows you to automate common tasks and create custom tasks specific to your application. By understanding how to create and manage Rake tasks, you can greatly improve your productivity when working with Rails applications. If you're looking to hire Ruby developers , ensure they have a strong understanding of Rake and its capabilities.

If you're interested in enhancing this article or becoming a contributing author, we'd love to hear from you.

Please contact Sasha at [email protected] to discuss the opportunity further or to inquire about adding a direct link to your resource. We welcome your collaboration and contributions!

Rails, also known as Ruby on Rails or RoR, is a popular open-source web application framework designed for rapid application development. It follows the Model-View-Controller (MVC) architecture, which promotes separation of concerns and makes it easier for developers to build, maintain, and scale applications. Rails provide an extensive set of tools and features that help developers create web applications quickly and efficiently. It is particularly suitable for building database-backed applications.

Learn more about Rails from the official documentation or find tutorials and resources on Rails Tutorial .

Rake is a build tool written in Ruby that provides a simple way to manage tasks and their dependencies. It is similar to other build tools like Make, Ant, and Maven. Rake allows you to define tasks in a Ruby Domain Specific Language (DSL), making it easier to write and maintain complex build scripts. It is widely used in the Ruby on Rails ecosystem for task automation, including database migrations, running tests, and generating code templates. To learn more about Rake, visit the official Rake GitHub repository .

Task Dependencies

Task dependencies are a concept used in build tools and task automation systems to ensure that tasks are executed in the correct order and only when their required prerequisites are met. By defining dependencies between tasks, developers can create complex workflows where tasks automatically trigger other tasks upon completion. This helps manage complex build processes and ensures that the correct steps are taken at the right time. Task dependencies can be found in build tools such as Rake (Ruby), Make (C/C++), Ant (Java), and many others. To learn more about task dependencies and build tools, refer to the documentation of the specific build tool or task automation system you are using.

Elevate Your Engineering Capabilities with Expert Remote Ruby Developers Skilled in Swagger

Effortlessly Scale Your Tech Team with Expert Remote Ruby on Rails Developers Skilled in Pundit

Elevate Your Engineering Capabilities with Expert Remote Ruby on Rails Developers Skilled in Amazon S3 Services

secure.food

RubyMine 2024.1 Help

Run rake tasks.

Rake is a popular task runner for Ruby and Rails applications. For example, Rails provides the predefined Rake tasks for creating databases, running migrations, and performing tests. You can also create custom tasks to automate specific actions - run code analysis tools, backup databases, and so on.

RubyMine provides a convenient way to run, debug , and reload Rake tasks. Moreover, you can use run/debug configurations to run tasks with specific parameters: you can pass task arguments, specify environment variables, and so on.

Before running a Rake task

Make sure the 'rake' gem is installed to the project SDK.

Check that the Rakefile is located in the project's root.

RubyMine allows you to run an arbitrary Rake task. For example, let’s see how to run the db:migrate task required for migrating a database in the Rails application:

Run a task using Run Anything

Do one of the following:

Press Ctrl twice and start typing db:migrate in the invoked popup. Select rake db:migrate from the list and press Enter .

Run Anything / rake db:migrate

Go to Tools | Run Rake Task Ctrl+Alt+R . In the invoked popup, start typing db:migrate , select db:migrate and press Enter .

In the invoked Execute 'db:migrate' dialog, select the required migration version and environment. Click OK .

Execute db:migrate

Run a task from the editor

In the *.rake file, do one of the following:

Click the Run Rake Task button on the gutter next to the required task.

Place the caret at the required task name and press Alt+Enter .

Depending on whether you want to run or debug a task, select Run '<task name>' or Debug '<task name>' . Press Enter .

After you've run a Rake task, RubyMine automatically creates a special profile - a temporary run/debug configuration . You can customize settings of this configuration, for example, you can pass task arguments, specify environment variables, and so on. Then, you can save the customized configuration to quickly run this configuration in the future.

Run a task using a run/debug configuration

RubyMine automatically creates the Rake run configurations for running the Minitest and RSpec tests in Rails applications - test and spec . You can run these tasks or any other task with the existing run/debug configurations in one of the following ways:

Press Ctrl twice to invoke the Run Anything popup. Start typing the required configuration name, select it from the list, and press Enter .

Go to Run | Run... Alt+Shift+F10 and select the desired configuration from the list and press Enter .

Reload Rake tasks

Sometimes it is necessary to reload Rake tasks. For example, this can be useful if you created a custom task and need to run it. To reload Rake tasks, do one of the following:

Press Ctrl+Shift+A and start typing Reload Rake Tasks . Select this item from the list and press Enter .

Go to Tools | Run Rake Task Ctrl+Alt+R . In the invoked popup, select rake --tasks and press Enter .

Configure parameters for running a task

When you run a Rake task for the first time , RubyMine automatically creates a corresponding Rake temporary configuration , which can be saved. If necessary, you can create the Rake run/debug configuration manually from the predefined template.

To customize the run/debug configuration, do the following:

Open the Run/Debug Configuration dialog in one of the following ways:

Select Run | Edit Configurations from the main menu.

With the Navigation bar visible ( View | Appearance | Navigation Bar ), choose Edit Configurations from the run/debug configuration selector.

Edit run configurations

Press Alt+Shift+F10 and then press 0 .

In the opened Run/Debug Configurations dialog, select the required configuration in the Rake group, and specify its settings.

Run/Debug Configurations: Rake

Run/debug configuration: Rake

Configuration tab.

Item

Description

Name

In this field, specify the name of the current run/debug configuration.

Task name

Specify the name of the Rake task to be executed. Note that you can use ( ) to see the available tasks.

Arguments

Specify to be passed to the Rake task. These arguments should be separated with commas. For example:

Rake task as shown below:

run configuration and specify its settings in the following way:

:

:

Turn on invoke/execute tracing, enable full backtrace

Enable the Rake .

Do a dry run without executing actions

Enable the Rake .

Display the tasks and dependencies, then exit

Enable the Rake .

Attach test runner UI for frameworks

Depending on the used , enable the required test runner UI for .

Working directory

Specify the working directory used by the running task. For example, this option is in effect when the running script loads other scripts by relative paths.

Environment variables

Specify the list of environment variables as the name-value pairs, separated with semi-colons. Alternatively, click dialog.

Ruby arguments

Specify the to be passed to the Ruby interpreter.

Ruby SDK

Specify the desired Ruby interpreter. You can choose the project default Ruby SDK, or select a different one from the list of configured Ruby SDKs.

Using MoSCoW in Agile to Prioritize Better

One of the key ideas in Agile is prioritization – a team needs to understand which features must be done and which can be left behind in order to produce the best result. However, the concept can be quite difficult to grasp when moving from a different project management approach. A prioritization technique called MoSCoW brings great help and clarity in such cases.

First used with Dynamic Systems Development Method, MoSCoW is a technique developed by Dai Clegg . The sole purpose of this prioritization approach is to help understand the importance that the stakeholders put on each of the features and requirements they pose. Thus being able to focus on the exact most important ones first and tacking on the rest only if the team has time left.

The technique requires to divide all of the features into four categories – Must, Should, Could and Won’t. Thus forming the MSCW acronym from which the name MoSCoW appears. In order to know which of the features are crucial, the team has to categorize them into the four groups.

Must have features are absolutely crucial to the project. Should have features are important to the project, but less urgent. Could have features are not as important as they are desirable and should only be completed if there is left over time. And lastly Won’t have features are either not important or not possible at the time and thus are not completed at all.

Once the team prioritizes the features, they create a clear action plan to move forward. First, they have to complete all of the Must have features. Once that is done they can move onto the Should haves. And only after all of the Should haves are done, the team can consider the Could haves. This way the focus is on the most important tasks right away.

What does this have to do with Agile ? It will help teams transition, prioritize and plan better.

Running a first Sprint or a first iteration can and most likely will be tough on any team. You don’t know what you are doing, you are still questioning the process and on top of that now you have to decide with which of the many tasks you will start first. Adding the MoSCoW technique in such cases will bring the team clarity and provide the ability to move forward.

Depending on the process, the team could even divide the backlog into 4 columns based on the four importance groups. This way being able to add the new features straight into the appropriate columns and compare them against each other to get a better sense of their priorities.

While more advanced teams will often see no point of such prioritization and be content with the traditional story point or priority column approach, this can be a great help for new Agile practitioners.

One thing to note though, is that while the MoSCoW technique is usually used only once or a couple of times during the project, for Agile teams this will be different. To accommodate the changing circumstances and planning the right work for each iteration, the technique should be used whenever the priorities switch. Since that could become quite burdensome, the teams should make a note of reviewing their priority columns every time they plan a new iteration.

Would you consider MoSCoW as part of your Agile routine?

Related Posts

7 tips for managing remote teams, iatf compliance for automotive industry, planning your project tasks: should you use scrum, kanban, or scrumban, seele – eylean customer story.

Type above and press Enter to search. Press Esc to cancel.

  • We believe in     Simple, Dependable,    Affordable & The Hurdle Sawmill can easily add profit to any size operation.

slidebg1

  • Welcome to     Perfect Simplicity We've spent thousands of hours perfecting our simple machinery designs ... and we continue this process every day

slidebg1

Ready To Go

Customizable, permanent or portable, planning to production in 4 easy steps, plan your mill.

What material length(s) will you be cutting? Select the mill that will accomodate your longest length.

Configure Mill

Choose mill options to customize your mill.

Order your Mill

For a typical mill, it takes about 2 weeks for assembly.

Start Production

Arrange mill shipping. Buy drive motor, air compressor, sawblade, and sawdust removal system. Roll mill in and setup. Start production!

Need a fast mill?

How fast can you crank out ties? Rose's Sawmill in Savannah Tennessee reports cutting 1200 ties per shift (8 hour) running 2 Hurdle Sawmills.

We currently run four Hurdle mills, and they give us the versatility to cut cants, ties, grade, and feed our thin-kerf resaws. Durable, well constructed, and affordable with very high resale value, Hurdle has been a big part of our success for the last 25 years. You could spend 4 or 5 million dollars building a mill to square logs for a resaw, but why? Hurdle is the MOST cost-effective headsaw, no other sawmill can produce like this and keep total capital investment this low! That's why we've been running Hurdle sawmills since the mid-80's.
I started sawing with a homemade sawmill, owned several other brands, but after we purchased the first new Hurdle Mobile Mill to operate on location, I was sold. When the time came to set up stationary at our current location the decision was simple. Hurdle. Never thought twice about it. Our Hurdle Mills are fast, dependable and the service has been outstanding, plus the Hurdle 3 Head Block mill allows us to cut a mixture of grade lumber, cross ties, cants - whatever the market dictates.
We've run Hurdle sawmills for more than 30 years, matter of fact, we owned one of the very first mills Hurdle ever built. We currently own seven, with six in production. Five are 2HB tie mills and one is a 3HB mill for cutting 16' cypress lumber. Our five tie mills are producing 7-8000 cross ties per week. That's a lot of ties! The Hurdle's heavy-duty log turner, dogs, and setworks are what keep us running day in day out, and that is why we'll keep running Hurdle mills for another 30 years.
"Our family has run six Hurdle Mills since 1993. They've always been low maintenance and easy to run. Fact is any mill that's slingin' 650 - 850 cross ties per day is a pretty darn good mill. After nineteen years running Hurdle Mills, the one thing I question is how they're going to live up to their motto of "Always Trying to Better the Best". I just don't see how they're gonna make 'em any better"

Hulry

How I Finally Made Sense of Todoist’s Priority Levels

Rahul Chowdhury

By Rahul Chowdhury

Updated May 23rd, 2022

I’ve been using Todoist as my primary to-do list app for years.

And during this time, one aspect of the app that I’ve always struggled to understand are the priority levels — P1, P2, etc.

While adding a task or organising it for the day, everything seems like a P1 or P2.

The P4 marker didn’t even feel like a priority level as it didn’t cause any visual change on the task.

I came across a prioritisation technique where everything seemed to fall into its place. I started prioritising my tasks better.

In this post, I’ll talk about how I efficiently prioritise my tasks in Todoist and how you can follow my technique to make an achievable to-do list every day.

Let’s start by:

Understanding the priority problem

When everything is a priority, nothing is.

Therefore, marking all tasks in my to-do list with either P1 or P2 made it challenging to identify which task to pick next.

Should I pick the first P1 task, or should I randomly select one from the list?

Have a look at this to-do list:

Too many tasks with a P1 priority in Todoist.

It isn’t easy to decide which task to pick from this list at the start of the day.

And that often led to procrastinating on what task to work on rather than working on a task.

The priorities were all jumbled up.

Here’s the problem:

I was prioritising my tasks based on how important the task felt while adding it.

Individually, all tasks might feel like a top priority.

Writing an article? Yeah, that’s a P1.

Read books? Ooh, that’s a P1 too. It’s essential to keep learning.

Dropping the car at a service centre? That seems like a P1. How would I travel in a broken car?

When you compare these tasks, you might end up with something like this:

Tasks with sorted priorities in Todoist.

Now, this example was of a brief to-do list.

Often, I would end up with multiple high-priority tasks that made comparison and sorting difficult.

And even worse:

I was adding more tasks than I could handle on a given day.

Here’s an example:

custom rake tasks

While comparing tasks helped me assign a more suitable priority marker to each task, I didn’t factor in a crucial component — time.

What’s important to get done today ?

My to-do lists were for a single day. And yet, I added tasks like it’s for a week.

Maybe, because I was under the impression that I could tick everything off my list like a madman.

Thankfully:

I came across a technique that seemed like the perfect antidote to my problem.

Introducing:

The MoSCoW technique of prioritisation

The MoSCoW method stands for Must, Should, Could, and Would.

Here’s what that means:

  • Must . Tasks that you need to get done today. These either have a deadline for today or are tasks that matter to you or your business. Examples: Write a draft for an article, renew health insurance, send emails to potential sponsors.
  • Should . Tasks that you should get done today, but it’s okay if they spill over to the next day or later. Examples: Schedule posts for social media accounts, vacuum the apartment, book an Airbnb.
  • Could . Tasks that you could do today if you have the time. It’s okay for them to spill over to the next day or later. Examples: Plan the next trip, collect highlights from a book into a note, organise my workspace, shop for new clothes.
  • Would . Tasks that are part of your wishlist, but you don’t necessarily have to do them. Examples: Read the latest issue of a magazine, add a cool feature to your website or app, enrol in another online course.

Simple segregation, isn’t it?

Did you notice how time is factored into this method?

All four task categories are relative to the current day. Or tomorrow, if you plan your to-do list the day before.

Time is limited.

And when you understand the limits of your available time, it’s easy to prune your to-do list into a compact and achievable list.

This is important because no matter how productive we think ourselves to be, we only get around 4–6 focused hours in a day.

Trying to fit a hundred tasks into that tiny segment of our day is what makes us procrastinate and ultimately feel stressed.

This technique might seem similar to the popular Eisenhower matrix , and it is. Still, I find this method to be a tad better.

Here’s why:

It’s easier to understand what I “must” do today than understanding which task falls into my prioritisation grid’s first or second quadrant.

So, mesmerised by this simple yet effective technique, I decided to apply this concept to Todoist.

And here’s:

How I applied the MoSCoW method to Todoist

Usually, for this sort of segregation, Todoist labels do a fantastic job.

I wanted to have as little friction as possible while adding a task and organising them.

And typing out labels while adding a task is an ordeal.

I needed my tasks to be sorted according to their priority. Using labels to indicate priorities wouldn’t help.

Then I realised:

Todoist’s priority levels seemed to fit the bill in every way I could imagine.

It’s easy to mark a task priority, and Todoist sorts tasks based on priority automatically.

So, here’s how I translated the MoSCoW concept into Todoist priorities:

  • Should → P2

Maybe this is how the team at Doist originally intended the priorities to be used, but it started to make sense to me at this moment.

The priority level colours represent the urgency appropriately:

Todoist's priority level colours become cooler as priority decreases.

Whenever I add a task to my list or organise an existing task, I think about MoSCoW while assigning tasks a priority.

Is this task necessary to be done today? Yes? Then it’s a P1.

Important, but doesn’t have a deadline for today? It’s a P2 task.

And then everything else mainly falls into P3. I don’t even bother adding tasks to my “Today” list that I consider as P4.

Tasks sorted following the MoSCoW prioritisation technique.

Overall, I aim to have only 1–2 tasks in a day that are P1.

Because life’s unpredictable, and you only get a small number of hours where you can sit down and get work done.

Having too many P1 tasks on your list will only set you up for failure right from the start of the day.

Budget your P1 tasks like you would budget your money .

Now, here’s an important thing to remember:

MoSCoW is not Todoist-only

The MoSCoW method is a generic concept that can be applied to any to-do list app or even a hand-written to-do list.

As long as you can sort your task list based on priority, you can apply this prioritisation method to any medium or app.

And for Todoist users :

I hope this technique will help you sensibly use Todoist’s priority levels.

It did for me.

Subscribe for more like this →

Be 1% better every week

Join 3,889 others & continue your Thriving journey with more articles like this one and hand-picked:

  • Keyboard Shortcuts

.

More on this topic

We Need Sagan’s Standard to Thrive in this Modern Era

How to navigate past misinformation traps, and make well-informed decisions.

10 min read

Anticipating Regret Led To Quitting My Job

Regret is a powerful tool. Here's how it led to one of the milestone moments of my life.

How I’m Using iOS Focus Modes to Reduce Daily Distractions

This powerful system feature is what you need to keep your workspace in Zen mode.

11 min read

eHARDHAT

  • Flooring Moscow  

Andy's Custom Wood Floors

4955 Lenville Rd - Moscow ID 83843

Moscow, ID 83843

Phone: 208-882-**** 208-882-823658 (click to view the number)

Flooring Inspiration

custom rake tasks

About the Company

The professionalism of Andy's Custom Wood Floorss floor installers can complete any property. You're going to obtain the best home improvement care achievable when you have a flooring consultant. Households in Moscow have benefited tremendously through flooring tasks by Andy's Custom Wood Floors. Andy's Custom Wood Floors may complete each of your requirements when it comes to flooring and improve your property's appearance. The skilled and knowledgeable community of technicians at this agency thoroughly featuring reliability you can count on. The firm's surface area pros can efficiently serve individuals close by their office at 4955 Lenville Rd, in Moscow. The talented specialists of this crew could make any dream household a reality. If you're organizing a renovation, remember to select floor installers. A full set of all their company's products and services may be obtained at their firm's site. The aesthetics of properties around Moscow have been improved by flooring solutions. Andy's Custom Wood Floors's floor installers are driven to have your home upgrade be as helpful as possible. Skilled floor installers of Andy's Custom Wood Floors will accomplish your home remodeling. Getting your pesky flooring project addressed is going to render your household more stunning than before.

Your Andy's Custom Wood Floors Moscow, ID Flooring Pros

The work of this business is undoubtedly the best quality outcomes around. With solutions emphasizing flooring being performed around your residence, you are certain to get the greatest deal. Moscow home renovating is simplified utilizing the expertise of the organization's authorities in flooring assignments. Each specialist from Andy's Custom Wood Floors name the Moscow community home. In Moscow, residents would expect a household upgrade to be superb provided they employ professionals who are skilled in floor installers. Boost your household renovation assignment by using flooring technicians at Andy's Custom Wood Floors. To acquire the finest accomplishable outcome on your house remodel, you will need a proficient flooring technician. When individuals use Andy's Custom Wood Floors floor installers to they will be confident that they're going to be content about the outcome. Andy's Custom Wood Floors's professional floor installers are required to see a top notch residence update. Depend upon the knowledgeable floor installers at Andy's Custom Wood Floors to make your property beautiful. Get in contact with Andy's Custom Wood Floors client assistance in Moscow, ID at 2088823658 for your estimate, cost free! So what is their strength? Their company focuses on: projects requiring experts to .

custom rake tasks

Additional Information

Services Offered:
Are we a residential contractor? YES
Are we a commercial contractor? YES
Do we offer financing? NO
Do we have emergency service? YES
Do we accept credit cards? NO

Additional Company Information

Andy's Custom Wood Floors - Floor Installers in Moscow, Idaho.

Hours Please call to confirm

MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY SUNDAY
8:00am - 6:00pm 8:00am - 6:00pm 8:00am - 6:00pm 8:00am - 6:00pm 8:00am - 6:00pm Closed Closed

What is your rating of this business?

custom rake tasks

Sign in with

or Pick a name

Be the first to review this business.

Request Free Quotes

Nearby contractors, about ehardhat.

eHARDHAT helps homeowners find great contractors for home improvement projects. To get started, browse the best Moscow Floor Installers , read reviews, find detailed contractor information on individual Floor Installers in Moscow and request free project estimates.

Moscow flooring prices

Finding accurate service costs before planning a remodeling project is important for keeping the overall project costs down. Are you looking to install wood floors in Moscow soon? Find accurate Moscow hardwood flooring installation costs right now.

Knowing accurate remodeling costs upfront can help you negotiate more effectively with trade professionals and vendors and gauge whether their projects quotes are fair, as compared to your local market costs to install wood floors in Moscow .

We work hard to help you make confident decisions regarding which home products and services to purchase, as well as help you identify trustworthy local Moscow hardwood flooring installation contractors. Our goal is to make sure you are able to have quality work completed at a fair price and on time.

Other Contractors in Moscow, Idaho

  • Heating contractor Moscow
  • Moscow painters
  • Moscow plumber
  • Moscow air conditioner repair
  • Moscow handyman
  • Carpenters Moscow
  • Roofing contractor Moscow
  • Electrical contractors Moscow
  • Moscow kitchen remodeling
  • Moscow home remodeling
  • Landscaper Moscow
  • Moscow bathroom remodeling
  • View other categories

Find Idaho Contractors

  • Flooring contractors Boise
  • Flooring contractors Idaho Falls
  • Flooring Meridian
  • Flooring contractors Twin Falls
  • Caldwell flooring contractor
  • Pocatello flooring contractor
  • Flooring contractors Lewiston
  • Nampa flooring contractor
  • Coeur d\'Alene flooring
  • Flooring Lewiston Orchards
  • eHARDHAT on Google+
  • eHARDHAT on Facebook
  • Twitter @eHARDHAT
  • LinkedIn Profile
  • Homeowners Blog

View Top Contractors

custom rake tasks

Help your friends find the best local contractors, like our page!

custom rake tasks

No thanks , I’m just looking.

  • Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
  • Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand
  • OverflowAI GenAI features for Teams
  • OverflowAPI Train & fine-tune LLMs
  • Labs The future of collective knowledge sharing
  • About the company Visit the blog

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Get early access and see previews of new features.

How can I add a custom rake task to my engine?

I am writing an engine and I want to include a task in it. I wrote my file .rake, bus it isn't listed with rake --task. If I try to run int anyway I get:

❯ rake what2find:index rake aborted! Don't know how to build task 'what2find:index' (See the list of available tasks with rake -T -A ) (See full trace by running task with --trace)

I don't understand why.

lib/tasks/what2find/index.rake

My gem's directory structure is:

And my application's directory:

Someone can say me what I'm doing wrong?

Thanks, in advance!

  • ruby-on-rails
  • ruby-on-rails-5
  • rails-engines

pcha's user avatar

  • Will this help you? –  spike 王建 Commented Nov 4, 2020 at 2:02
  • Thank you very much for you reply. Unfortunately it don't solve totally my problem. I tried the post suggerences and now I get the task listed if i run task -T from my engine folder. but if I want to run the task from my application the task isn't listed with any of the raised options. –  pcha Commented Nov 5, 2020 at 2:06
  • Could you post your directory structure here? –  spike 王建 Commented Nov 5, 2020 at 2:08
  • Sure! I'll update in the question. –  pcha Commented Nov 6, 2020 at 12:03

Know someone who can answer? Share a link to this question via email , Twitter , or Facebook .

Your answer.

Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more

Sign up or log in

Post as a guest.

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy .

Browse other questions tagged ruby-on-rails ruby ruby-on-rails-5 rails-engines rake-task or ask your own question .

  • Featured on Meta
  • We spent a sprint addressing your requests — here’s how it went
  • Upcoming initiatives on Stack Overflow and across the Stack Exchange network...
  • The [lib] tag is being burninated
  • What makes a homepage useful for logged-in users

Hot Network Questions

  • Signature of Rav Ovadia Hedaya
  • Translation of the two lines of Latin in Shakespear's Venus and Adonis
  • Subscripts in fractions on an exponent look terrible
  • Attaching foam to the bottom of a PCB
  • Will the 3D effect change shockwave angle/strength?
  • Eye rig not rotating properly
  • Why is QR considered a problem for disc rotor alignment and not rim brake alignment?
  • ARK: Survival Ascended keeps crashing with LowLevelFatalError (error DXGI_ERROR_DEVICE_REMOVED with Reason: DXGI_ERROR_DEVICE_HUNG)
  • Can a big mass defect make the mass negative?
  • How to fix the Regresshion fix in ubuntu 22 server
  • Busy Beaver argument and Gödel's incompleteness theorem
  • How can one apply to graduate school if their undergraduate university is uncooperative in providing the required information?
  • Prove that two multivariate polynomials that are equal at every point over the reals are identical as formal polynomials
  • Offline, multi-machine, 2-factor authentication information vault?
  • Recommend an essay, article, entry, author, or branch of philosophy that addresses the futility of arguing for or against free will
  • How to POSIX-ly ignore "warning: command substitution: ignored null byte in input"?
  • Real-life problems involving solving triangles
  • How is 11:22 four minutes slow if it's actually 11:29?
  • Unable to execute arara (a TeX automation tool) from the Terminal
  • How do Japanese kept up with the current loanwords
  • What Does Feynman Mean When He Says Amplitude and Probabilities?
  • Can I convert 50 amp electric oven circuit to subpanel, and power oven plus water heater, plus maybe a car charger?
  • A manifold whose tangent space is a sum of line bundles and higher rank vector bundles
  • What is the correlation between Brownian noise's low frequency components and the actual movement of particles?

custom rake tasks

IMAGES

  1. Writing Custom Rake Tasks. Namespacing, Modules, and Meta Tasks

    custom rake tasks

  2. How to Write a Custom Rake Task

    custom rake tasks

  3. How to Write a Custom Rake Task

    custom rake tasks

  4. Ruby on Rails 5.x Custom Rake Tasks with Progress Interface

    custom rake tasks

  5. Rails: Rake Tasks

    custom rake tasks

  6. Let’s Rake It Up With Our Own RakeTasks in Ruby

    custom rake tasks

VIDEO

  1. BEST & EASIEST Way to Rake Leaves #diy Part 2 🤣

  2. Best working day #979 Homemade rake for excavator

  3. Vermeer rotatry hay rake

  4. Episode #365

  5. Rake Shutter Install

  6. Mastering Yard Work: Transform Your Overland Machete into a Rake

COMMENTS

  1. Writing Custom Rake Tasks

    These default rake tasks are automatically bundled with your rails install, but you can also write custom rake commands to automate any task of your choosing. Creating Our Rake File. Your custom ...

  2. How to Write a Custom Rake Task

    This task finds all of the models in your application and creates CSV files for you to fill in seed data. First let's look at the task, then we'll break it down. lib/tasks/db.rake. namespace :db do. namespace :seed do. desc "Create CSV Files for Models". task :create_files => :environment do.

  3. The Rails Command Line

    Custom rake tasks have a .rake extension and are placed in Rails.root/lib/tasks. You can create these custom rake tasks with the bin/rails generate task command. desc "I am short, but comprehensive description for my cool task" task task_name: [ :prerequisite_task , :another_task_we_depend_on ] do # All your magic here # Any valid Ruby code is ...

  4. Customizing Rails rake tasks

    To override a task, clear the current behavior and re-define it in Rakefile. The example below will override the default rake to invoke our custom task. # Rakefile # frozen_string_literal: true require_relative "config/application" Rails.application.load_tasks Rake::Task["default"].clear task :default do Rake::Task["custom:do_it"].invoke end.

  5. #66 Custom Rake Tasks

    Rake is one of those tools that you don't realize how powerful it is until you start using it. In this episode you will learn how to create custom rake tasks and improve them by using rake features. desc "Pick a random user as the winner". task :winner => :environment do. puts "Winner: #{pick(User).name}" end.

  6. Ruby on Rails Tutorial: Understanding Rake and Task Automation

    To create custom Rake tasks, you'll need to work with the Rakefile. This file, usually located in your Rails application's root directory, is where you define and organize your tasks. If your application doesn't have a Rakefile, you can create one. 3.2. Defining Tasks. Defining a task in Rake is straightforward.

  7. How to Use Rake to Manage Tasks in Rails

    To create a custom rake task, you need to create a file with the extension .rake inside the lib/tasks directory of your Rails application. The naming convention for Rake files is namespace_taskname.rake. Let's create a custom rake task to display a "Hello, Rails!" message. Create a new file called hello.rake inside the lib/tasks directory and ...

  8. Custom Rake Tasks

    1. As a rails developer, you are familiar with rake tasks. The rails frameworks ships with some already baked in rake tasks to make life easier for you such as rake db:migrate, rake db:rollback ...

  9. Run Rake tasks

    Rake is a popular task runner for Ruby and Rails applications. For example, Rails provides the predefined Rake tasks for creating databases, running migrations, and performing tests. You can also create custom tasks to automate specific actions - run code analysis tools, backup databases, and so on.. RubyMine provides a convenient way to run, debug, and reload Rake tasks.

  10. How to pass command line arguments to a rake task

    The ways to pass argument are correct in above answer. However to run rake task with arguments, there is a small technicality involved in newer version of rails. It will work with rake "namespace:taskname ['argument1']" Note the Inverted quotes in running the task from command line.

  11. The Rails Command Line

    2.10 Custom Rake Tasks. Custom rake tasks have a .rake extension and are placed in Rails.root/lib/tasks. You can create these custom rake tasks with the bin/rails generate task command. desc "I am short, but comprehensive description for my cool task" task task_name: [:prerequisite_task, :another_task_we_depend_on] do # All your magic here ...

  12. The Rails Command Line

    2.10 Custom Rake Tasks. Custom rake tasks have a .rake extension and are placed in Rails.root/lib/tasks. desc "I am short, but comprehensive description for my cool task" task task_name: [:prerequisite_task, :another_task_we_depend_on] do # All your magic here # Any valid Ruby code is allowed end

  13. Building a Custom Rake Task

    Rake. We've all used it. We've all used it, but if you are like me it is one of those magic wand tools. Just use it and all the leaves in your yard are gone! Err. . . wrong rake. Just type in a…

  14. How to create custom rake tasks with multiple arguments?

    You can easily produce a script that would be invoked with: thor config:load -i 5 -o "now". Use Rake's argument system, where you would pass arguments in the form. rails config:load[5,now] Build your own script, placed in bin. For example, bin/config can accept arbitrary arguments, and be invoked however you like.

  15. Using MoSCoW in Agile to Prioritize Better

    A prioritization technique called MoSCoW brings great help and clarity in such cases. First used with Dynamic Systems Development Method, MoSCoW is a technique developed by Dai Clegg. The sole purpose of this prioritization approach is to help understand the importance that the stakeholders put on each of the features and requirements they pose.

  16. Hurdle Machine Works, Inc.| Home

    About Us. Since 1969, Hurdle Machine Works, Inc. has been designing and manufacturing simple, dependable, and affordable equipment for the wood products industry including complete portable circle sawmills, complete band sawmills, setshaft carriages, linear carriages, log decks, log turners, edgers, band resaw systems, and sawmill setworks.

  17. How I Finally Made Sense of Todoist's Priority Levels

    Then I realised: Todoist's priority levels seemed to fit the bill in every way I could imagine. It's easy to mark a task priority, and Todoist sorts tasks based on priority automatically. So, here's how I translated the MoSCoW concept into Todoist priorities: Must → P1. Should → P2.

  18. ruby

    You can run Rake tasks from your shell by running: rake task_name. To run from from Ruby (e.g., in the Rails console or another Rake task): Rake::Task['task_name'].invoke. To run multiple tasks in the same namespace with a single task, create the following new task in your namespace: task :runall => [:iqmedier, :euroads, :mikkelsen, :orville ...

  19. Andy's Custom Wood Floors

    Households in Moscow have benefited tremendously through flooring tasks by Andy's Custom Wood Floors. Andy's Custom Wood Floors may complete each of your requirements when it comes to flooring and improve your property's appearance. The skilled and knowledgeable community of technicians at this agency thoroughly featuring reliability you can ...

  20. The Rails Command Line

    Custom rake tasks have a .rake extension and are placed in Rails.root/lib/tasks. You can create these custom rake tasks with the rails generate task command. desc "I am short, but comprehensive description for my cool task" task task_name: [:prerequisite_task, :another_task_we_depend_on] do # All your magic here # Any valid Ruby code is allowed ...

  21. How can I add a custom rake task to my engine?

    1. I am writing an engine and I want to include a task in it. I wrote my file .rake, bus it isn't listed with rake --task. If I try to run int anyway I get: rake what2find:index. rake aborted! Don't know how to build task 'what2find:index' (See the list of available tasks with rake -T -A) (See full trace by running task with --trace) I don't ...