Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8164053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:13:22+00:00 2026-06-06T19:13:22+00:00

Is there a way to create a simple guard watch? I want to run

  • 0

Is there a way to create a simple guard watch? I want to run a rake task when a file changes in a specific directory and going through all of these steps is too much for this one off task. https://github.com/guard/guard/wiki/Create-a-guard

I tried adding this in the Guardfile but it doesn’t work.

guard :doc do
  watch(%r{^documentation})                       { "rake doc:build" }
end

watch("/documentation")                       { "rake doc:build" }

So do you know of a simple way to run a rake task when a file is updated with guard?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:13:25+00:00Added an answer on June 6, 2026 at 7:13 pm

    The most straightforward way is to use guard-rake to run a Rake task on a file modification.

    A more generic solution is to use guard-shell to run any command line tool on a file modification.

    More complex use cases should be solved by creating your own guard plugin. You don’t even need to create a gem, since you can simply define them as inline guard as Avdi shows us in his a Guardfile for Redis blog post.

    When you want to share your Guard, just have a look at more advanced Guard plugins like guard-rspec or guard-jasmine as examples.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a simple way to create a valid icalendar file for a single
Is there a way to create simple unit tests for SQL queries in SSMS?
Is there any simple way to create instance of modal DialogBox with single text
Is there a way to create a StringBuilder from a byte[] ? I want
What's the easiest way to create a simple HTTP server with Java? Are there
Is there a way to use css or jquery to create a simple border
is there a way to create a standalone executable from a simple lua scripts?
Is there a way to create a query that will run for exactly ten
Is there any way to create a simple timeline of events with Google Charts?
Is there any simple way to create a GUI using OpenCV library or linking

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.