galaaz 2.1.6 → 2.1.8

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 (83) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/blogs/galaaz_ggplot/galaaz_ggplot.Rmd +63 -58
  4. data/blogs/galaaz_ggplot/galaaz_ggplot.log +59 -68
  5. data/blogs/galaaz_ggplot/galaaz_ggplot.md +91 -84
  6. data/blogs/galaaz_ggplot/galaaz_ggplot.tex +125 -94
  7. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-html/midwest_rb.png +0 -0
  8. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-html/scatter_plot_rb.png +0 -0
  9. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-markdown_github/midwest_rb.png +0 -0
  10. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-markdown_github/scatter_plot_rb.png +0 -0
  11. data/blogs/gknit/gknit.Rmd +33 -28
  12. data/blogs/gknit/gknit.md +47 -42
  13. data/blogs/gknit/gknit.tex +1368 -0
  14. data/blogs/gknit/gknit_files/figure-html/bubble-1.png +0 -0
  15. data/blogs/gknit/gknit_files/figure-html/diverging_bar.png +0 -0
  16. data/blogs/gknit/gknit_files/figure-latex/bubble-1.png +0 -0
  17. data/blogs/gknit/gknit_files/gknit_files/figure-latex/bubble-1.png +0 -0
  18. data/blogs/manual/manual.Rmd +129 -60
  19. data/blogs/manual/manual.log +289 -545
  20. data/blogs/manual/manual.md +551 -467
  21. data/blogs/manual/manual.tex +1059 -485
  22. data/blogs/manual/manual_files/figure-html/bubble-1.png +0 -0
  23. data/blogs/manual/manual_files/figure-latex/bubble-1.png +0 -0
  24. data/blogs/manual/manual_files/figure-markdown_github/bubble-1.png +0 -0
  25. data/blogs/manual/manual_files/figure-markdown_github/diverging_bar.png +0 -0
  26. data/blogs/manual/manual_files/manual_files/figure-latex/bubble-1.png +0 -0
  27. data/blogs/nse_dplyr/nse_dplyr.Rmd +28 -7
  28. data/blogs/nse_dplyr/nse_dplyr.log +49 -153
  29. data/blogs/nse_dplyr/nse_dplyr.md +676 -705
  30. data/blogs/nse_dplyr/nse_dplyr.tex +1589 -0
  31. data/blogs/oh_my/oh_my.Rmd +193 -55
  32. data/blogs/oh_my/oh_my.log +265 -95
  33. data/blogs/oh_my/oh_my.md +236 -95
  34. data/blogs/oh_my/oh_my.tex +1976 -68
  35. data/blogs/ruby_plot/ruby_plot.Rmd +42 -34
  36. data/blogs/ruby_plot/ruby_plot.log +101 -99
  37. data/blogs/ruby_plot/ruby_plot.md +52 -46
  38. data/blogs/ruby_plot/ruby_plot.tex +134 -102
  39. data/blogs/ruby_plot/ruby_plot_files/figure-html/dose_len.png +0 -0
  40. data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_delivery.png +0 -0
  41. data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_dose.png +0 -0
  42. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color.png +0 -0
  43. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color2.png +0 -0
  44. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_decorations.png +0 -0
  45. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_jitter.png +0 -0
  46. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_points.png +0 -0
  47. data/blogs/ruby_plot/ruby_plot_files/figure-html/final_box_plot.png +0 -0
  48. data/blogs/ruby_plot/ruby_plot_files/figure-html/final_violin_plot.png +0 -0
  49. data/blogs/ruby_plot/ruby_plot_files/figure-html/violin_with_jitter.png +0 -0
  50. data/blogs/ruby_plot/ruby_plot_files/figure-latex/dose_len.png +0 -0
  51. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facet_by_delivery.png +0 -0
  52. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facet_by_dose.png +0 -0
  53. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_by_delivery_color.png +0 -0
  54. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_by_delivery_color2.png +0 -0
  55. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_decorations.png +0 -0
  56. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_jitter.png +0 -0
  57. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_points.png +0 -0
  58. data/blogs/ruby_plot/ruby_plot_files/figure-latex/final_box_plot.png +0 -0
  59. data/blogs/ruby_plot/ruby_plot_files/figure-latex/final_violin_plot.png +0 -0
  60. data/blogs/ruby_plot/ruby_plot_files/figure-latex/violin_with_jitter.png +0 -0
  61. data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/dose_len.png +0 -0
  62. data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/facet_by_delivery.png +0 -0
  63. data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/facet_by_dose.png +0 -0
  64. data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/facets_by_delivery_color.png +0 -0
  65. data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/facets_by_delivery_color2.png +0 -0
  66. data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/facets_with_decorations.png +0 -0
  67. data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/facets_with_jitter.png +0 -0
  68. data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/facets_with_points.png +0 -0
  69. data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/final_box_plot.png +0 -0
  70. data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/final_violin_plot.png +0 -0
  71. data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/violin_with_jitter.png +0 -0
  72. data/lib/galaaz/cli.rb +206 -11
  73. data/script/omarchy/README.md +94 -0
  74. data/script/omarchy/debug-galaaz.sh +91 -0
  75. data/script/omarchy/galaaz-add.sh +176 -0
  76. data/script/omarchy/galaaz-gknit.sh +73 -0
  77. data/script/omarchy/galaaz-guide.sh +123 -0
  78. data/script/omarchy/install-galaaz.sh +308 -0
  79. data/script/omarchy/omarchy-menu.jsonc +92 -0
  80. data/script/omarchy/remove-galaaz.sh +34 -0
  81. data/sty/galaaz.sty +22 -0
  82. data/version.rb +1 -1
  83. metadata +27 -1
