https://github.com/initdc/embed.cr
Embed file or dir to your project.
https://github.com/initdc/embed.cr
Last synced: about 1 month ago
JSON representation
Embed file or dir to your project.
- Host: GitHub
- URL: https://github.com/initdc/embed.cr
- Owner: initdc
- License: mpl-2.0
- Created: 2025-12-30T10:05:06.000Z (6 months ago)
- Default Branch: dev
- Last Pushed: 2025-12-30T20:10:33.000Z (6 months ago)
- Last Synced: 2026-01-03T06:38:54.799Z (6 months ago)
- Language: Crystal
- Size: 12.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# embed
Embed file or dir to your project.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
embed:
github: initdc/embed.cr
```
2. Run `shards install`
## Usage
```crystal
require "embed"
posix = Path::Kind.native == Path::Kind::POSIX
file = posix ? "#{__DIR__}/testdata/testfile" : "#{__DIR__}\\testdata\\testfile"
dir = posix ? "#{__DIR__}/testdata" : "#{__DIR__}\\testdata"
pattern = posix ? "#{__DIR__}/testdata/.*" : "#{__DIR__}\\testdata\\.*"
Embed.embed_file(file)
p Embed.file(file)
Embed.embed_dir(dir)
p Embed.dir(file)
Embed.embed_glob(pattern)
p Embed.glob(file)
```
## Development
TODO: Write development instructions here
## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [initdc](https://github.com/initdc) - creator and maintainer