exogenesis icon indicating copy to clipboard operation
exogenesis copied to clipboard

Exogenesis DSL

Open moonglum opened this issue 11 years ago • 1 comments

@klaustopher suggested that instead of classes, exogenesis "adapters" could be written with a DSL. I thought about it this weekend, and I think that this can be nicely combined with the methods of the executor. So for example this is the translation of the install task from Vundle.

# Define the Vundle Adapter
Exogenesis.describe :vundle do

  # Describe the install task
  install do
    execute_interactive "Install", "vim +BundleInstall\! +qall"
    execute_interactive "Clean", "vim +BundleClean\! +qall"
  end
end

In this case the setup task would automatically call start_section with :vundle as its argument. But a task like execute would still need to take a block with Ruby code to check for certain things to skip the task.

What do you think?

moonglum avatar Apr 08 '13 09:04 moonglum

Like it :+1:

klaustopher avatar Apr 08 '13 13:04 klaustopher