data/lib/galaaz/cli.rb CHANGED
@@ -4,6 +4,7 @@ require 'fileutils'
4
4
  require 'rbconfig'
5
5
  require 'open3'
6
6
  require 'time'
7
+ require 'tmpdir'
7
8
 
8
9
  module Galaaz
9
10
  module CLI
@@ -15,6 +16,18 @@ module Galaaz
15
16
  DEFAULT_EXAMPLES_DIR = File.join(Dir.home, 'galaaz-examples')
16
17
  DEFAULT_LEDGER_DIR = File.join(Dir.home, 'r_on_rails_ledger')
17
18
  LEDGER_REPO = 'https://github.com/rbotafogo/r_on_rails_ledger.git'
19
+ OMARCHY_GITHUB_REPO = 'rbotafogo/galaaz'
20
+ OMARCHY_DEFAULT_GIT_REF = 'galaaz2_0'
21
+ # [source under script/omarchy/, dest basename under ~/.local/bin, executable?]
22
+ OMARCHY_BIN_FILES = [
23
+ ['install-galaaz.sh', 'omarchy-install-galaaz', true],
24
+ ['remove-galaaz.sh', 'omarchy-remove-galaaz', true],
25
+ ['galaaz-add.sh', 'omarchy-galaaz-add', true],
26
+ ['galaaz-guide.sh', 'omarchy-galaaz-guide', true],
27
+ ['galaaz-gknit.sh', 'omarchy-galaaz-gknit', true],
28
+ ['debug-galaaz.sh', 'omarchy-galaaz-debug', true]
29
+ ].freeze
30
+ OMARCHY_MENU_FILE = 'omarchy-menu.jsonc'
18
31
  BLOGS_MARKER = '.galaaz-blogs'
19
32
  EXAMPLES_MARKER = '.galaaz-examples'
20
33
  CRAN = 'https://cloud.r-project.org'
@@ -41,6 +54,8 @@ module Galaaz
41
54
  cmd_doctor
42
55
  when 'add'
43
56
  cmd_add(argv[1..])
57
+ when 'omarchy'
58
+ cmd_omarchy(argv[1..] || [])
44
59
  else
45
60
  # Legacy: `galaaz some:rake_task` forwarded to rake (see README / blogs).
46
61
  Dir.chdir(root) do
@@ -68,6 +83,9 @@ module Galaaz
68
83
  doctor Report Ruby, R, gatekeeper, Rcpp, sty, profiles
69
84
  add PROFILE Install an add-on (idempotent)
70
85
  Profiles: #{PROFILES.join(', ')}
86
+ omarchy [install] Install Omarchy menu overlay (bundled in gem)
87
+ Options: --from-git [--ref REF]
88
+ omarchy status Show whether overlay helpers are installed
71
89
 
72
90
  Legacy: any other argument is passed to rake in the Galaaz root
73
91
  (e.g. galaaz master_list:scatter_plot).
@@ -91,10 +109,146 @@ module Galaaz
91
109
  mark_profile!('core')
92
110
  puts 'galaaz setup: OK'
93
111
  puts "You can now run: galaaz doctor"
94
- puts 'Omarchy menu: Install → Development → Galaaz (add-ons appear after core)'
112
+ puts 'On Omarchy: galaaz omarchy # install menu overlay (gem-bundled)'
95
113
  0
96
114
  end
97
115
 
