vereis / erlpkg Goto Github PK
View Code? Open in Web Editor NEWEscript builder supporting additional options + Escript utilities & Erlang boilerplate
Escript builder supporting additional options + Escript utilities & Erlang boilerplate
Pkgutils is implemented in such a way that the exposed functions change based on whether or not it is currently being run from inside of an Erlpkg.
This is because originally I believed this to be the best way of allowing IO dependent unit testing to be tested but this isn't the case.
Instead I suggest that all calls to pkgutil functions which reflect upon the calling Erlpkg instead are implemented as follows:
%% EXISTING CODE:
-spec pkg_extract_file(file:filename_all()) -> file:filename_all().
-spec pkg_extract_file(file:filename_all(), file:name_all()) -> file:filename_all().
%% PROPOSED CHANGE:
-spec pkg_extract_file(zip:handle(), file:filename_all()) -> file:filename_all().
-spec pkg_extract_file(zip:handle(), file:filename_all(), file:name_all()) -> file:filename_all().
%% and implement a new pkg_extract/1 and pkg_extract/2 which looks like
pkg_extract_file(FileName) ->
pkg_extract(pkg_open(), FileName, pkg_tmp_dir()).
pkg_extract_file(FileName, ExtractDir) ->
pkg_extract(pkg_open(), FileName, ExtractDir).
-endif.
This will allow us to unit test pkgutils as it will be able to operate on external erlpkgs instead of being limited to reflecting upon the running erlpkg.
These changes will only be changes to internal functions since the exposed interface will stay the same unless for some reason this seems like something pkgutils should be able to do?
Proposed function changes:
[pkg_extract/0,
pkg_extract/1,
pkg_extract_file/1,
pkg_extract_file/2,
pkg_extract_dir/1,
pkg_extract_dir/2,
pkg_reflect/0,
pkg_reflect/1].
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.