galaaz 2.1.5 → 2.1.6

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 (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/lib/galaaz/cli.rb +51 -1
  4. data/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d39a98e695448ffb0166d33746445cc0076efcbd15e6f34250c99512e7c8e71d
4
- data.tar.gz: eff6228e3febeb502838f1a6b99e38d03186327678b1a5535e58e8548e516d72
3
+ metadata.gz: e648f82c6009651209b9d83f4679a394c1bb37aedaaeab41fc35edbe4a87245b
4
+ data.tar.gz: '097fec3901ebd4e65d8df655fb365ebae90478c04cada0bd48778fafb2ea7c19'
5
5
  SHA512:
6
- metadata.gz: ffe309c54323c08acabe1752c677cd67090878170b33853eb739195f4be36450379b2e100dc5e9ecfa317e4e4373aed8082dfee8407bb5231cd1d5b41c6fbdf2
7
- data.tar.gz: daef47d66a2f3c20e2e430797ffd6193e9d80cde6ffc9b82856835dab4c0a3e3f8833b17d1b6b3389e4e5e3c5a7cccba8aee42d9b023b2e110758b6e678e9a2c
6
+ metadata.gz: cc861f04cd57d1730ef7228dc9328a88bf951fd2e49fd704d9198a08a5f2410289cc976d83e05682682bbf136e66e6a0d81bad79e30f6e16fc72c4770e3492c9
7
+ data.tar.gz: 658fab7d7dcdcd023679439111e15dcdee4ba5a565170fc9b50586687d26b40ca14a508f42e0a181f924c2c1465fa25bd7b13812f0817a7ea702122b741ce995
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.1.6
4
+
5
+ ### Fixed
6
+
7
+ - `galaaz blogs init` and `galaaz add tex` install `sty/galaaz.sty` next to the blogs
8
+ tree (e.g. `~/sty/galaaz.sty` for `~/galaaz-blogs`) so PDF `in_header: ../../sty/…`
9
+ works without a manual copy.
10
+ - `galaaz add tex` links TinyTeX `pdflatex` (and related tools) into `~/.local/bin` when
11
+ they are not already on PATH (Omarchy / TryOmarchy).
12
+
13
+ ### Changed
14
+
15
+ - `galaaz doctor` reports `sty` and `pdflatex` status.
16
+
3
17
  ## 2.1.5
4
18
 
5
19
  ### Fixed
data/lib/galaaz/cli.rb CHANGED
@@ -63,8 +63,9 @@ module Galaaz
63
63
  Commands:
64
64
  setup Build the NewBridge gatekeeper; ensure Rcpp
65
65
  blogs init [DIR] Copy blog sources (default: ~/galaaz-blogs)
66
+ and sty/galaaz.sty for PDF headers
66
67
  Options: --force
67
- doctor Report Ruby, R, gatekeeper, Rcpp, profiles
68
+ doctor Report Ruby, R, gatekeeper, Rcpp, sty, profiles
68
69
  add PROFILE Install an add-on (idempotent)
69
70
  Profiles: #{PROFILES.join(', ')}
70
71
 
@@ -133,6 +134,7 @@ module Galaaz
133
134
  end
134
135
 
135
136
  File.write(File.join(dest, BLOGS_MARKER), "galaaz blogs init\n")
137
+ install_galaaz_sty_for_blogs!(dest)
136
138
  puts "galaaz blogs init: #{dest}"
137
139
  puts "You can now knit with gknit (after: galaaz add knit)"
138
140
  0
@@ -158,10 +160,17 @@ module Galaaz
158
160
 
159
161
  blogs = detect_blogs_dir
160
162
  puts " blogs: #{blogs || '(not initialized)'}"
163
+ if blogs
164
+ sty = File.join(File.dirname(blogs), 'sty', 'galaaz.sty')
165
+ puts " sty: #{File.file?(sty) ? sty : "MISSING (expected #{sty} for PDF blogs)"}"
166
+ end
161
167
 
162
168
  profiles = listed_profiles
163
169
  puts " profiles: #{profiles.empty? ? '(none)' : profiles.join(', ')}"
164
170
 
171
+ pdf = command_present?('pdflatex')
172
+ puts " pdflatex: #{pdf ? `pdflatex --version 2>/dev/null`.lines.first.to_s.strip : 'MISSING (galaaz add tex)'}"
173
+
165
174
  setup_ok = r_ok && rs_ok && File.file?(so) && rcpp
166
175
  puts setup_ok ? 'galaaz doctor: setup OK' : 'galaaz doctor: setup INCOMPLETE'
167
176
  setup_ok ? 0 : 1
@@ -356,6 +365,9 @@ module Galaaz
356
365
  puts 'galaaz add tex: running bin/install-tinytex'
357
366
  ok = system(script)
358
367
  abort_unless(ok, 'TinyTeX install failed')
368
+ ensure_pdflatex_on_path!
369
+ # Blog PDFs use in_header: ../../sty/galaaz.sty → sibling of galaaz-blogs.
370
+ install_galaaz_sty_for_blogs!(detect_blogs_dir || DEFAULT_BLOGS_DIR)
359
371
  mark_profile!('tex')
360
372
  puts 'galaaz add tex: OK'
361
373
  0
@@ -595,5 +607,43 @@ module Galaaz
595
607
  end
596
608
  nil
597
609
  end
610
+
611
+ # PDF YAML uses in_header: "../../sty/galaaz.sty" relative to blogs/<name>/.
612
+ # For ~/galaaz-blogs/oh_my that resolves to ~/sty/galaaz.sty.
613
+ def install_galaaz_sty_for_blogs!(blogs_dest)
614
+ src = File.join(root, 'sty', 'galaaz.sty')
615
+ abort_unless(File.file?(src), "missing #{src} in gem")
616
+ sty_dir = File.join(File.dirname(File.expand_path(blogs_dest)), 'sty')
617
+ FileUtils.mkdir_p(sty_dir)
618
+ dest = File.join(sty_dir, 'galaaz.sty')
619
+ FileUtils.cp(src, dest)
620
+ puts "galaaz sty: #{dest}"
621
+ dest
622
+ end
623
+
624
+ # TinyTeX installs to ~/.TinyTeX and often ~/bin; Omarchy PATH prefers ~/.local/bin.
625
+ def ensure_pdflatex_on_path!
626
+ return if command_present?('pdflatex')
627
+
628
+ candidates = Dir.glob(File.expand_path('~/.TinyTeX/bin/*/pdflatex'))
629
+ home_bin = File.expand_path('~/bin/pdflatex')
630
+ candidates << home_bin if File.executable?(home_bin)
631
+ pdf = candidates.find { |p| File.executable?(p) }
632
+ unless pdf
633
+ warn 'galaaz add tex: pdflatex not found after TinyTeX install; check ~/.TinyTeX'
634
+ return
635
+ end
636
+
637
+ local_bin = File.expand_path('~/.local/bin')
638
+ FileUtils.mkdir_p(local_bin)
639
+ %w[pdflatex xelatex lualatex tlmgr].each do |name|
640
+ src = File.join(File.dirname(pdf), name)
641
+ next unless File.executable?(src)
642
+
643
+ link = File.join(local_bin, name)
644
+ FileUtils.ln_sf(src, link)
645
+ end
646
+ puts "galaaz add tex: linked TeX tools into #{local_bin}"
647
+ end
598
648
  end
599
649
  end
data/version.rb CHANGED
@@ -1,2 +1,2 @@
1
1
  $gem_name = "galaaz"
2
- $version="2.1.5"
2
+ $version="2.1.6"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: galaaz
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.5
4
+ version: 2.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Botafogo
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-09-07 00:00:00.000000000 Z
10
+ date: 2026-09-08 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: msgpack