embed.cr
embed
Embed file or dir to your project.
Installation
-
Add the dependency to your
shard.yml:dependencies: embed: github: initdc/embed.cr -
Run
shards install
Usage
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
- Fork it (https://github.com/initdc/embed/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- initdc - creator and maintainer
Repository
embed.cr
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- 18 days ago
- December 30, 2025
License
Mozilla Public License 2.0
Links
Synced at
Sat, 17 Jan 2026 05:55:43 GMT
Languages