{"id":21201667,"url":"https://github.com/oleander/unpack","last_synced_at":"2025-07-10T06:31:47.721Z","repository":{"id":1356286,"uuid":"1304063","full_name":"oleander/Unpack","owner":"oleander","description":"An automated unpacking tool for *nix, using Ruby","archived":false,"fork":false,"pushed_at":"2011-02-07T01:32:44.000Z","size":320,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-30T12:28:31.112Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/oleander/Unpack","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oleander.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-01-28T20:13:56.000Z","updated_at":"2022-04-07T19:06:48.000Z","dependencies_parsed_at":"2022-08-16T13:10:53.840Z","dependency_job_id":null,"html_url":"https://github.com/oleander/Unpack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oleander/Unpack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2FUnpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2FUnpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2FUnpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2FUnpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oleander","download_url":"https://codeload.github.com/oleander/Unpack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2FUnpack/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264538581,"owners_count":23624436,"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-20T20:10:24.773Z","updated_at":"2025-07-10T06:31:47.409Z","avatar_url":"https://github.com/oleander.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unpack*(er)* - *run files, run*\n\n## What is Unpack?\n\nUnpack makes it possible to unarchive rar and zip files using ruby.\n\nYou pass a directory and it will find all your archive files, unpack and remove them (if you want to).\n\n## So how do I use it?\n\n### Start by installing the gem\n\n    sudo gem install unpack\n\nStart `irb` and include the gem, `require 'unpack'`\n\n## Working with a directory\n\n### Unpack everything in the current directory\n\n    $ Unpack.runner!\n    =\u003e [#\u003cContainer:0x000001010ab458 @files=[\"dmd-tsa-cd2.avi\"], @directory=\"/Downloads/Some.Super.Movie/CD2\"\u003e]\n\n### Unpack everything in another directory\n\n    $ Unpack.runner!('/some/dir')\n    =\u003e [#\u003cContainer:0x000001010ab458 @files=[\"some_files.mov\"], @directory=\"/some/dir\"\u003e]\n\n### Unpack and delete archived file\n\n    $ Unpack.runner!('.', remove: true)\n    =\u003e [#\u003cContainer:0x000001010ab458 @files=[\"dmd-tsa-cd2.avi\"], @directory=\"/Downloads/Some.Super.Movie/CD2\"\u003e]\n    $ Unpack.runner!('.', remove: true)\n    =\u003e []\n\n### Remove every archive file, even if nothing where unpacked\n\n    $ Unpack.runner!('.', remove: true, force_remove: true)\n    =\u003e []\n    \n### Unpack all archived file, but not deeper 3 folders down\n    \n    $ Unpack.runner!('.', depth: 3)\n    =\u003e [#\u003cContainer:0x000001010ab458 @files=[\"dmd-tsa-cd2.avi\"], @directory=\"/Downloads/Some.Super.Movie/CD2\"\u003e]\n\n### Unpack everything, even one file directories\n\nTo prevent you from unarchive files in folders that contains subtitles and other nonrelevant files, the folder must contain 5 archive files or more.\n\nIf you want to unpack everything, even subtitles directories, then you will have to specify the `min_files` option.\n\n    $ Unpack.runner!('.', min_files: 0)\n    =\u003e [#\u003cContainer:0x000001010ab458 @files=[\"english.str\"], @directory=\"/Downloads/Subtitle/\"\u003e]\n    \n## Working with one specific file\n\n### Unpack a file\n    \n    $ Unpack.it!(file: 'zip/my_file.zip')\n    =\u003e [#\u003cContainer:0x000001010ab458 @files=[\"file1\", \"file2\"], @directory=\"/Downloads/my/files/zip\"\u003e]\n    \n### Unpack a specific file, removing it when done \n    \n    $ Unpack.it!(file: 'zip/my_file.zip', remove: true)\n    =\u003e [#\u003cContainer:0x000001010ab458 @files=[\"file1\", \"file2\"], @directory=\"/Downloads/my/files/zip\"\u003e]\n    \n### Unpack a specific file and move the new files to a destination directory\n    \n    $ Unpack.it!(file: 'zip/my_file.zip', to: '/tmp')\n    =\u003e [#\u003cContainer:0x000001010ab458 @files=[\"file1\", \"file2\"], @directory=\"/tmp\"\u003e]\n\n## Some configure alternatives\n\n### The *runner!* method\n\n- ** :min_files ** (Integer) The minimum amount of files in the directory you want to archive the files in. *Default is 5*.\n- ** :depth ** (Integer) The maximum folder depth. *Default is 2*.\n- ** :debugger ** (Boolean) Prints some debug output into the console. *Default is false*.\n- ** :force_remove ** (Boolean) Remove rarfiles, even if no files where unarchived. *Default is false*. **To get this to work you also have to set the `remove` option to true**.\n- ** :remove ** (Boolean) Removes archived files after they have been used. *Default is false*.\n- ** :absolute_path_to_unrar ** (String) The absolut path to the unrar binary. *Default is the [unrar](http://homepage.mac.com/pnoriega/unrar.html) binary that comes with the gem*.\n\n### The *it!* method\n\n- **:to** (String) The absolute or relative path to the destination directory. If nothing is defined, the *:file* path will be used.\n- **:file** (String) The absolute or relative path to the archive file.\n- **:remove** (Boolean) See the *runner!* method above\n- **:absolute_path_to_unrar** (String) See the *runner!* method above\n- **:debugger** (String) See the *runner!* method above\n\n## What is being returned?\n\nThe `runner!` method returns an `Array` of `Container` instances. \nThe `it!` method returns an instance of `Container`. \n\nThese are the accessors of the `Container` class.\n\n- **files** (String) The absolut path to the files that where unarchived.\n- **directory** (String) The absolut path to the folder containing the files.\n\n## This sounds supr, how do I help?\n\n- Start by copying the project or make your own branch.\n- Navigate to the root path of the project and run `bundle`.\n- Start by running all tests using rspec, `autotest`.\n- Implement your own code, write some tests, commit and do a pull request.\n\n## Requirements\n\nThe gem is tested in OS X 10.6.6 using Ruby 1.9.2 and 1.8.7.\n\n## Thanks to ...\n\n- the [UnRarX](http://homepage.mac.com/pnoriega/unrar.html) team that provies the unrar binary.\n- [NinoScript](https://github.com/NinoScript) that solved the console-escaping issue - [see this commit](https://github.com/oleander/Unpack/commit/dd7e46200a490c7af9fc5f770127291192a818f5).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleander%2Funpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foleander%2Funpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleander%2Funpack/lists"}