grubber-twin 0.1.0 → 0.1.2

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +98 -24
  3. data/lib/twin/version.rb +1 -1
  4. metadata +13 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c9dc2a33a083ec7264d3c7ffe99c308aaf614fa8afcd67a6725e28e056235d8
4
- data.tar.gz: 1aeeaa68cffcc6f1091d3a06fb7747c3b209dfbe5c6846e930540859426859c2
3
+ metadata.gz: f64af56bba3d804493af420740dccbe9421ce4571d3c406941d40470dc0dd985
4
+ data.tar.gz: db99fff5aa8de2c7f63756ef151b893cd96a20a70f4ac779bab4a77ea7fd10ab
5
5
  SHA512:
6
- metadata.gz: 4c58cc776b775987cd0ab2a761b580152292161d01817ff7e391bb8949ecd9c0cd70532ea1d6e36cade1c52bfd41af8a0c56d35f760e006ef8edc0e83a2bbd46
7
- data.tar.gz: bc1b072245d428416c438658666af5bed697048ad9ba76c6c2ea618711634576c4de509b2ba3ed00bd3ad19f301c1b8649b2c0b3b39ccd902cb4209c87657556
6
+ metadata.gz: 12cc7de69f750b230928d346fd062a96b8771580182d05acb5ffd2b4127e9b954af996c3da33cbfa32fe0137586dfe58ffdf2ee030ceafe0f7b4360af031c3d8
7
+ data.tar.gz: 4d4506b0b8afc2743e990f3b727b58414de97b6cb7d3e8f7eb8c6418979ec071f22f15ec30be765c06a9107712dac1afc742398ea8f4d93692b0019fa39790e2
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # twin
2
2
 