116
+ # ---- omarchy overlay ----
117
+
118
+ def cmd_omarchy(argv)
119
+ argv = argv.dup
120
+ case argv[0]
121
+ when nil, 'install'
122
+ argv.shift if argv[0] == 'install'
123
+ omarchy_install(argv)
124
+ when 'status'
125
+ omarchy_status
126
+ when '-h', '--help', 'help'
127
+ print_omarchy_help
128
+ 0
129
+ else
130
+ if argv[0].to_s.start_with?('-')
131
+ omarchy_install(argv)
132
+ else
133
+ raise CliError, "unknown omarchy subcommand: #{argv[0].inspect} (try: install|status)"
134
+ end
135
+ end
136
+ end
137
+
138
+ def print_omarchy_help
139
+ puts <<~HELP
140
+ Usage: galaaz omarchy [install|status] [options]
141
+
142
+ install Copy menu helpers from the gem (default)
143
+ install --from-git [--ref REF]
144
+ Pull script/omarchy from GitHub instead of the gem
145
+ Default REF: #{OMARCHY_DEFAULT_GIT_REF} (or GALAAZ_OMARCHY_REF)
146
+ status Show installed overlay paths
147
+
148
+ Writes:
149
+ ~/.local/bin/omarchy-install-galaaz (and add/remove/guide/gknit/debug)
150
+ ~/.config/omarchy/extensions/omarchy-menu.jsonc
151
+
152
+ Then: Super+Space → Install → Development → Galaaz
153
+ HELP
154
+ end
155
+
156
+ def omarchy_install(argv)
157
+ argv = argv.dup
158
+ from_git = argv.delete('--from-git') || argv.delete('--github')
159
+ ref = nil
160
+ if (i = argv.index('--ref'))
161
+ argv.delete_at(i)
162
+ ref = argv.delete_at(i)
163
+ raise CliError, '--ref requires a branch/tag/commit' if ref.nil? || ref.empty?
164
+ end
165
+ raise CliError, "unknown omarchy install args: #{argv.join(' ')}" unless argv.empty?
166
+
167
+ src =
168
+ if from_git
169
+ ref = ENV['GALAAZ_OMARCHY_REF'] if ref.nil? || ref.empty?
170
+ ref = OMARCHY_DEFAULT_GIT_REF if ref.nil? || ref.empty?
171
+ fetch_omarchy_overlay_from_git!(ref)
172
+ else
173
+ omarchy_overlay_dir_bundled
174
+ end
175
+
176
+ begin
177
+ install_omarchy_overlay_from!(src)
178
+ ensure
179
+ FileUtils.rm_rf(src) if from_git && src && src.start_with?(Dir.tmpdir)
180
+ end
181
+ puts 'galaaz omarchy: OK'
182
+ puts 'Next: Super+Space → Install → Development → Galaaz → Galaaz (core)'
183
+ puts 'Or: omarchy-install-galaaz'
184
+ 0
185
+ end
186
+
187
+ def omarchy_status
188
+ bin = File.expand_path('~/.local/bin')
189
+ menu = File.expand_path('~/.config/omarchy/extensions/omarchy-menu.jsonc')
190
+ puts 'galaaz omarchy status'
191
+ OMARCHY_BIN_FILES.each do |_src, dest, _exe|
192
+ path = File.join(bin, dest)
193
+ puts " #{dest}: #{File.file?(path) ? path : 'MISSING'}"
194
+ end
195
+ puts " menu: #{File.file?(menu) ? menu : 'MISSING'}"
196
+ bundled = File.join(root, 'script', 'omarchy')
197
+ puts " gem overlay: #{File.directory?(bundled) ? bundled : 'MISSING (reinstall gem)'}"
198
+ 0
199
+ end
200
+
201
+ def omarchy_overlay_dir_bundled
202
+ d = File.join(root, 'script', 'omarchy')
203
+ abort_unless(File.directory?(d), "Omarchy overlay missing from gem (#{d}). Reinstall galaaz.")
204
+ abort_unless(
205
+ File.file?(File.join(d, 'install-galaaz.sh')) && File.file?(File.join(d, OMARCHY_MENU_FILE)),
206
+ "incomplete Omarchy overlay in gem (#{d})"
207
+ )
208
+ d
209
+ end
210
+
211
+ def fetch_omarchy_overlay_from_git!(ref)
212
+ need_cmd!('curl')
213
+ tmp = Dir.mktmpdir('galaaz-omarchy-')
214
+ base = "https://raw.githubusercontent.com/#{OMARCHY_GITHUB_REPO}/#{ref}/script/omarchy"
215
+ puts "galaaz omarchy: fetching #{base}/…"
216
+ names = OMARCHY_BIN_FILES.map(&:first) + [OMARCHY_MENU_FILE]
217
+ names.uniq.each do |name|
218
+ url = "#{base}/#{name}"
219
+ dest = File.join(tmp, name)
220
+ ok = system('curl', '-fsSL', '-o', dest, url)
221
+ unless ok && File.file?(dest) && File.size(dest).positive?
222
+ FileUtils.rm_rf(tmp)
223
+ raise CliError, "failed to download #{url} (check --ref #{ref})"
224
+ end
225
+ puts " got #{name}"
226
+ end
227
+ tmp
228
+ end
229
+
230
+ def install_omarchy_overlay_from!(src_dir)
231
+ bin = File.expand_path('~/.local/bin')
232
+ ext = File.expand_path('~/.config/omarchy/extensions')
233
+ FileUtils.mkdir_p(bin)
234
+ FileUtils.mkdir_p(ext)
235
+
236
+ OMARCHY_BIN_FILES.each do |src_name, dest_name, executable|
237
+ src = File.join(src_dir, src_name)
238
+ abort_unless(File.file?(src), "missing #{src}")
239
+ dest = File.join(bin, dest_name)
240
+ FileUtils.cp(src, dest)
241
+ FileUtils.chmod(0o755, dest) if executable
242
+ puts "galaaz omarchy: #{dest}"
243
+ end
244
+
245
+ menu_src = File.join(src_dir, OMARCHY_MENU_FILE)
246
+ abort_unless(File.file?(menu_src), "missing #{menu_src}")
247
+ menu_dest = File.join(ext, OMARCHY_MENU_FILE)
248
+ FileUtils.cp(menu_src, menu_dest)
249
+ puts "galaaz omarchy: #{menu_dest}"
250
+ end
251
+
98
252
  # ---- blogs ----
