spinel_kit 0.2.0 → 0.3.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.
data/lib/spinel_kit.rb DELETED
@@ -1,45 +0,0 @@
1
- # SpinelKit -- the Spinel stdlib-surface gem.
2
- #
3
- # A pure-Ruby, Spinel-safe toolkit holding the generic "stdlib substitute"
4
- # shims that every Spinel-compiled project would otherwise hand-roll. Spinel
5
- # (the Ruby->native AOT compiler) cannot lower large chunks of CRuby stdlib
6
- # -- the `json` gem's C-ext fast path and metaprogrammed pure-Ruby fallback,
7
- # stdlib `Logger`, C-ext git bindings -- and the spinelgems compatibility
8
- # catalog confirms there is no verified gem to reuse for any of them. So this
9
- # gem consolidates the shims toy and tep each grew independently:
10
- #
11
- # SpinelKit::Json -- JSON encoders (json.rb) + flat-key decoders
12
- # (json_decoder.rb).
13
- # SpinelKit::Json::Builder -- incremental ordered-object builder.
14
- # SpinelKit::Hex -- hex digit/byte encode + decode.
15
- # SpinelKit::Url -- percent-encode/decode + form-query + URL split.
16
- # SpinelKit::Git -- git provenance from .git/HEAD (was Toy::Git).
17
- # SpinelKit::Log -- minimal levelled logger (was Tep::Logger).
18
- #
19
- # MINIMAL-SURFACE REQUIRING. This umbrella requires everything for
20
- # convenience (and for CRuby use). But because Spinel compiles every loaded
21
- # method with no tree-shaking, a Spinel-compiled consumer should require ONLY
22
- # the file(s) it uses, to avoid compiling -- and degrading -- code it never
23
- # calls:
24
- #
25
- # require "spinel_kit/json" # encoders
26
- # require "spinel_kit/json_decoder" # decoders (require alongside json if you decode)
27
- # require "spinel_kit/json_builder" # builder
28
- # require "spinel_kit/hex" # hex digit/byte codec
29
- # require "spinel_kit/url" # percent-codec + query (pulls in hex)
30
- # require "spinel_kit/git"
31
- # require "spinel_kit/log"
32
- #
33
- # No native extension (spinel-ext.json is []), no runtime dependencies. See
34
- # docs/adoption.md and docs/spinel-discipline.md.
35
- require_relative "spinel_kit/version"
36
- require_relative "spinel_kit/json"
37
- require_relative "spinel_kit/json_decoder"
38
- require_relative "spinel_kit/json_builder"
39
- require_relative "spinel_kit/hex"
40
- require_relative "spinel_kit/url"
41
- require_relative "spinel_kit/git"
42
- require_relative "spinel_kit/log"
43
-
44
- module SpinelKit
45
- end
@@ -1,15 +0,0 @@
1
- # Advisory RBS for SpinelKit::Json encoders (lib/spinel_kit/json.rb).
2
- # Decoders are in json_decoder.rbs; the builder in json_builder.rbs.
3
- module SpinelKit
4
- class Json
5
- def self.escape: (String s) -> String
6
- def self.hex2: (Integer n) -> String
7
- def self.quote: (String s) -> String
8
- def self.encode_pair_str: (String k, String v) -> String
9
- def self.encode_pair_int: (String k, Integer v) -> String
10
- def self.from_str_hash: (Hash[String, String] h) -> String
11
- def self.from_int_hash: (Hash[String, Integer] h) -> String
12
- def self.from_str_array: (Array[String] a) -> String
13
- def self.from_int_array: (Array[Integer] a) -> String
14
- end
15
- end
@@ -1,19 +0,0 @@
1
- module SpinelKit
2
- class Json
3
- class Builder
4
- def initialize: () -> void
5
- def add_str: (String key, String value) -> String
6
- def add_num: (String key, untyped value) -> String
7
- def add_bool: (String key, bool value) -> String
8
- def add_raw: (String key, String raw) -> String
9
- def add_obj: (String key, SpinelKit::Json::Builder child) -> String
10
- def dump: () -> String
11
- def comma: () -> void
12
-
13
- # self-contained escapers (byte-identical to SpinelKit::Json.*)
14
- def self.quote: (String s) -> String
15
- def self.escape: (String s) -> String
16
- def self.hex2: (Integer n) -> String
17
- end
18
- end
19
- end
@@ -1,21 +0,0 @@
1
- # Advisory RBS for SpinelKit::Json decoders (lib/spinel_kit/json_decoder.rb).
2
- module SpinelKit
3
- class Json
4
- def self.get_str: (String s, String key) -> String
5
- def self.get_int: (String s, String key) -> Integer
6
- def self.get_float: (String s, String key) -> Float
7
- def self.get_int_array: (String s, String key) -> Array[Integer]
8
- def self.has_key?: (String s, String key) -> bool
9
-
10
- # internal walkers
11
- def self.skip_ws: (String s, Integer pos) -> Integer
12
- def self.skip_str: (String s, Integer pos) -> Integer
13
- def self.skip_value: (String s, Integer pos) -> Integer
14
- def self.skip_container: (String s, Integer pos) -> Integer
15
- def self.parse_str_value: (String s, Integer pos) -> String
16
- def self.hex_nibble: (String c) -> Integer
17
- def self.byte_to_chr: (Integer n) -> String
18
- def self.parse_int_value: (String s, Integer pos) -> Integer
19
- def self.find_value_start: (String s, String target_key) -> Integer
20
- end
21
- end
File without changes
File without changes