-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# download_stb_rb(URL) | ||
# download_stb_rb(github_user, repository, file) | ||
|
||
| Parameter | Class | | ||
| --- | --- | | ||
| URL | String | | ||
| github_user | String | | ||
| repository | String | | ||
| file | String | | ||
|
||
`download_stb_rb` downloads a single file from a github repository to your project folder. This function can have two forms. If the first argument is a URL of a specific Github file, the other parameters can be omitted. | ||
Otherwise, if all three parameters are provided, the first parameter must be a github user name, then a repository name and finally a file path. | ||
|
||
This function can help facilitate the integration of external code files. Open Source Software (OSS) contributors are encouraged to create libraries that all fit in one file (lowering the barrier to entry for adoption). | ||
|
||
## Example | ||
|
||
```ruby | ||
def tick args | ||
end | ||
|
||
# option 1: | ||
# source code will be downloaded from the specified GitHub url, and saved locally with a | ||
# predefined folder convension. | ||
$gtk.download_stb_rb "https://github.com/xenobrain/ruby_vectormath/blob/main/vectormath_2d.rb" | ||
|
||
# option 2: | ||
# source code will be downloaded from the specified GitHub username, repository, and file. | ||
# code will be saved locally with a predefined folder convension. | ||
$gtk.download_stb_rb "xenobrain", "ruby_vectormath", "vectormath_2d.rb" | ||
``` | ||
|
||
## Related Functions | ||
|
||
[download_stb_raw](download_stb_raw.md) |