99
253
 
100
254
  def cmd_blogs(argv)
@@ -433,18 +587,26 @@ module Galaaz
433
587
 
434
588
  Dir.chdir(dest) do
435
589
  need_cmd!('bundle')
436
- # Lockfile often still pins path: ../galaaz @ an old version — pull latest RubyGems.
590
+ ensure_ledger_bundler!
591
+ # Fresh clone: install the full lockfile under the app's Ruby (mise .ruby-version).
592
+ # Do not run `bundle update` first — that can mix PATH Ruby with app Ruby and skip install.
593
+ puts 'galaaz add ledger: bundle install'
594
+ abort_unless(ledger_bundle('install'), 'bundle install failed')
437
595
  puts 'galaaz add ledger: bundle update galaaz'
438
- unless system('bundle', 'update', 'galaaz')
439
- abort_unless(system('bundle', 'install'), 'bundle install failed')
440
- end
441
- # Setup the gem Bundler will load (not PATH galaaz, which may differ).
596
+ ledger_bundle('update', 'galaaz') ||
597
+ warn('galaaz add ledger: bundle update galaaz returned non-zero (continuing with installed galaaz)')
442
598
  puts 'galaaz add ledger: bundle exec galaaz setup'
443
- system('bundle', 'exec', 'galaaz', 'setup') ||
444
- warn('galaaz add ledger: bundle exec galaaz setup returned non-zero; check gatekeeper')
445
- abort_unless(system('bin/rails', 'db:prepare'), 'rails db:prepare failed')
446
- abort_unless(system('bin/rails', 'db:migrate'), 'rails db:migrate failed')
447
- abort_unless(system({ 'SEED_PROFILE' => 'fast' }, 'bin/rails', 'db:seed'), 'rails db:seed failed')
599
+ unless ledger_bundle('exec', 'galaaz', 'setup')
600
+ warn('galaaz add ledger: bundle exec galaaz setup failed; trying PATH galaaz setup')
601
+ system('galaaz', 'setup') ||
602
+ warn('galaaz add ledger: galaaz setup returned non-zero; check gatekeeper')
603
+ end
604
+ abort_unless(ledger_bundle('exec', 'rails', 'db:prepare'), 'rails db:prepare failed')
605
+ abort_unless(ledger_bundle('exec', 'rails', 'db:migrate'), 'rails db:migrate failed')
606
+ abort_unless(
607
+ ledger_bundle_env({ 'SEED_PROFILE' => 'fast' }, 'exec', 'rails', 'db:seed'),
608
+ 'rails db:seed failed'
609
+ )
448
610
  end
449
611
 
450
612
  mark_profile!('ledger')
@@ -454,6 +616,39 @@ module Galaaz
454
616
  0
455
617
  end
456
618
 
619
+ # Run bundle under mise so .ruby-version / .tool-versions match Omarchy PATH ruby.
620
+ def ledger_bundle(*args)
621
+ if command_present?('mise')
622
+ system('mise', 'x', '--', 'bundle', *args)
623
+ else
624
+ system('bundle', *args)
625
+ end
626
+ end
627
+
628
+ def ledger_bundle_env(env, *args)
629
+ if command_present?('mise')
630
+ system(env, 'mise', 'x', '--', 'bundle', *args)
631
+ else
632
+ system(env, 'bundle', *args)
633
+ end
634
+ end
635
+
636
+ def ensure_ledger_bundler!
637
+ locked = nil
638
+ if File.file?('Gemfile.lock')
639
+ locked = File.read('Gemfile.lock')[/BUNDLED WITH\s+(\d+\.\d+(?:\.\d+)?)/, 1]
640
+ end
641
+ puts "galaaz add ledger: ensure bundler#{locked ? " #{locked}" : ''}"
642
+ if command_present?('mise')
643
+ cmd = ['mise', 'x', '--', 'gem', 'install', 'bundler', '--no-document']
644
+ cmd.insert(-2, '-v', locked) if locked
645
+ system(*cmd) || warn('galaaz add ledger: gem install bundler returned non-zero')
646
+ elsif locked
647
+ system('gem', 'install', 'bundler', '-v', locked, '--no-document') ||
648
+ warn('galaaz add ledger: gem install bundler returned non-zero')
649
+ end
650
+ end
651
+
457
652
  # Ledger repo may ship `gem "galaaz", path: "..."`. Standalone installs use RubyGems
