# `Rho.Tools.DynCopy`
[🔗](https://github.com/GenericJam/rho/blob/v0.1.0/lib/rho/tools/dyn_copy.ex#L1)

Core tool: copy a staged Dyn source file to a new path under a new module
name (see `Rho.Tools.DynTool`).

It exists for speed. Starting a screen from a library widget by retyping
it costs a whole file of output tokens; a copy costs one call, and the
reply is the new file numbered as `dyn_read` shows it, so the next step
is `dyn_edit` straight away.

The rename is textual: every whole occurrence of the file's first
module's full name, `Old` and `Old.Sub` alike, becomes the new one. A
name that merely starts with it (`OldOther`) is left alone.

# `module_for`

```elixir
@spec module_for(String.t()) :: String.t()
```

The module name for a staged path: `screens/date_slider.ex` is
`Dyn.Screens.DateSlider` (in the namespace, `Rho.Dyn.Config`).

# `rename`

```elixir
@spec rename(String.t(), String.t(), String.t()) :: String.t()
```

`source` with every whole occurrence of module name `old` (alone, before
`.`, or root-qualified as `Elixir.<old>`) replaced by `new`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
