rakpak 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5bddb74dac931f5f6744b5a1c820c1f5452b3f938e3b3a1e928157926c40ce45
4
+ data.tar.gz: b4391576a37aa27785f58ddc5ed24237f6f346b67b252d9fb4537f2a1a122406
5
+ SHA512:
6
+ metadata.gz: 93794a7b3228f6b4064880ebdc637a12194c7eac375e27a5daa3b102dedbdf42fefc998ad9e8854fa22f0393e85c0e590757e1ef8ceb562655920ce4a6a721a6
7
+ data.tar.gz: '049724035061aa5da75235a1424cbc3927bd24e8738c01c85a4ee60810ffff738f9976a307424086eb41a04f7a804ff1bca0d06f79a73bbd9ae71085f30feabe'
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ryan Wilson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,135 @@
1
+ # rakpak
2
+
3
+ Tag files and folders anywhere on your filesystem, then archive them all at once.
4
+
5
+ You walk around, press `space` on anything you want, press `p`, answer a few
6
+ questions, and it builds the archive. The progress view can be sent to the
7
+ background while you keep browsing.
8
+
9
+ Needs Ruby 3.0 or newer and nothing else.
10
+
11
+ ## Install
12
+
13
+ ```
14
+ gem install rakpak
15
+ ```
16
+
17
+ Then `rakpak` from any folder. If your shell cannot find it afterwards, the
18
+ folder RubyGems puts executables in is not on your PATH; `gem env` shows it
19
+ under EXECUTABLE DIRECTORY.
20
+
21
+ Without RubyGems, clone this repo and run `./install.sh`. That copies the
22
+ program to `~/.local/share/rakpak` and puts a launcher in `~/.local/bin`,
23
+ adding that folder to your shell startup file if it is not on your PATH yet.
24
+ `./install.sh --link` runs straight from the checkout so edits take effect at
25
+ once, `--prefix /usr/local` installs system-wide, and `--uninstall` removes it.
26
+
27
+ ```
28
+ rakpak browse from your home folder
29
+ rakpak ~/Documents browse from there instead
30
+ rakpak . browse from the current folder
31
+ rakpak -p ~/Documents pack that folder: opens on the archive prompts
32
+ rakpak -p a.txt b/ c pack several things at once
33
+ ```
34
+
35
+ ## Starting up
36
+
37
+ With no arguments rakpak opens in your home folder: its contents in the
38
+ middle pane, the folder above it on the left, a preview of whatever is under
39
+ the cursor on the right. Give it a folder and it opens there instead.
40
+
41
+ `-p` (or `--pack`) skips the browsing. Every path you give is tagged, the
42
+ browser opens on the folder holding the first one with the cursor resting on
43
+ it, and the archive prompts appear at once, starting with the kind of archive
44
+ and its compression. The archive is written next to that first path. Press
45
+ `esc` on any prompt and you are back in the browser with the tags still set.
46
+
47
+ ## The flow
48
+
49
+ 1. **Browse and tag.** Vim keys or arrows. `space` tags whatever is under the
50
+ cursor and moves down. Tags persist as you walk, so you can pick something in
51
+ `~/Documents`, walk to `/etc`, and tag more. `T` reviews everything tagged.
52
+ `t` opens a queue pane on the far left that stays up while you browse. It
53
+ lists each queued item by name, where it lives, and its size, with the
54
+ running total on top.
55
+ 2. **`p` to pack.** Choose *compressed tarball* (the default), *plain
56
+ tarball*, or *zip archive*.
57
+ 3. **Set the flags.** Compression method, level, and the switches for that
58
+ format. Compressed tarballs default to gzip, the one every system can
59
+ read.
60
+ 4. **Say where.** This directory, your home directory, or one you type
61
+ into the field right there. `~`, `$HOME` and absolute paths all work,
62
+ and typing anything jumps to the field.
63
+ 5. **Name it.** The extension is added for you.
64
+ 6. **Confirm.** You see the exact command before anything runs. Only `enter`
65
+ starts it.
66
+ 7. **Watch it, or press `b`** to drop it into the background and keep browsing.
67
+
68
+ If nothing is tagged, `p` archives whatever the cursor is on.
69
+
70
+ ## Keys
71
+
72
+ | | |
73
+ |---|---|
74
+ | `j` `k` `↑` `↓` | move (wraps at either end) |
75
+ | `l` `→` `enter` | enter folder |
76
+ | `h` `←` | leave folder |
77
+ | `gg` `G` | top / bottom |
78
+ | `ctrl-d` `ctrl-u` | half page |
79
+ | `gh` `~` / `gr` | home / root |
80
+ | `space` | tag or untag, then move down |
81
+ | `a` / `d` | tag / untag everything in this folder |
82
+ | `D` | clear all tags |
83
+ | `T` | review tagged items (`space` removes) |
84
+ | `t` | show or hide the queue pane |
85
+ | `/` | filter this folder |
86
+ | `.` | show hidden files |
87
+ | `ctrl-r` | reload |
88
+ | `p` | pack: archive what is tagged |
89
+ | `b` | watch a running job |
90
+ | `?` | all keys |
91
+ | `q` | quit |
92
+
93
+ In the job view: `b` backgrounds it, `x` cancels, `esc` returns to the
94
+ browser, `q` quits.
95
+
96
+ ## Formats
97
+
98
+ Every run produces exactly one file.
99
+
100
+ **Compressed tarball**: `tar` piped through `gzip`, `zstd`, `xz`, `bzip2`,
101
+ `lz4` or `brotli`, giving `.tar.gz`, `.tar.zst` and so on. Each has a level,
102
+ and the tar switches (permissions, xattrs, symlink handling, VCS exclusion,
103
+ reproducible ordering, and so on) are on the same screen.
104
+
105
+ **Plain tarball**: a bare `.tar`, no compression. Just the tar switches.
106
+
107
+ **Zip archive**: a `.zip` written by Info-ZIP with deflate, bzip2 or store.
108
+ When exactly one file is selected, the single-file compressors are offered
109
+ here too, so `notes.txt` becomes `notes.txt.gz` or `notes.txt.zst` without a
110
+ tarball around it. For a folder those are greyed out with the reason, since
111
+ `gzip` alone cannot take a folder.
112
+
113
+ Everything is probed at startup: `PATH` for the compressors, `tar --version` to
114
+ tell GNU tar from bsdtar from busybox, and `zip -v` for its compiled-in methods.
115
+ Anything that will not work on this machine is greyed out with the reason.
116
+
117
+ ## How the archive is shaped
118
+
119
+ Members are stored relative to the deepest folder that contains every tagged
120
+ path, which is shown on the confirm screen. Tag `~/a/b` and `~/c` and the
121
+ archive holds `a/b` and `c`.
122
+
123
+ ## Notes
124
+
125
+ - Commands are run directly, not in a shell. Filenames containing spaces,
126
+ quotes, `$`, `;` or a leading `-` are safe.
127
+ - Cancelling kills the whole process group, so the compressor goes too.
128
+ - Folder sizes are counted in the background. A folder too large to finish
129
+ counting in a few seconds shows `≥`, meaning the real size is at least that.
130
+
131
+ ## Tests
132
+
133
+ ```
134
+ ruby test/test_rakpak.rb
135
+ ```
data/bin/rakpak ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "rakpak"
5
+
6
+ begin
7
+ exit Rakpak.start(ARGV)
8
+ rescue Interrupt
9
+ exit 130
10
+ end