458
653
  # (CRuby or JRuby), unpinned, so `bundle update galaaz` takes the newest published gem.
459
654
  def ensure_ledger_galaaz_gemfile!(gemfile)
@@ -0,0 +1,94 @@
1
+ # Omarchy dogfood (overlay + scripts)
2
+
3
+ Not an official Omarchy package. Community overlay for [TryOmarchy](https://tryomarchy.com/)
4
+ or a real Omarchy install. Works **with or without** an upstream Omarchy PR.
5
+
6
+ ## Recommended: `galaaz omarchy` (gem-bundled)
7
+
8
+ ```bash
9
+ gem install galaaz
10
+ galaaz setup
11
+ galaaz omarchy # A: copy overlay from this gem
12
+ # optional, newer overlay than the gem:
13
+ # galaaz omarchy install --from-git
14
+ # galaaz omarchy install --from-git --ref galaaz2_0
15
+ galaaz omarchy status
16
+ ```
17
+
18
+ Then Super+Space → Install → Development → **Galaaz**.
19
+
20
+ **Important:** `gem install galaaz` alone does **not** add an Omarchy menu until you run
21
+ `galaaz omarchy` (or an upstream catalog row exists).
22
+
23
+ ## Files
24
+
25
+ | File | Role |
26
+ |------|------|
27
+ | `install-galaaz.sh` | Core install; always writes `~/.local/share/galaaz/install-core.log` |
28
+ | `galaaz-guide.sh` | Guide / docs / knit-demo helper (`omarchy-galaaz-guide`) |
29
+ | `galaaz-add.sh` | Add-on wrapper (`omarchy-galaaz-add`) — pandoc without Arch Haskell stack |
30
+ | `galaaz-gknit.sh` | Safe HTML gknit helper |
31
+ | `debug-galaaz.sh` | Snapshot doctor/PATH/gem/bridge |
32
+ | `remove-galaaz.sh` | Uninstall gem + marked blogs; leave R |
33
+ | `omarchy-menu.jsonc` | Menu overlay submenu under Install → Development |
34
+
35
+ After core, the menu includes **Guide (what's next)**, **Documentation (website)**, and **GitHub repository**. After Knit, **Knit demo (oh_my)** runs an example blog.
36
+
37
+ Docs: https://rbotafogo.github.io/galaaz/ · https://github.com/rbotafogo/galaaz
38
+
39
+ Heavy CRAN installs (`R.install_and_loads`) and long R (`R::Job.eval` / `script`) run in a
40
+ child `Rscript` so the bridge stays free — see **Background R jobs (`R::Job`)** in the
41
+ README / manual (gem **2.1.8+**).
42
+
43
+ ## Manual copy (legacy)
44
+
45
+ Only if you cannot run `galaaz omarchy` yet:
46
+
47
+ ```bash
48
+ mkdir -p ~/.local/bin ~/.config/omarchy/extensions
49
+ cp install-galaaz.sh ~/.local/bin/omarchy-install-galaaz
50
+ cp remove-galaaz.sh ~/.local/bin/omarchy-remove-galaaz
51
+ cp galaaz-add.sh ~/.local/bin/omarchy-galaaz-add
52
+ cp galaaz-guide.sh ~/.local/bin/omarchy-galaaz-guide
53
+ cp galaaz-gknit.sh ~/.local/bin/omarchy-galaaz-gknit
54
+ cp debug-galaaz.sh ~/.local/bin/omarchy-galaaz-debug
55
+ cp omarchy-menu.jsonc ~/.config/omarchy/extensions/omarchy-menu.jsonc
56
+ chmod +x ~/.local/bin/omarchy-*
57
+ ```
58
+
59
+ ## TryOmarchy steps
60
+
61
+ 1. Install → Development → Ruby on Rails (mise Ruby).
62
+ 2. `gem install galaaz && galaaz setup && galaaz omarchy`
63
+ 3. Super+Space → search **Galaaz**, or Install → Development → **Galaaz** → **Galaaz (core)**.
64
+
65
+ That action must finish **gem + setup + blogs + doctor**. It fails if the gatekeeper `.so` is missing — “gem installed” alone is not success.
66
+
67
+ 4. After core finishes, the same submenu shows Knit / Arrow / TeX / Bio / Examples / Ledger.
68
+
69
+ 5. **Ledger (required dogfood / pitch):** Install → Development → **Galaaz → Ledger**
70
+ (or `omarchy-galaaz-add ledger` / `galaaz add ledger`). That pulls **arrow** if
71
+ needed using Apache’s **LIBARROW_BINARY** prebuilt libarrow (no manual steps;
72
+ Arch `pacman` arrow is not used for the R package — version skew breaks
73
+ configure), clones `~/r_on_rails_ledger`, rewrites any `path:` gem to RubyGems
74
+ galaaz, then `bundle install` + fast seed.
75
+
76
+ **Knit / TeX pandoc:** the add wrapper does **not** install Arch `pandoc` /
77
+ `pandoc-cli` (Haskell mega-deps; often fails on TryOmarchy). It uses
78
+ `pandoc-bin` when available, else the latest official GitHub linux tarball
79
+ into `~/.local/bin` (override with `PANDOC_RELEASE_VER=…`).
80
+
81
+ Pass when:
82
+
83
+ ```bash
84
+ grep galaaz ~/r_on_rails_ledger/Gemfile # no path: "../galaaz"
85
+ test -f ~/.config/galaaz/profiles/ledger
86
+ cd ~/r_on_rails_ledger && bin/dev
87
+ ```
88
+
89
+ Open http://localhost:3000 → portfolio → **Run stress test** (Local R / Arrow).
90
+
91
+ 6. Before the upstream Omarchy PR: wipe TryOmarchy (`%LOCALAPPDATA%\TryOmarchy`),
92
+ reinstall, and repeat steps 1–5 on a clean guest (plan Phase E, including Ledger).
93
+
94
+ See `Documentation/PLAN_OMARCHY_INTEGRATION.md` for full phases and tests (D-T10 / D-T11 / E-T3).
@@ -0,0 +1,91 @@
1
+ #!/bin/bash
2
+ # Collect Galaaz / Omarchy debug info into one file you can paste or copy out.
3
+ # Usage: bash debug-galaaz.sh
4
+ # Writes: ~/.local/share/galaaz/debug.log (+ Desktop copy if Desktop exists)
5
+ set -u
6
+
7
+ LOG_DIR="${HOME}/.local/share/galaaz"
8
+ OUT="${LOG_DIR}/debug.log"
9
+ mkdir -p "${LOG_DIR}"
10
+ : >"${OUT}"
11
+
12
+ say() { echo -e "$*" | tee -a "${OUT}"; }
13
+
14
+ say "=== galaaz debug $(date -Iseconds) ==="
15
+ say "user=$(id -un) home=${HOME}"
16
+ say "PATH=${PATH}"
17
+ say ""
18
+
19
+ say "== which =="
20
+ for c in ruby gem mise R Rscript make gcc g++ galaaz omarchy-install-galaaz; do
21
+ say " ${c}: $(command -v "${c}" 2>/dev/null || echo MISSING)"
22
+ done
23
+
24
+ say ""
25
+ say "== versions =="
26
+ { ruby -v; gem -v; mise -v; R --version | head -1; } >>"${OUT}" 2>&1 || true
27
+ say "RUBY_ENGINE=$(ruby -e 'print RUBY_ENGINE' 2>/dev/null || echo '?')"
28
+ if command -v mise >/dev/null 2>&1; then
29
+ say "mise ruby -v: $(mise x ruby -- ruby -v 2>/dev/null || echo fail)"
30
+ say "mise engine: $(mise x ruby -- ruby -e 'print RUBY_ENGINE' 2>/dev/null || echo fail)"
31
+ mise ls >>"${OUT}" 2>&1 || true
32
+ fi
33
+
34
+ say ""
35
+ say "== gem galaaz =="
36
+ {
37
+ gem list galaaz
38
+ gem which galaaz 2>/dev/null || true
39
+ ruby -e "puts Gem::Specification.find_by_name('galaaz').full_gem_path" 2>/dev/null || echo 'gem root: FAIL'
40
+ if command -v mise >/dev/null 2>&1; then
41
+ echo '--- mise x ruby ---'
42
+ mise x ruby -- gem list galaaz
43
+ mise x ruby -- ruby -e "puts Gem::Specification.find_by_name('galaaz').full_gem_path"
44
+ fi
45
+ } >>"${OUT}" 2>&1 || true
46
+
47
+ ROOT="$(ruby -e "puts Gem::Specification.find_by_name('galaaz').full_gem_path" 2>/dev/null || true)"
48
+ if [[ -z "${ROOT}" ]] && command -v mise >/dev/null 2>&1; then
49
+ ROOT="$(mise x ruby -- ruby -e "puts Gem::Specification.find_by_name('galaaz').full_gem_path" 2>/dev/null || true)"
50
+ fi
51
+ say "gem root: ${ROOT:-UNKNOWN}"
52
+ if [[ -n "${ROOT}" ]]; then
53
+ BRIDGE="${ROOT}/ext/new_bridge"
54
+ say "bridge: ${BRIDGE}"
55
+ ls -la "${BRIDGE}" >>"${OUT}" 2>&1 || say "bridge ls FAILED"
56
+ SO="${BRIDGE}/galaaz_gatekeeper.so"
57
+ say "gatekeeper: ${SO} exists=$([[ -f ${SO} ]] && echo YES || echo NO)"
58
+ fi
59
+
60
+ say ""
61
+ say "== galaaz doctor =="
62
+ {
63
+ command -v galaaz && galaaz doctor
64
+ [[ -x "${HOME}/.local/bin/galaaz" ]] && echo '--- ~/.local/bin/galaaz ---' && "${HOME}/.local/bin/galaaz" doctor
65
+ command -v mise && mise x ruby -- ruby -S galaaz doctor
66
+ } >>"${OUT}" 2>&1 || true
67
+
68
+ say ""
69
+ say "== profiles / blogs =="
70
+ ls -la "${HOME}/.config/galaaz/profiles" >>"${OUT}" 2>&1 || say "no profiles dir"
71
+ ls -la "${HOME}/galaaz-blogs" >>"${OUT}" 2>&1 || say "no galaaz-blogs"
72
+ say "install-core.log present=$([[ -f ${LOG_DIR}/install-core.log ]] && echo YES || echo NO)"
73
+
74
+ say ""
75
+ say "== prior install-core.log (tail 80) =="
76
+ if [[ -f "${LOG_DIR}/install-core.log" ]]; then
77
+ tail -n 80 "${LOG_DIR}/install-core.log" | tee -a "${OUT}"
78
+ else
79
+ say "(none yet — run omarchy-install-galaaz first)"
80
+ fi
81
+
82
+ for d in "${HOME}/Desktop" "${HOME}/desktop"; do
83
+ if [[ -d "${d}" ]]; then
84
+ cp "${OUT}" "${d}/galaaz-debug.log"
85
+ say "copied to ${d}/galaaz-debug.log"
86
+ fi
87
+ done
88
+
89
+ say ""
90
+ say "FULL DEBUG LOG: ${OUT}"
91
+ say "Paste that file contents back for diagnosis."
@@ -0,0 +1,176 @@
1
+ #!/bin/bash
2
+ # Omarchy wrapper for `galaaz add PROFILE`.
3
+ # - Installs system deps the gem cannot (e.g. pandoc for knit)
4
+ # - Keeps the TUI open on success/failure so errors are readable
5
+ #
6
+ # Usage: omarchy-galaaz-add knit|arrow|tex|bio|examples|ledger|demo
7
+ set -euo pipefail
8
+
9
+ PROFILE="${1:-}"
10
+ if [[ -z "${PROFILE}" ]]; then
11
+ echo "Usage: omarchy-galaaz-add <profile>"
12
+ echo "Profiles: knit arrow tex bio examples ledger demo"
13
+ exit 1
14
+ fi
15
+
16
+ GALAAZ="${HOME}/.local/bin/galaaz"
17
+ [[ -x "${GALAAZ}" ]] || GALAAZ="galaaz"
18
+
19
+ # Prefer user-local bin (installer / static pandoc land here).
20
+ export PATH="${HOME}/.local/bin:${PATH}"
21
+
22
+ # Official static release — avoid Arch extra/pandoc|pandoc-cli (pulls ~200 Haskell pkgs
23
+ # and often fails on TryOmarchy nested VMs).
24
+ # Default: latest GitHub release. Pin with PANDOC_RELEASE_VER=3.6.4 if needed.
25
+ latest_pandoc_ver() {
26
+ if [[ -n "${PANDOC_RELEASE_VER:-}" ]]; then
27
+ echo "${PANDOC_RELEASE_VER}"
28
+ return 0
29
+ fi
30
+ local ver
31
+ ver="$(
32
+ curl -fsSL https://api.github.com/repos/jgm/pandoc/releases/latest \
33
+ | sed -n 's/.*"tag_name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' \
34
+ | head -1
35
+ )"
36
+ if [[ -z "${ver}" ]]; then
37
+ echo "ERROR: could not resolve latest pandoc release from GitHub API" >&2
38
+ return 1
39
+ fi
40
+ echo "${ver}"
41
+ }
42
+
43
+ # Install pandoc without Arch's Haskell stack. Order:
44
+ # 1) already on PATH 2) AUR pandoc-bin 3) GitHub linux tarball → ~/.local/bin
45
+ ensure_pandoc() {
46
+ if command -v pandoc >/dev/null 2>&1; then
47
+ echo "pandoc: $(pandoc --version | head -1) (already installed)"
48
+ return 0
49
+ fi
50
+
51
+ echo "==> pandoc missing — installing (not Arch pandoc / pandoc-cli)"
52
+
53
+ if command -v omarchy-pkg-add >/dev/null 2>&1; then
54
+ echo "==> try: omarchy-pkg-add pandoc-bin"
55
+ if omarchy-pkg-add pandoc-bin && command -v pandoc >/dev/null 2>&1; then
56
+ echo "pandoc: $(pandoc --version | head -1) (pandoc-bin)"
57
+ return 0
58
+ fi
59
+ echo "WARN: pandoc-bin via omarchy-pkg-add failed; trying GitHub binary" >&2
60
+ elif command -v yay >/dev/null 2>&1; then
61
+ echo "==> try: yay -S pandoc-bin"
62
+ if yay -S --noconfirm --needed pandoc-bin && command -v pandoc >/dev/null 2>&1; then
63
+ echo "pandoc: $(pandoc --version | head -1) (pandoc-bin)"
64
+ return 0
65
+ fi
66
+ echo "WARN: yay pandoc-bin failed; trying GitHub binary" >&2
67
+ fi
68
+
69
+ local arch asset url tmp ver
70
+ case "$(uname -m)" in
71
+ x86_64|amd64) arch="amd64" ;;
72
+ aarch64|arm64) arch="arm64" ;;
73
+ *)
74
+ echo "ERROR: unsupported arch $(uname -m) for pandoc binary; install pandoc yourself" >&2
75
+ return 1
76
+ ;;
77
+ esac
78
+
79
+ if ! ver="$(latest_pandoc_ver)"; then
80
+ return 1
81
+ fi
82
+ echo "==> pandoc release: ${ver}"
83
+
84
+ asset="pandoc-${ver}-linux-${arch}.tar.gz"
85
+ url="https://github.com/jgm/pandoc/releases/download/${ver}/${asset}"
86
+ tmp="$(mktemp -d)"
87
+ echo "==> download: ${url}"
88
+ if ! curl -fsSL -o "${tmp}/${asset}" "${url}"; then
89
+ echo "ERROR: failed to download pandoc ${ver}" >&2
90
+ rm -rf "${tmp}"
91
+ return 1
92
+ fi
93
+ tar -xzf "${tmp}/${asset}" -C "${tmp}"
94
+ mkdir -p "${HOME}/.local/bin"
95
+ if ! cp "${tmp}/pandoc-${ver}/bin/pandoc" "${HOME}/.local/bin/pandoc"; then
96
+ echo "ERROR: pandoc binary missing from tarball" >&2
97
+ rm -rf "${tmp}"
98
+ return 1
99
+ fi
100
+ chmod +x "${HOME}/.local/bin/pandoc"
101
+ rm -rf "${tmp}"
102
+
103
+ if ! command -v pandoc >/dev/null 2>&1; then
104
+ echo "ERROR: pandoc still not on PATH after install to ~/.local/bin" >&2
105
+ return 1
106
+ fi
107
+ echo "pandoc: $(pandoc --version | head -1) (~/.local/bin, static)"
108
+ return 0
109
+ }
110
+
111
+ pause() {
112
+ local st=$1
113
+ echo
114
+ if [[ "${st}" -ne 0 ]]; then
115
+ echo "FAILED (exit ${st}). Read the messages above, then press Enter to close."
116
+ else
117
+ echo "OK. Press Enter to close."
118
+ fi
119
+ read -r _ || true
120
+ exit "${st}"
121
+ }
122
+
123
+ echo "=== galaaz add ${PROFILE} ==="
124
+ echo
125
+
126
+ case "${PROFILE}" in
127
+ knit)
128
+ # rmarkdown/gknit need system pandoc >= 2.8 — not shipped by CRAN packages alone.
129
+ echo "==> system: pandoc"
130
+ if ! ensure_pandoc; then
131
+ pause 1
132
+ fi
133
+ ;;
134
+ tex)
135
+ echo "==> system: pandoc (TinyTeX is installed by galaaz add tex)"
136
+ if ! ensure_pandoc; then
137
+ pause 1
138
+ fi
139
+ ;;
140
+ arrow|ledger|demo)
141
+ # R package arrow: do NOT rely on pacman "arrow" for linking — Arch libarrow
142
+ # often lags CRAN and breaks configure. galaaz add arrow sets LIBARROW_BINARY
143
+ # (Apache version-matched prebuilt). Export here too so a stale gem still works
144
+ # if the user only refreshed this wrapper.
145
+ export LIBARROW_BINARY=true
146
+ export NOT_CRAN=true
147
+ export LIBARROW_BUILD=false
148
+ export ARROW_USE_PKG_CONFIG=false
149
+ echo "==> arrow env: LIBARROW_BINARY=true LIBARROW_BUILD=false ARROW_USE_PKG_CONFIG=false"
150
+ ;;
151
+ bio|examples) ;;
152
+ *)
153
+ echo "Unknown profile: ${PROFILE}" >&2
154
+ pause 1
155
+ ;;
156
+ esac
157
+
158
+ echo "==> ${GALAAZ} add ${PROFILE}"
159
+ set +e
160
+ "${GALAAZ}" add "${PROFILE}"
161
+ st=$?
162
+ set -e
163
+
164
+ if [[ "${PROFILE}" == "knit" && "${st}" -eq 0 ]]; then
165
+ echo
166
+ echo "Try: gknit ~/galaaz-blogs/oh_my/oh_my.Rmd"
167
+ echo "Or menu: Knit demo (oh_my)"
168
+ fi
169
+
170
+ if [[ "${PROFILE}" == "ledger" && "${st}" -eq 0 ]]; then
171
+ echo
172
+ echo "Try: cd ~/r_on_rails_ledger && bin/dev"
173
+ echo "Then http://localhost:3000 — portfolio → Run stress test"
174
+ fi
175
+
176
+ pause "${st}"