Comparing version 11.8.0 to 11.9.0
@@ -56,2 +56,7 @@ (function() { | ||
}); | ||
props.def_oneoff(this, 'temp', { | ||
enumerable: true | ||
}, function() { | ||
return require('./temp'); | ||
}); | ||
return void 0; | ||
@@ -58,0 +63,0 @@ } |
{ | ||
"name": "guy", | ||
"version": "11.8.0", | ||
"version": "11.9.0", | ||
"description": "npm dependencies checker", | ||
@@ -27,3 +27,4 @@ "main": "lib/main.js", | ||
"acorn-walk": "^8.2.0", | ||
"astring": "^1.8.3" | ||
"astring": "^1.8.3", | ||
"temp": "^0.9.4" | ||
}, | ||
@@ -34,3 +35,4 @@ "peerDependencies": { | ||
"acorn-walk": "^8.2.0", | ||
"astring": "^1.8.3" | ||
"astring": "^1.8.3", | ||
"temp": "^0.9.4" | ||
}, | ||
@@ -37,0 +39,0 @@ "scripts": { |
@@ -506,3 +506,52 @@ | ||
#### `GUY.temp` | ||
`GUY.temp` provides context handlers to work with temporary files and directories. It is built on top of | ||
[`temp`](https://github.com/bruce/node-temp). | ||
`GUY.temp.with_file: ( cfg, handler ) ->` | ||
`GUY.temp.with_directory: ( cfg, handler ) ->` | ||
```coffee | ||
#----------------------------------------------------------------------------------------------------------- | ||
@GUY_temp_context_handler_file = ( T, done ) -> | ||
GUY = require '../../../apps/guy' | ||
#......................................................................................................... | ||
do => | ||
path = null | ||
info = GUY.temp.with_file ({ path: mypath, fd, }) -> | ||
path = mypath | ||
T?.ok isa.fs_file mypath | ||
T?.eq info, { files: 1, dirs: 0, } | ||
T?.ok not isa.fs_file path | ||
#......................................................................................................... | ||
return done?() | ||
#----------------------------------------------------------------------------------------------------------- | ||
@GUY_temp_context_handler_directory = ( T, done ) -> | ||
GUY = require '../../../apps/guy' | ||
#......................................................................................................... | ||
do => | ||
path = null | ||
info = GUY.temp.with_directory ({ path: mypath, }) -> | ||
path = mypath | ||
debug '^34534^', { path, } | ||
T?.ok isa.fs_directory mypath | ||
T?.eq info, { files: 0, dirs: 1, } | ||
T?.ok not isa.fs_directory path | ||
#......................................................................................................... | ||
do => | ||
path = null | ||
info = GUY.temp.with_directory { prefix: 'whatever-', }, ({ path: mypath, }) -> | ||
path = mypath | ||
debug '^34534^', { path, } | ||
T?.ok ( PATH.basename mypath ).startsWith 'whatever-' | ||
T?.ok isa.fs_directory mypath | ||
T?.eq info, { files: 0, dirs: 1, } | ||
T?.ok not isa.fs_directory path | ||
#......................................................................................................... | ||
return done?() | ||
``` | ||
## To Do | ||
@@ -653,2 +702,4 @@ | ||
* **[–]** integrate pinned package versions helper, cf `( require 'mixa/lib/check-package-versions' ) | ||
require '../pinned-package-versions.json'` | ||
@@ -655,0 +706,0 @@ ## Is Done |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
293002
48
2866
727
7
5