File Exchange

image thumbnail

GHToolbox

version 1.0.20 (14.8 KB) by DataJoint Bot
'ghtb' provides a simple way to manage addon installation of open-source MATLAB Community Toolboxes linked to GitHub (via Releases).

41 Downloads

Updated 05 Nov 2020

From GitHub

View license on GitHub

INSTALL(target, varargin)
Description:
Provides a way to directly 'install' MATLAB Community Toolboxes from
Github. For upgrade and downgrade use-cases, users can set the `override` option to
force the install.
Inputs:
target[required]: (string) Toolbox repo (e.g. 'org1/repo1') or local path to *.mltbx
version[optional, default='latest']: (string||handle) Version to be installed e.g.
'1.0.0' or version handle of the form @(v) that
resolves to acceptable versions. Handle approach
should expect v to be a cell array of version
candidates and return a logical array of result.
override[optional, default=false]: (boolean) Flag to indicate if should override an
existing install
Assumptions:
- Community Toolbox linked on FileExchange to GitHub via GitHub Releases.
- Community Toolbox publicly available as open-source on GitHub.
- Community Toolbox attaches a single '.mltbx' artifact to GitHub Releases.
- Community Toolbox name matches the filename of '.mltbx' artifact.
- Users do not wish to have multiple simultaneous versions installed i.e. only a
single version per Toolbox is installed at any given time.
Examples:
ghtb.install('guzman-raphael/compareVersions')
ghtb.install('guzman-raphael/compareVersions', 'version', '1.0.7')
ghtb.install('guzman-raphael/compareVersions', 'version', '1.0.6', 'override', true)
ghtb.install('guzman-raphael/compareVersions', 'version', ...
@(v) cellfun(@(x) contains(x, '1.0.'), v, 'uni', true))
ghtb.install('compareVersions.mltbx') %install from local toolbox file

UNINSTALL(varargin)
Description:
Provides a way to directly 'uninstall' MATLAB Community Toolboxes from
Github.
Inputs:
toolboxName[required]: (string) Toolbox name to be uninstalled e.g. 'toolbox1'
Assumptions:
- Users do not wish to have multiple simultaneous versions installed i.e. all
versions of specified toolbox are uninstalled (if applicable).
Examples:
ghtb.uninstall('compareVersions') % uninstalls all versions of Toolbox

REQUIRE(requiredToolboxes, varargin)
Description:
Provides a way to directly require specific toolboxes with the option to 'install' if
not satisfied. Unsatisfied toolboxes with trigger a
'GHToolbox:requireToolboxes:Failed' error.
Inputs:
requiredToolboxes[required]: (cell) Toolboxes to be required and (if applicable)
resolved with installation. Each cell should contain a
struct with fields: Name[required, string],
ResolveTarget[required, string],
Version[optional, string||handle]. For Version
specification, see below for examples or
see help(ghtb.install) for accepted Version assignment.
prompt[optional, default=true]: (boolean) Whether to silently install or use prompts.
resolveGHToolboxDeps[optional, default=true]: (boolean) Resolve dependencies related
to GHToolbox.
Examples:
requiredToolboxes = {...
struct(...
'Name', 'GHToolbox', ...
'ResolveTarget', 'datajoint/GHToolbox'...
), ...
struct(...
'Name', 'compareVersions', ...
'ResolveTarget', 'guzman-raphael/compareVersions', ...
'Version', '1.0.8'...
), ...
struct(...
'Name', 'mym', ...
'ResolveTarget', 'datajoint/mym', ...
'Version', @(v) cellfun(@(x) contains(x, '2.7.'), v, 'uni', true)...
)...
};
ghtb.require(requiredToolboxes) % require with prompts
ghtb.require(requiredToolboxes, 'prompt', false)

PACKAGE(toolboxName, toolboxAuthor, toolboxContact, toolboxSummary, ...
toolboxDescription, toolboxExclusions, toolboxVersionHandle, ...
toolboxRootFiles, varargin)
Description:
Provides a programatic way to 'package' MATLAB Community Toolboxes.
Inputs:
toolboxName[required]: (string) Toolbox name, will create as '{{toolboxName}}.mltbx'.
toolboxAuthor[required]: (string) Toolbox author full name.
toolboxContact[required]: (string) Toolbox author email.
toolboxSummary[required]: (string) Toolbox summary. Limit to 140 characters.
toolboxDescription[required]: (string) Toolbox long description.
toolboxExclusions[required]: (cell) Filepaths to exclude. Based from
'toolboxRootDir'.
toolboxVersionHandle[required]: (handle) Function that

Cite As

DataJoint Bot (2021). GHToolbox (https://github.com/datajoint/GHToolbox/releases/tag/v1.0.20), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2016b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.