Skip to content

Commit

Permalink
util: don't expose presence of luaposix directly.
Browse files Browse the repository at this point in the history
* lib/specl/util.lua (have_posix): Remove from export table.
* lib/specl/main.lua (have_posix): Remove import from specl.util.
(process_args): We've already diagnosed likely cause of empty
file list, no need to do it again here.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
  • Loading branch information
gvvaughan committed Apr 3, 2016
1 parent add1f0d commit c7e2c71
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions TODO.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ TODO:
[[implied -> before: module = require "module"]]
- report line numbers of pending and failed examples:
it is quite likely libyaml will need patching to make this happen
- add an lfs implementation of util.files if luaposix is not loadable
10 changes: 3 additions & 7 deletions lib/specl/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ local object, optparse = std.object, std.optparse
local map = std.functional.map
local slurp = std.io.slurp
local clone, merge = std.table.clone, std.table.merge
local deepcopy, files, gettimeofday, have_posix =
util.deepcopy, util.files, util.gettimeofday, util.have_posix
local deepcopy, files, gettimeofday =
util.deepcopy, util.files, util.gettimeofday
local optspec = version.optspec


Expand Down Expand Up @@ -80,11 +80,7 @@ end
-- Process files and line filters specified on the command-line.
local function process_args (self, parser)
if #self.arg == 0 then
if have_posix then
return parser:opterr "could not find spec files in './specs/'"
else
return parser:opterr "install luaposix to autoload spec files from './specs/'"
end
return parser:opterr "could not find spec files in './specs/'"
end

for i, v in ipairs (self.arg) do
Expand Down
1 change: 0 additions & 1 deletion lib/specl/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ local M = {
examplename = examplename,
files = files,
gettimeofday = gettimeofday,
have_posix = have_posix,
indent = indent,
nop = nop,
strip1st = strip1st,
Expand Down

0 comments on commit c7e2c71

Please sign in to comment.