{"id":18038862,"url":"https://github.com/discourse/mini_tarball","last_synced_at":"2026-03-04T21:32:22.903Z","repository":{"id":54085870,"uuid":"340407226","full_name":"discourse/mini_tarball","owner":"discourse","description":"A minimal implementation of the GNU Tar format in Ruby","archived":false,"fork":false,"pushed_at":"2026-01-30T22:29:15.000Z","size":114,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":20,"default_branch":"main","last_synced_at":"2026-01-31T07:57:10.810Z","etag":null,"topics":["ruby","rubygem","tar"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":false,"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/discourse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-02-19T15:16:04.000Z","updated_at":"2026-01-26T19:11:27.000Z","dependencies_parsed_at":"2022-08-13T06:40:15.172Z","dependency_job_id":null,"html_url":"https://github.com/discourse/mini_tarball","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/discourse/mini_tarball","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fmini_tarball","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fmini_tarball/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fmini_tarball/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fmini_tarball/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/discourse","download_url":"https://codeload.github.com/discourse/mini_tarball/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fmini_tarball/sbom","scorecard":{"id":344645,"data":{"date":"2025-08-11","repo":{"name":"github.com/discourse/mini_tarball","commit":"afb30af81d4362b171f9bf2f849fa2ab67513066"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.4,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":6,"reason":"Found 3/5 approved changesets -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/discourse/mini_tarball/main.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/discourse/mini_tarball/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/discourse/mini_tarball/main.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/discourse/mini_tarball/main.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T06:45:40.818Z","repository_id":54085870,"created_at":"2025-08-18T06:45:40.818Z","updated_at":"2025-08-18T06:45:40.818Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30093799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T20:42:30.420Z","status":"ssl_error","status_checked_at":"2026-03-04T20:42:30.057Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ruby","rubygem","tar"],"created_at":"2024-10-30T14:06:47.799Z","updated_at":"2026-03-04T21:32:22.883Z","avatar_url":"https://github.com/discourse.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MiniTarball\n\nThis is a **minimal** implementation of the [GNU Tar format](https://www.gnu.org/software/tar/manual/html_chapter/tar_15.html) in Ruby.\n\n#### 👍 Supported features\n* Writing tar files\n* Adding files with\n  * unlimited file size\n  * unlimited file name length\n* Unicode file names\n* Works with streams, so there's no need to waste disk space by creating temporary files\n\n#### 👎 Currently not supported features\n* Reading tar files\n* Adding hardlinks, symlinks or directories\n* Other features of GNU tar like sparse files\n* Creating POSIX.1-2001 (pax) archives or any other tar format\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n``` ruby\ngem 'mini_tarball'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install mini_tarball\n\n## Usage\n\n### Create a `MiniTarball::Writer`\nThere are multiple ways for creating a `MiniTarball::Writer`:\n\n1. Use an existing IO-like stream.\n   ``` ruby\n   io =  File.open(archive_path, \"wb\")\n   MiniTarball::Writer.use(io) do |writer|\n     # add files by calling writer.add_file or writer.add_file_from_stream\n   end\n   ```\n\n2. Create a new file by supplying a file name.\n   ``` ruby\n   MiniTarball::Writer.create(filename) do |writer|\n     # add files by calling writer.add_file or writer.add_file_from_stream\n   end\n   ```\n\n3. Create it manually. You need to close the writer when you are done in order finalize the tar file.\n   ``` ruby\n   writer = MiniTarball::Writer.new(io)\n   # add files by calling writer.add_file or writer.add_file_from_stream\n   writer.close\n   ```\n\n### Add files\n\nYou can add existing files as well as write a stream into the tar file.\n\n#### Add existing files\nYou can add existing files by calling `MiniTarball::Writer#add_file`. The required `name` argument can be a file name or a complete path.\n\n``` ruby\nwriter.add_file(name: \"file1.txt\", source_file_path: \"/home/foo/file1.txt\")\n```\n\nBy default the file's attributes are stored in the tar file, but you can override them by supplying values for the optional arguments (`mode`, `uname`, `gname`, `uid`, `gid`, `mtime`) to `MiniTarball::Writer#add_file`.\n\n#### Add files from a stream\nYou can add files of unknown size by calling `MiniTarball::Writer#add_file_from_stream`. The required `name` argument can be a file name or a complete path.\n\n\u003e 💡 This method doesn't work with non-seekable streams like `Zlib::GzipWriter`.\n\nHere are some examples:\n\n* Use IO.copy_stream to efficiently copy a stream into the tar\n   ``` ruby\n   File.open(\"/home/foo/file1.txt\", \"rb\") do |input_stream|\n     writer.add_file_from_stream(name: \"file1.txt\") do |output_stream|\n       IO.copy_stream(input_stream, output_stream)\n     end\n   end\n   ```\n\n* Directly write into the output stream\n   ``` ruby\n   writer.add_file_from_stream(name: \"foo/bar/file2.txt\") do |output_stream|\n     output_stream.write(\"Hello world!\")\n   end\n   ```\n\n`MiniTarball::Writer#add_file_from_stream` has multiple optional arguments:\n\n|Argument|Default|Description|\n|:---|:---|:---|\n|mode|`0644`|Permission and mode bits|\n|uname|`\"nobody\"`|User name of file owner|\n|gname|`\"nogroup\"`|Group name of file owner|\n|uid|`nil`|User ID of file owner|\n|gid|`nil`|Group ID of file owner|\n|mtime|`Time.now.utc`|Modification time|\n\n#### Add placeholder\nPlaceholders allow you to reserve space for a file within the tar. That's quite useful when you want to store a file at the beginning of the archive, but don't know the file content until you have added other files to the archive.\n\nYou don't need to know the exact size of the file when you add the placeholder. The writer will fill unused space with ␀ characters if the actual file is smaller than the reserved `file_size`. Adding a file that is larger than `file_size` will raise `MiniTarball::WriteOutOfRangeError`.\n\n``` ruby\nplaceholder1 = writer.add_file_placeholder(name: \"file1.txt\", file_size: 3925)\nplaceholder2 = writer.add_file_placeholder(name: \"file2.txt\", file_size: 1950)\n# add more files...\n\n# fill placeholder 1\nwriter.with_placeholder(placeholder1) do |w|\n  w.add_file(name: \"file1.txt\", source_file_path: \"/home/foo/file1.txt\")\nend\n\n# fill placeholder 2\nwriter.with_placeholder(placeholder2) do |w|\n  File.open(\"/home/foo/file9.txt\", \"rb\") do |input_stream|\n    w.add_file_from_stream(name: \"file9.txt\") do |output_stream|\n      IO.copy_stream(input_stream, output_stream)\n    end\n  end\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\n\nTo release a new version, update the version number in `version.rb`, and then push it to GitHub. This will automatically create a tag and publish the gem on [rubygems.org](https://rubygems.org).\n\nOn MacOS you need to run `brew install gnu-tar`, otherwise some specs will fail.\n\n### RubyCritic\n\nYou can run `SimpleCov` and `RubyCritic` by executing the following:\n\n```\nCOVERAGE=1 rake spec \u0026\u0026 rubycritic --no-browser\n```\n\n## Contributing\n\nPull requests are welcome on GitHub at https://github.com/discourse/mini_tarball.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscourse%2Fmini_tarball","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscourse%2Fmini_tarball","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscourse%2Fmini_tarball/lists"}