Skip to content

Commit

Permalink
Stop using deprecated API:s, add LICENSE, add tests, formatting and more
Browse files Browse the repository at this point in the history
  • Loading branch information
EriKWDev committed Jul 20, 2021
1 parent abd48f5 commit 3889ef5
Show file tree
Hide file tree
Showing 16 changed files with 139 additions and 456 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
nimassets
example

build
tests/assetfile.nim
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.0] - 2021-07-20

### Added

- This changelog
- The MIT LICENSE file that was mentioned in the .nimble file
- A simple test inside the tests directory
- Nimble tasks that will be executed before `nimble test` to generate the assetfile to be tested.

### Changed

- The generated assetfile now uses the `[]=` operator instead of `.add` for registering assets in the internal table since `.add` for tables has been deprecated since Nim 1.4
- Examples now live inside the `examples` directory
- The binary will now be built using the -d:release flag

## [0.1.0] - 2018

- Initial Release
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018-2021 Ahmed T. Youssef

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ nimassets `Nim Assets` is heavily inspired by [go-bindata](https://github.com/jt

## Usage
```bash
nimassets 0.1.0 (Bundle your assets into nim file)
nimassets 0.2.0 (Bundle your assets into nim file)
-h | --help : show help
-v | --version : show version
-o | --output : output filename
Expand All @@ -14,8 +14,9 @@ nimassets 0.1.0 (Bundle your assets into nim file)

### Bundle

To bundle all the files in directory `templatesdir` into single nim file `assetsfile.nim`
To bundle all the files in directory `templatesdir` from the `examples` folder into single nim file `assetsfile.nim`
```bash
cd examples
nimassets -d=templatesdir -o=assetsfile.nim
```

Expand All @@ -25,7 +26,12 @@ nimassets -d=templatesdir -o=assetsfile.nim

### Use Assets
```
import assetsfile
import assetsfile # name from -o=<filename>
echo assetsfile.getAsset("templatesdir/index.html")
```
```

### Development
To run tests, simply do `nimble test` from the root of this repository.

To compile the distributable binary, run `nimble assetsBin`. It will be built and available in `./build/nimassets`.
197 changes: 0 additions & 197 deletions assetsfile.nim

This file was deleted.

Loading

0 comments on commit 3889ef5

Please sign in to comment.