specl: save path to spec file in `specl.specpath`.

* lib/specl/std.lua (std.package, std.io.catfile): Copied from
 stdlib.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
specl: clean up intercepted require, load, etc.

* lib/specl/std.lua (split): Just like upstream stdlib, but much
easier to understand :)
* lib/specl.lua (run): Remove env.specl, which corrupts the
example block environment unnecessarily.
(core): Store intercepted functions as upvalues here instead.
(initenv): Adjust load, loadfile and loadstring interception to
use upvalues from core table.
(sidefx): Map module name to table of leaked global symbols that
will need to be copied into the example block environment during
initialisation.
(initenv): Rewrite `env.require` interceptor to capture leaked
globals in sidefx on first call, and to copy references into the
example block environment on subsequent interceptions.  Remove
all the cruft that copied everything into the global environment,
and reran core `require` unnecessarily.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
std: new package methods to simplify path strings management.

* lib/specl/std.lua (table.invert): Import from upstream stdlib.
(io.basename, io.dirname, package.find, package.insert)
(package.normalize, package.remove): New `package.dirsep` and
`package.pathsep` aware functions for path string management.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
std: add and use std.package.mappath to simplify initenv().

* lib/specl/std.lua (mappath): New api to call a function with
each segment of a package.path sep delimited path string.
* lib/specl.lua (initenv): Use it.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
specl: autoload spec_helper from spec directory.

* lib/specl/loader.lua: Require specl.std for new path apis.
(Parser): Use preamble to add current specfile directory to
front of the package.path, and to autoload spec_helper.lua if
present.
* specs/spec_helper.lua: Add ./lib/?.lua to the front of the
package.path.
* specs/custom_formatters_spec.yaml, specs/matchers_spec.yaml,
specs/shell_spec.yaml, specs/specl_spec.yaml,
specs/formatter/report_spec.yaml: Remove specl.shell and
spec_helper require statements.
* specs/specs.mk (SPECL_ENV): Add $(srcdir)/lib/?.lua to package.
path for VPATH builds.
($(SPECL)): Remove.  No need to build a LUA_PATH setting wrapper
script now that specl, with a bit of help from spec_helper in the
common case, and from SPECL_ENV in VPATH builds.
(SPECL): Point directly to bin/specl.
(SPECL_ENV): Set SPECL in the environment for subprocess tests.
* specs/spec_helper.lua, specs/formatter/spec_helper.lua (SPECL):
Prefer SPECL setting from os environment, so that Make can pass
the path in VPATH builds.
* .gitignore: Remove specs/specl.
* doc/specl.md (Separating Helper Functions): Update.
* NEWS: Update.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
specl: autoload all spec-files when no FILES are passed.

* lib/specl/util.lua (files): New function, recursively collect
all non-directory files below a given root into a table.
* lib/main.lua: Use it to find all spec-files below `specs/` when
no FILEs are passed.
Update optparse help spec.
* specs/spec_helper.lua, specs/formatter/spec_helper.lua: Pass an
explicit '-' to specl subprocesses to force reading example input
from stdin.
* doc/spec.md (Command Line): Update.
* NEWS: Update.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>