1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
* Steeplejack
A generic scaffolding system.
** About
#+begin_quote
A steeplejack is a craftsman who scales buildings, chimneys, and
church steeples to carry out repairs or maintenance.
Steeplejacks erect ladders on church spires, industrial chimneys,
cooling towers, bell towers, clock towers, or any other high
structure.
#+end_quote
Like a steeplejack, ~steeplejack~ is a diligent worker that can erect
scaffolding for any project you need.
** Usage
~steeplejack~ can be taught how to erect scaffolding by setting the
=STEEPLEJACK_DIR= (defaults to ~~/.steeplejack~)environment variable and
putting template directories there. A template directory contains a
~_scaffold.yml~ and various ~.erb~ files. ~_scaffold.yml~ should at least
contain a =params= or =parameters= property. It should be a list of
property names. Each parameter will be read when the scaffold is
erected. ~_scaffold.yml~ can also contain an =erb_options= parameter
that, when present, is used to set the =trim_mode= for ERB. See the [[https://docs.ruby-lang.org/en/master/ERB.html][ERB
documentation]] for details.
When the scaffold is erected, each ~.erb~ file in the scaffold’s
directory is evaluated, and the output is written to the corresponding
file in the target directory. For example, let’s take a scaffold
directory ~scaf~. We will deploy it to ~targ~. Let’s say that ~scaf~ has
three files in it:
+ ~scaf/_scaffold.yml~
+ ~scaf/a.erb~
+ ~scaf/b.erb~
Let’s also say that ~_scaffold.yml~ contains the text
#+begin_src yaml
properties:
- foo
- bar
#+end_src
When deploying ~scaf~ to ~targ~, you will be prompted for =foo= and =bar=.
Then ~scaf/a.erb~ and ~scaf/b.erb~ will be evaluated, and the results
written to ~targ/a~ and ~targ/b~.
** Configuration
When ~steeplejack~ starts up, it loads ~$STEEPLEJACK_DIR/init.rb~. The
most notable thing to have ~init.rb~ is ~add_alias~. An example:
#+begin_src ruby
add_alias sc: :scaffold,
ls: :list,
i: :info
#+end_src
Note that ~add_alias~ is not the same as ~alias~. ~alias~ is a built-in
Ruby feature, whereas ~add_alias~ is ~steeplejack~-specific; using ~alias~
will not make the alias available as a ~steeplejack~ subcommand.
** License
~steeplejack~ is published under the [[http://gnu.org/licenses/gpl-3.0.html][GPLv3]] (or any later version).
|