Hi Grant,
This is an attempt to augment the current functionality of Org mode
so that we can use documentes authored with Org mode in Emacs
and execute then in other environments with Ruby as the only dependency.
I was mostly motivated because in the Ruby world there
are tools like Chef or Puppet used to define idempotent runs
of the setup from a server.
execute 'bundle install' do
cwd '/myapp'
not_if 'bundle check'
end
As you can see we are defining two commands, the command to run
and one more command to check whether the first command should be run.
What I have implemented so far is that you could for example express
this in Org mode using literate programming as well:
#+name: bundle-check
#+begin_src sh :dir /myapp
bundle check
#+end_src
#+name: bundle-install
#+begin_src sh :dir /myapp :unless bundle-check
bundle install
#+end_src
Here the second code block will only run if the first code block has a non-zero exit status,
meaning that the action has not been done yet, because the exit status of each code block is being tracked.
You can take a look at some of the examples here
for some of the other use cases where I was thinking that this would be useful:
Here is a more complex example of what is possible to do:
Thanks,
- Wally