baked_file_system
Version, currently master branch4 versions
- 0.11.2latestOct 6, 2026
- 0.11.1Sep 24, 2026
- 0.11.0Sep 23, 2026
- master branchJan 20, 2026
github.com/ralsina/baked_file_system
Virtual File System for Crystal language. Embedding your assets into final binary.
Installation
# Add this to your shard.yml
dependencies:
baked_file_system:
github: ralsina/baked_file_system
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 0.35.0- License
- MIT
- Author
- David Schovanec
Dependencies
This version declares no dependencies.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
Baked File System
Include (bake them) static files into a binary at compile time and access them anytime you need.
About this fork
This is a maintained fork of schovi/baked_file_system.
It exists because of a disagreement about hidden ("dot") paths: upstream rejects
any path with a hidden component, which silently drops every file when the
source folder itself lives under a hidden directory — for example
src/.static/ or ~/.config/myapp/assets.
Behavior in this fork:
- Baking from a source folder located under a hidden directory works.
- Dotfiles and dot-directory contents inside the baked folder are still
skipped (
.htaccess,.well-known/...), becauseDir.globdoes not match hidden entries by default. This matches upstream behavior.
To use this fork instead of upstream, add this to your application's shard.yml:
dependencies:
baked_file_system:
github: ralsina/baked_file_system
Releases are tagged on this fork (starting at v0.11.0).
Installation
Add this to your application's shard.yml:
dependencies:
baked_file_system:
github: schovi/baked_file_system
version: 0.10.0
Usage
A custom type that extends BakedFileSystem is used as a file system. The macro bake_folder bakes all files in
a given path into the virtual file system. Both relative and absolute paths are supported, as well as baking multiple
folders.
require "baked_file_system"
class FileStorage
extend BakedFileSystem
bake_folder "/home/my_name/work/crystal_project/public"
bake_folder "../public"
end
Files can be loaded using get and get? class methods.
file = FileStorage.get("path/to/file.png")
file.gets_to_end # returns content of file
file.path # returns path of file
file.size # returns size of original file
When try to get missing file, get raises a BakedFileSystem::NoSuchFileError exception
while get? returns nil.
begin
FileStorage.get "missing/file"
rescue BakedFileSystem::NoSuchFileError
puts "File #{path} is missing"
end
FileStorage.get? "missing/file" # => nil
Development
TODO: Write development instructions here
Contributing
- Fork it ( https://github.com/schovi/baked_file_system/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
- schovi David Schovanec
- straight-shoota Johannes Müller
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Jan 20, 2026
- Crystal
>= 0.35.0- Indexed
- yes
Dependents
Repository
github.com/ralsina/baked_file_system
Metadata
- Created
- Aug 16, 2026
- Updated
- Oct 13, 2026
- Synced
- Oct 13, 2026
- Versions
- 4