multidocs 0.1.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: d844c134d8baeff6c16b4caf101d369dc336d0a9d8bab33332818ebd1f4ee68c
4
+ data.tar.gz: aa3a8cd083858183b215a8af0646f26bc057b20d072229aecc282b2e4c6fa3d9
5
+ SHA512:
6
+ metadata.gz: 50dc01330e2e065f3eccd36380602ac6e4988cbc2b4bb7ddeba89b2595687286f145a224e980833675b733234b7cfa8b60e49a134c978b48406db0c5820b9497
7
+ data.tar.gz: 229ec459e9217793e33ad56bd3e5e8c0639bbb09061899fdd16e0c6779190bc5b9436b7e9d80edef2f62e30327bc2eba736267ffb513c5313280ebe3fd1aee3a
data/README.md ADDED
@@ -0,0 +1,14 @@
1
+ <!-- copyright (c) 2026, Nashi Uso, (嘘無し). -->
2
+
3
+ # multidocs
4
+
5
+ kujo documentation toolchain cli.
6
+
7
+ ```
8
+ gem install multidocs
9
+
10
+ multidocs build # runs the rust helper binary
11
+ multidocs serve # serves ../public_html on :8080
12
+ ```
13
+
14
+ env: `MULTIDOCS_BIN` (rust binary path) · `MULTIDOCS_ROOT` (html dir) · `MULTIDOCS_PORT`.
data/exe/multidocs ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # copyright (c) 2026, Nashi Uso, (嘘無し).
3
+ # frozen_string_literal: true
4
+
5
+ require_relative "../lib/multidocs/cli"
6
+
7
+ exit Multidocs::CLI.new(ARGV).run
@@ -0,0 +1,96 @@
1
+ # Copyright (c) 2026,
2
+ # Nashi Uso , (嘘無し) .
3
+
4
+ # frozen_string_literal: true
5
+
6
+ require "webrick"
7
+ require_relative "version"
8
+
9
+ module Multidocs
10
+ # command dispatcher for the multidocs executable.
11
+ class CLI
12
+ USAGE = <<~TEXT
13
+ multidocs #{VERSION} — kujo documentation toolchain
14
+
15
+ usage:
16
+ multidocs build run the rust helper binary (multidocs --version)
17
+ multidocs serve serve ../public_html on http://localhost:8080
18
+ multidocs help show this message
19
+ TEXT
20
+
21
+ # candidate locations for the rust binary, first match wins:
22
+ # 1. MULTIDOCS_BIN env override
23
+ # 2. dev build inside the repo (rust/target/release)
24
+ # 3. release binary dropped next to the gem
25
+ # 4. anything on PATH named multidocs-bin
26
+ BINARY_CANDIDATES = [
27
+ ENV["MULTIDOCS_BIN"],
28
+ File.expand_path("../../../rust/target/release/multidocs", __dir__),
29
+ File.expand_path("../../bin/multidocs-bin", __dir__),
30
+ "multidocs-bin"
31
+ ].compact.freeze
32
+
33
+ DEFAULT_PORT = 8080
34
+
35
+ def initialize(argv)
36
+ @argv = argv
37
+ end
38
+
39
+ def run
40
+ case @argv.first
41
+ when "build" then build
42
+ when "serve" then serve
43
+ when "help", "-h", "--help", nil then puts USAGE
44
+ else
45
+ warn "multidocs: unknown command #{@argv.first.inspect}"
46
+ warn USAGE
47
+ 1
48
+ end || 0
49
+ end
50
+
51
+ private
52
+
53
+ def build
54
+ binary = BINARY_CANDIDATES.find { |candidate| executable?(candidate) }
55
+ unless binary
56
+ warn "multidocs: rust binary not found."
57
+ warn " build it with: cd rust && cargo build --release"
58
+ warn " or point MULTIDOCS_BIN at a release binary."
59
+ return 1
60
+ end
61
+
62
+ puts "multidocs: running #{binary}"
63
+ system(binary, "--version") ? 0 : 1
64
+ end
65
+
66
+ def serve
67
+ root = public_html_dir
68
+ unless Dir.exist?(root)
69
+ warn "multidocs: #{root} not found."
70
+ warn " generate it with: cd astro-site && npm install && npm run build"
71
+ return 1
72
+ end
73
+
74
+ port = Integer(ENV.fetch("MULTIDOCS_PORT", DEFAULT_PORT))
75
+ puts "multidocs: serving #{root} on http://localhost:#{port} (ctrl+c to stop)"
76
+
77
+ server = WEBrick::HTTPServer.new(Port: port, DocumentRoot: root, AccessLog: [])
78
+ trap("INT") { server.shutdown }
79
+ server.start
80
+ 0
81
+ end
82
+
83
+ def public_html_dir
84
+ ENV["MULTIDOCS_ROOT"] || File.expand_path("../../../public_html", __dir__)
85
+ end
86
+
87
+ def executable?(candidate)
88
+ return false unless candidate
89
+ return true if File.executable?(candidate)
90
+
91
+ # PATH lookup for bare names.
92
+ !candidate.include?(File::SEPARATOR) &&
93
+ ENV["PATH"].split(File::PATH_SEPARATOR).any? { |dir| File.executable?(File.join(dir, candidate)) }
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,8 @@
1
+ # Copyright (c) 2026,
2
+ # Nashi Uso , (嘘無し) .
3
+
4
+ # frozen_string_literal: true
5
+
6
+ module Multidocs
7
+ VERSION = "0.1.0"
8
+ end
metadata ADDED
@@ -0,0 +1,48 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: multidocs
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Nashi Uso
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: 'small cli around the kujo docs pipeline: `multidocs build` runs the
13
+ rust helper binary, `multidocs serve` serves the generated public_html folder.'
14
+ email:
15
+ - corrimosdelagente@proton.me
16
+ executables:
17
+ - multidocs
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - README.md
22
+ - exe/multidocs
23
+ - lib/multidocs/cli.rb
24
+ - lib/multidocs/version.rb
25
+ homepage: https://github.com/nashiuso/kujo
26
+ licenses:
27
+ - MIT
28
+ metadata:
29
+ homepage_uri: https://github.com/nashiuso/kujo
30
+ source_code_uri: https://github.com/nashiuso/kujo
31
+ rdoc_options: []
32
+ require_paths:
33
+ - lib
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '3.0'
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ requirements: []
45
+ rubygems_version: 3.6.7
46
+ specification_version: 4
47
+ summary: kujo multidocs cli — build and serve the multi-language documentation site.
48
+ test_files: []