{"id":19032498,"url":"https://github.com/creadone/baked_file_system","last_synced_at":"2026-06-05T16:32:08.944Z","repository":{"id":70234128,"uuid":"288336045","full_name":"creadone/baked_file_system","owner":"creadone","description":null,"archived":false,"fork":false,"pushed_at":"2021-02-26T02:18:31.000Z","size":106,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-02T04:27:16.406Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/creadone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-18T02:35:09.000Z","updated_at":"2023-03-05T00:55:52.000Z","dependencies_parsed_at":"2023-06-14T21:45:23.123Z","dependency_job_id":null,"html_url":"https://github.com/creadone/baked_file_system","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creadone%2Fbaked_file_system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creadone%2Fbaked_file_system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creadone%2Fbaked_file_system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creadone%2Fbaked_file_system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creadone","download_url":"https://codeload.github.com/creadone/baked_file_system/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240082651,"owners_count":19745259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T21:29:02.126Z","updated_at":"2026-05-03T16:30:18.059Z","avatar_url":"https://github.com/creadone.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Baked File System\n\n[![Build Status](https://travis-ci.org/schovi/baked_file_system.svg?branch=master)](https://travis-ci.org/schovi/baked_file_system)\n\nInclude (bake them) static files into a binary at compile time and access them anytime you need.\n\n## Installation\n\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  baked_file_system:\n    github: schovi/baked_file_system\n    version: 0.9.8\n```\n\n## Usage\n\nA custom type that extends `BakedFileSystem` is used as a file system. The macro `bake_folder` bakes all files in\na given path into the virtual file system. Both relative and absolute paths are supported, as well as baking multiple\nfolders.\n\n```crystal\nrequire \"baked_file_system\"\n\nclass FileStorage\n  extend BakedFileSystem\n\n  bake_folder \"/home/my_name/work/crystal_project/public\"\n  bake_folder \"../public\"\nend\n\n```\n\nFiles can be loaded using `get` and `get?` class methods.\n\n```crystal\nfile = FileStorage.get(\"path/to/file.png\")\n\nfile.gets_to_end  # returns content of file\nfile.path         # returns path of file\nfile.size         # returns size of original file\n```\n\nWhen try to get missing file, `get` raises a `BakedFileSystem::NoSuchFileError` exception\nwhile `get?` returns `nil`.\n\n```crystal\nbegin\n  FileStorage.get \"missing/file\"\nrescue BakedFileSystem::NoSuchFileError\n  puts \"File #{path} is missing\"\nend\n\nFileStorage.get? \"missing/file\" # =\u003e nil\n```\n\n## Development\n\nTODO: Write development instructions here\n\n## Contributing\n\n1. Fork it ( https://github.com/schovi/baked_file_system/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request\n\n## Contributors\n\n- [schovi](https://github.com/schovi) David Schovanec - creator, maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreadone%2Fbaked_file_system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreadone%2Fbaked_file_system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreadone%2Fbaked_file_system/lists"}