Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Just The Job is a way to easily write Cake tasks.

Let's look at an example:

require('just-the-job') ->
	@job 'say-hi', 'echo hi there'

	@task 'my-job', ['say-hi'], (after) ->
		console.log 'just doing my job'
		after()

The example creates both a job and a cake task. The only difference is that tasks show up in the usage when 'cake' is run alone.

They share the same syntax:

@job 'name', «'description',» «['depends-on-these', ...]», run

where «arg» indicates an optional argument.

The description becomes part of cake's usage string. The dependencies are an unordered set of jobs that must be run before this one. If run is a String, the job is a console command. If run is a Function, it should be written in continuation-passing style; the job to be performed after it is passed in as the argument. (See the example.)

These are instance methods; just-the-job drops you into a JustTheJob object which contains all of your jobs (so, calling just-the-job twice produces two separate job sets). It also has these methods:

  • @getRunner name, <<after>> Produces a continuation-passing function to run the job (and its dependencies). If after is present, the function calls it at the end.

  • @do name, <<after>> Runs the result of @getRunner.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages