ruby - Command for running a rails task -


What if I want to run a directory under test.rb in the following directory:

  lib / tasks / lib / data / test.rb  

To add a rack function you need to create a .rake file instead of the .rb file in the lib / functions directory.

  lib / tasks / sample_task.rake  

or in your case

  lib / tasks / lib / data / test.rake  

using rack function namespace Example: Test.rake file

  # namespace declaration name location: sample # Task Details Details "sample work" # sample_task is the work name here Sample_task :: Environment # Do your work 5.times Do | T | "Hello World" & End 

Now run your work with the rake sample: sample_task where sample name is the declaration of the name and sample_task is the name of the work

If you If you are using Rail 2 then you can use the runner to run your tasks like

  script / runner sample_task  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -