This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""HTTPie wrapper for a specific API | |
This is an example wrapper script that turns having to call httpie like this: | |
$ http http://some-cool-api.com/api/v1/some/endpoint X-API-KEY:my-api-key | |
Into this: | |
$ some-cool-api /some/endpoint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Rex -base; | |
use feature qw(say); | |
task "call_me_with_do_task" => sub { | |
say 'inside task: "call_me_with_do_task"'; | |
}; | |
before_task_start "call_me_with_do_task" => sub { | |
say 'inside before_task_start hook for task: "call_me_with_do_task"'; | |
}; | |
after_task_finished "call_me_with_do_task" => sub { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Rex -base; | |
use Rex::Transaction; | |
task "test" => sub { | |
# This never gets called because Rex::Transaction::transaction() empties out the @ROLLBACKS array | |
# see here: | |
# grep -A1 "Cleaning ROLLBACKS array" lib/Rex/Transaction.pm | |
# | |
on_rollback { |