thoughtbot / cocaine

A small library for doing (command) lines.
https://robots.thoughtbot.com
Other
785 stars 55 forks source link

Add options for each runner. #51

Closed nifarius closed 10 years ago

nifarius commented 11 years ago

Some runners like PosixRunner, ProcessRunner, PopenRunner supported specific options for their spawn method. It solves a specific problem such as setup chdir for executing command.

For example command line

cd some_path && zip -X0r file.epub mimetype META-INF OEBPS

can be runned as

line = Cocaine::CommandLine.new("zip", "-X0r file.epub mimetype META-INF OEBPS", runner_options: {chdir: "some_path"})
line.run
jyurek commented 11 years ago

This is good, but I can't help but think it would be better if the environment and options were rolled into one options hash.

jyurek commented 10 years ago

I got over my objection above and pulled this in. Thanks!