moonglum / exogenesis

Build your dotfile installer, updater and teardown
MIT License
19 stars 8 forks source link

Exogenesis DSL #16

Open moonglum opened 11 years ago

moonglum commented 11 years ago

@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?

klaustopher commented 11 years ago

Like it :+1: