kuu 0.0.1
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 +7 -0
- data/LICENSE +21 -0
- data/README.md +18 -0
- data/lib/kuu.rb +40 -0
- metadata +50 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 491f39994ae5976a4be2d0b3e4b8cd346a2b5e0a228102aac381ab54ee450e05
|
|
4
|
+
data.tar.gz: 831685de3579171ade5dbdb5a395543f577992e19cffb23b0d34cba5dc37ad4e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 2dd1d4fb6c8074424b4a98904c79dd2095bf0bf419be6b9aed2677784f4db159c1a9c7251ed62b480438f2ce5b2cd3b31ef0ec781f187fd745d80104cdc4c6e0
|
|
7
|
+
data.tar.gz: 87cc8e8d84a46d0d50041cc3f734fb5970f8be611b3ddf66266f6d8ef6114d81c8b0f635819adc85b8e7b833476db484d9c73578dc157ef1f339648b6f32ea5b
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Yoshiaki Kawazu
|
|
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,18 @@
|
|
|
1
|
+
# kuu (Ruby binding)
|
|
2
|
+
|
|
3
|
+
**Early placeholder** for the Ruby binding of [kuu](https://github.com/kawaz/kuu) — a language-agnostic CLI argument definition specification.
|
|
4
|
+
|
|
5
|
+
kuu defines CLI argument parsing as a *specification* (wire-format JSON definitions + conformance fixtures), with a reference implementation in MoonBit ([kuu.mbt](https://github.com/kawaz/kuu.mbt)) and a CLI frontend ([kuu-cli](https://github.com/kawaz/kuu-cli)).
|
|
6
|
+
|
|
7
|
+
## Current state (v0.0.x)
|
|
8
|
+
|
|
9
|
+
This package currently provides:
|
|
10
|
+
|
|
11
|
+
- `kuu::version()` — the package version
|
|
12
|
+
- `kuu::cli::run(args)` / `kuu::cli::parse(definition_json, args)` — thin wrappers that delegate to a `kuu-cli` binary found on `PATH`
|
|
13
|
+
|
|
14
|
+
A native Rust implementation of the kuu spec is planned; this package name hosts the binding so that the API can grow in place. If `kuu-cli` is not installed, calls return a descriptive error explaining how to get it.
|
|
15
|
+
|
|
16
|
+
## Spec
|
|
17
|
+
|
|
18
|
+
See the specification repository for the definition format, design records and conformance fixtures: https://github.com/kawaz/kuu
|
data/lib/kuu.rb
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Ruby binding for the kuu CLI-argument-definition spec (early placeholder).
|
|
2
|
+
# kuu is a language-agnostic specification (https://github.com/kawaz/kuu).
|
|
3
|
+
# This version delegates to the `kuu-cli` reference binary on PATH.
|
|
4
|
+
require "open3"
|
|
5
|
+
require "tempfile"
|
|
6
|
+
|
|
7
|
+
module Kuu
|
|
8
|
+
VERSION = "0.0.1"
|
|
9
|
+
|
|
10
|
+
class Error < StandardError; end
|
|
11
|
+
class CliNotFound < Error
|
|
12
|
+
def initialize(msg = "kuu-cli not found on PATH. Install it from https://github.com/kawaz/kuu-cli (this early version of the kuu gem delegates to the reference CLI)")
|
|
13
|
+
super
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
class CliFailed < Error; end
|
|
17
|
+
|
|
18
|
+
def self.version
|
|
19
|
+
VERSION
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Run kuu-cli with raw arguments, returning stdout on success.
|
|
23
|
+
def self.run(*args)
|
|
24
|
+
out, err, status = Open3.capture3("kuu-cli", *args)
|
|
25
|
+
raise CliFailed, err unless status.success?
|
|
26
|
+
out
|
|
27
|
+
rescue Errno::ENOENT
|
|
28
|
+
raise CliNotFound
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Parse args against a kuu wire-format definition (JSON string),
|
|
32
|
+
# returning the outcome JSON produced by `kuu parse`.
|
|
33
|
+
def self.parse(definition_json, args)
|
|
34
|
+
Tempfile.create(["kuu-def", ".json"]) do |f|
|
|
35
|
+
f.write(definition_json)
|
|
36
|
+
f.flush
|
|
37
|
+
return run("parse", f.path, "--", *args)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: kuu
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Yoshiaki Kawazu
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-07-18 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: Ruby binding for the kuu specification (https://github.com/kawaz/kuu).
|
|
14
|
+
This early version delegates to the kuu-cli reference binary; a native implementation
|
|
15
|
+
is planned to grow under this name. Reserved by the spec author.
|
|
16
|
+
email:
|
|
17
|
+
executables: []
|
|
18
|
+
extensions: []
|
|
19
|
+
extra_rdoc_files: []
|
|
20
|
+
files:
|
|
21
|
+
- LICENSE
|
|
22
|
+
- README.md
|
|
23
|
+
- lib/kuu.rb
|
|
24
|
+
homepage: https://github.com/kawaz/kuu
|
|
25
|
+
licenses:
|
|
26
|
+
- MIT
|
|
27
|
+
metadata:
|
|
28
|
+
source_code_uri: https://github.com/kawaz/kuu
|
|
29
|
+
homepage_uri: https://github.com/kawaz/kuu
|
|
30
|
+
post_install_message:
|
|
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.0.3.1
|
|
46
|
+
signing_key:
|
|
47
|
+
specification_version: 4
|
|
48
|
+
summary: Language-agnostic CLI argument definition spec — Ruby binding (early placeholder
|
|
49
|
+
wrapping the kuu-cli reference binary)
|
|
50
|
+
test_files: []
|