3
+ [![Gem Version](https://img.shields.io/gem/v/grubber-twin.svg)](https://rubygems.org/gems/grubber-twin)
4
+ [![Tests](https://github.com/rhsev/grubber-twin/actions/workflows/test.yml/badge.svg)](https://github.com/rhsev/grubber-twin/actions/workflows/test.yml)
5
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
+
3
7
  Sync configuration folders between two Macs from self-documenting Markdown files.
4
8
 
5
9
  Sync entries are defined in Markdown files with YAML blocks — human-readable,
@@ -20,11 +24,87 @@ Sync-definitions in Markdown + YAML are three things at once:
20
24
  add new entries or refactor existing ones, and the result stays valid for both
21
25
  humans and grubber.
22
26
 
27
+ ## Screenshots
28
+
29
+ Stage 1 — program picker. One row per program, color-coded status, indented
30
+ paths underneath:
31
+
32
+ ![Stage 1 — program picker](https://raw.githubusercontent.com/rhsev/grubber-twin/main/docs/stage_1.png)
33
+
34
+ Stage 2 — multi-select over the paths of one program. The right pane shows a
35
+ compact preview of the relevant sync-file section, rendered by apex:
36
+
37
+ ![Stage 2 — Fish Shell paths with apex preview](https://raw.githubusercontent.com/rhsev/grubber-twin/main/docs/stage_2_fish.png)
38
+
39
+ ## Installation
40
+
41
+ ### 1. Install grubber
42
+
43
+ twin parses sync-files via [grubber](https://github.com/rhsev/grubber), a
44
+ small Go binary. Download the latest release for your platform from
45
+ [github.com/rhsev/grubber/releases](https://github.com/rhsev/grubber/releases)
46
+ and put it somewhere in your `PATH` (e.g. `/usr/local/bin/grubber`).
47
+
48
+ ### 2. Install twin
49
+
50
+ ```bash
51
+ gem install grubber-twin
52
+ ```
53
+
54
+ Or from source:
55
+
56
+ ```bash
57
+ git clone https://github.com/rhsev/grubber-twin.git
58
+ cd grubber-twin
59
+ gem build grubber-twin.gemspec
60
+ gem install ./grubber-twin-*.gem
61
+ ```
62
+
63
+ ### 3. Other tools
64
+
65
+ Also required in `PATH`: `rsync` (preinstalled on macOS), `fzf`
66
+ (`brew install fzf`). For the stage-2 preview, one of `apex`, `glow`,
67
+ or `bat` is recommended (falls back in that order; `cat` if none are
68
+ present).
69
+
70
+ ## Quickstart
71
+
72
+ 1. **Pick a directory for sync-files** (anywhere; this example uses `~/Sync`):
73
+
74
+ ```bash
75
+ mkdir -p ~/Sync
76
+ ```
77
+
78
+ 2. **Create the config** at `~/.config/twin/config.yaml`:
79
+
80
+ ```yaml
81
+ sync_dir: ~/Sync
82
+ global_excludes:
83
+ - .DS_Store
84
+ - .git/
85
+ ```
86
+
87
+ 3. **Drop a sync-file** into `~/Sync`. The simplest starting point is to copy
88
+ one of the [examples](examples/) and adapt the frontmatter:
89
+
90
+ ```bash
91
+ cp examples/home.md ~/Sync/
92
+ $EDITOR ~/Sync/home.md # edit Source: and Target:
93
+ ```
94
+
95
+ 4. **Run twin**:
96
+
97
+ ```bash
98
+ twin
99
+ ```
100
+
101
+ Pick a program, then the paths to sync, hit Enter.
102
+
23
103
  ## Usage
24
104
 
25
105
  ```bash
26
106
  twin # picker — all programs across all sync-files
27
- twin home_macbook.md # picker — one sync-file in sync_dir (by name)
107
+ twin home.md # picker — one sync-file in sync_dir (by name)
28
108
  twin /abs/path/to/file.md # picker — any sync-file by absolute path
29
109
  twin ./relative/dir/ # picker — all sync-files in a directory
30
110
  twin list # plain listing
@@ -40,17 +120,6 @@ File argument resolution:
40
120
  - bare name (no `/`) → looked up by substring in `sync_dir`
41
121
  - contains `/` → resolved as path (absolute or relative); file or directory both work
42
122
 
43
- ## Installation
44
-
45
- ```bash
46
- gem build twin.gemspec
47
- gem install ./twin-*.gem
48
- ```
49
-
50
- External tools required in PATH: `grubber`, `rsync`, `fzf`. For the
51
- stage-2 preview, one of `apex`, `glow`, or `bat` (falls back in that order;
52
- `cat` if none are present).
53
-
54
123
  ## Configuration
55
124
 
56
125
  `~/.config/twin/config.yaml`:
@@ -62,8 +131,11 @@ global_excludes:
62
131
  - .DS_Store
63
132
  - .git/
64
133
 
65
- apex_theme: ralf # optional
66
- apex_width: 80 # optional
134
+ # Optional preview rendering (apex):
135
+ # apex_theme: default
136
+ # apex_width: 80
137
+ # apex_code_highlight: monokai
138
+ # apex_code_highlight_theme: dark
67
139
  ```
68
140
 
69
141
  Environment overrides: `TWIN_SYNC_DIR`, `TWIN_CONFIG`.
@@ -71,14 +143,17 @@ Environment overrides: `TWIN_SYNC_DIR`, `TWIN_CONFIG`.
71
143
  ## Sync-files
72
144
 
73
145
  Each Markdown file represents one sync relationship. Frontmatter defines the
74
- relationship; YAML blocks define individual paths.
146
+ relationship (Source/Target); YAML blocks define individual paths.
147
+
148
+ See [examples/home.md](examples/home.md) and [examples/repos.md](examples/repos.md)
149
+ for ready-to-adapt templates.
75
150
 
76
- Example:
151
+ Minimal example:
77
152
 
78
153
  ````markdown
79
154
  ---
80
155
  Active: 1
81
- Label: mac-mini→macbook
156
+ Label: mac-mini macbook
82
157
  Source: /Users/admin
83
158
  Target: /Volumes/macbook/Users/admin
84
159
  ---
@@ -99,17 +174,16 @@ Frontmatter fields (`Active`, `Label`, `Source`, `Target`) are merged into
99
174
  every block by grubber. Multiple blocks can share the same `Program` — twin
100
175
  groups them and treats the program as the unit of selection.
101
176
 
102
- The optional `Cmd` field runs a shell command after a successful sync.
177
+ The optional `Cmd` field runs a shell command after a successful sync (useful
178
+ for reloading services or notifying companions).
103
179
 
104
180
  ## Design
105
181
 
106
- - **Selection unit:** Program. A program may have several blocks (paths); the
107
- picker shows one row per program.
108
- - **Preview:** the whole sync-file rendered with `apex --plugins -t terminal256`.
109
- - **No TUI framework:** `fzf` does the interactive part, `apex` the rendering.
110
- Composition over framework.
182
+ Sync instructions and context in one place the same Markdown file holds
183
+ both the `Path:` directives and the prose explaining them. No TUI framework:
184
+ `fzf` does the interactive part, `apex` the rendering.
111
185
 
112
- See `ARCHITECTURE.md` for details.
186
+ See [ARCHITECTURE.md](ARCHITECTURE.md) for the data model and internals.
113
187
 
114
188
  ## Tests
115
189
 
data/lib/twin/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Twin
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grubber-twin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ralf Hülsmann
@@ -50,6 +50,17 @@ licenses:
50
50
  metadata:
51
51
  source_code_uri: https://github.com/rhsev/grubber-twin
52
52
  bug_tracker_uri: https://github.com/rhsev/grubber-twin/issues
53
+ post_install_message: |2+
54
+
55
+ twin requires these external tools in your PATH:
56
+ grubber https://github.com/rhsev/grubber
57
+ rsync (preinstalled on macOS)
58
+ fzf brew install fzf
59
+
60
+ Optional for the preview pane:
61
+ apex https://github.com/ttscoff/apex
62
+ glow / bat as fallbacks (cat is used if none are present)
63
+
53
64
  rdoc_options: []
54
65
  require_paths:
55
66
  - lib
@@ -69,3 +80,4 @@ specification_version: 4
69
80
  summary: Sync configuration folders between two Macs from self-documenting Markdown
70
81
  files
71
82
  test_files: []
83
+ ...