infochimps-labs/ironfan — pull request #310 by joshbronson (2013-09-27 18:57:10+00:00)
Title: REALM discovery aids cleanup

Realms now have access to a cluster_suffix helper that can be used as
follows.

```
Ironfan.realm(:p1) do
# declaration
cluster(:control)

# implementation
cluster(cluster_suffix(:control)) do
# ...
end
end
```

cluster_suffix(suffix) always returns suffix: it is the identity
function with a twist. The twist is that it will ensure that the
cluster exists within the realm. This is to ward off typos.

In addition, components now have access to a cluster_name helper that
can be used as follows.

```
Ironfan.realm(:p1) do
# declaration
cluster(:control)

# implementation
cluster(cluster_prefix(:control)) do
facet(:nfs) do
# ...
nfs_server
# ...
end

facet(:zabbix) do
# ...
nfs_client{ of cluster_name(:control) }
# ...
end
end
end
```

In this case, in addition to ensuring that the :control cluster exists
within this realm, cluster_name(:control) returns the full name of the
cluster: :p1_control.

I've discovered that this style is preferable to using method calls (e.g., cluster_name.control).