Skip to content

Commit

Permalink
some bugfixes and updates to README
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkdoor committed Apr 27, 2012
1 parent ff7d199 commit 24ef896
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Fakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ Fake tasks: {
sh: ("rm", "-rf", Directory list: "**/*.fyc") verbose: true
}
}
}
}
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,31 @@ To see a list of general options use the help command:
$ fake --help
```

## Specifying dependencies

You can specify dependencies via the `depends` option, like so:

```fancy
Fake tasks: {
task_a: {
desc: "This task shall be run before task_b"
run: {
"Running task a" println
}
}
task_b: {
desc: "This tasks depends on task_a"
depends: 'task_a # pass an array of task names if you depend on more than one task
run: {
"Running task b" println
}
}
}
```

When no task is specified the `default` task will be run (as with Rake).

## Note:

This is still in the making. More features coming soon, but defining
Expand Down
4 changes: 3 additions & 1 deletion lib/fake/cli.fy
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class Fake CLI {
Fake read_fakefile

@tasks each: |t| {
Fake tasks[t to_sym] . run
if: (Fake tasks[t to_sym]) then: @{ run } else: {
System abort: "Task '#{t}' not defined. Aborting."
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/fake/task.fy
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Fake {
}

def run {
@dependencies map: |d| { Fake tasks[d to_sym] } . each: @{ run }
@dependencies to_a map: |d| { Fake tasks[d to_sym] } . each: @{ run }

unless: ran? do: {
@block call_with_receiver: self
Expand Down

0 comments on commit 24ef896

Please sign in to comment.