ruby_wasm_ic_minimal 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6664c0bc3baf20513dd6d0ed532aa5c76ea4abcb9b9bfede49339ba39d640229
4
- data.tar.gz: abd4ef6d17e0156aee54f49c7a238ac8c1086f75eabbb3e555b47482e6f38461
3
+ metadata.gz: ec77f2557db01db1a97c96d08751b203e95ebfa7db7217ff1b3f67b51e05ca39
4
+ data.tar.gz: a9a9dd670682a708fc45bebfa5a2702de79b9a510f9108fa58a736eb3c76fd1d
5
5
  SHA512:
6
- metadata.gz: b409889a4046742e044c659be7706b938f22f3e346f4ff26d046d0e01511f576889c90868936465ad66fca974b33e120745f5954b95dbed9559dcd4f0bca9034
7
- data.tar.gz: 5025f7dfc9334411badfa20a81f74e4db920e85f9ea95d30acabf2e9e14b9a2fb2278bdae46567a623158390252d2891c08da5b190e7905cd2beccad341eb3b7
6
+ metadata.gz: 9dff7b596597d900d5135359320342d09ad71984545d58d7138980ed5c1d3d746d6cb2b3189ea8558a8614c3e8c5ff68dc3c463ebc5cbe28dfeeb9926dcaf1b8
7
+ data.tar.gz: 7ea956967aaaee9a397c2d110c91df44526fa3b29c95a4f4c7ccd46f5764e23cd38bbd95af411409f33a4ab434f7288a36d089851069b450a80384937ac8dfd8
data/README.md CHANGED
@@ -24,11 +24,15 @@ formats and reads HTTP dates, which need nothing from `Date`; `Time.parse`,
24
24
  name, and `date.rb` is a stub. So every file refuses to load anywhere but a
25
25
  `minimal` canister, raising `LoadError`. A `minimal` canister is one where the
26
26
  builder's wrapper gem has defined `IC::DATA_DIR` and the core registered no
27
- alias for any encoding (`Encoding.name_list.size == Encoding.list.size`).
28
- Observed on PocketIC with the 0.6.0 Base Module (28 October 2026): twelve
27
+ alias for any encoding: `Encoding.name_list` is `Encoding.list`'s names, once
28
+ the pseudo-names `locale`, `external`, `filesystem` and `internal` are left
29
+ out. Observed on PocketIC with the 0.6.0 Base Module (28 October 2026): twelve
29
30
  encodings, the core's built-in table, and no alias, which is why
30
- `# encoding: binary` traps there. MRI and the `full` Build register aliases,
31
- so it refuses there too: carry none of it on `full`.
31
+ `# encoding: binary` traps there. The pseudo-names appear when
32
+ `Encoding.default_external` or `default_internal` is set, by the Application
33
+ or (from ruby_wasm_builder's 0.9.0) by the Base Module at boot, and they are
34
+ not aliases. MRI and the `full` Build register real aliases (`BINARY`,
35
+ `ASCII`, ...), so it refuses there too: carry none of it on `full`.
32
36
 
33
37
  ## Carrying it
34
38
 
@@ -55,17 +59,18 @@ in a `minimal` canister. After it, Rack's own `require "strscan"` and `time`'s
55
59
 
56
60
  ## Development
57
61
 
58
- This repository is the gem's source. The
59
- [ruby_wasm_builder](https://gitlab.com/phrug/ruby_wasm_builder) suite tests the
60
- published gem (its `spec/gems/`): the guard on MRI, the stand-ins traced
61
- against CRuby's C extensions, and the 0.7.0 `roda_on_minimal` Script played as
62
- `minimal` with this gem in place of the Challenge's own `carried/` files. To
63
- release: bump `lib/ruby_wasm_ic_minimal/version.rb`, then `gem build
64
- ruby_wasm_ic_minimal.gemspec` and check `gem spec ruby_wasm_ic_minimal-*.gem
65
- files` lists the lib files before `gem push`.
62
+ `ruby test/guard_test.rb` runs this repository's own tests of the guard, on
63
+ MRI with plain Ruby. More comprehensive testing is done on this gem's primary consumer:
64
+ [ruby_wasm_builder](https://gitlab.com/phrug/ruby_wasm_builder) (in `spec/gems/`): the guard on MRI
66
65
 
67
66
  ## Changes
68
67
 
68
+ - **0.1.4:** the guard leaves the pseudo-names `locale`, `external`,
69
+ `filesystem` and `internal` out of its count. 0.1.3 counted them, so it
70
+ refused a canister where `Encoding.default_external` had been set before
71
+ the first stand-in loaded (as an Application or Rails may do), and it
72
+ refuses every canister of ruby_wasm_builder's 0.9.0, whose Base Module sets
73
+ it at boot. **Use 0.1.4 or later.**
69
74
  - **0.1.3:** the stand-ins moved under `lib/ruby_wasm_ic_minimal/standins/`,
70
75
  put on `$LOAD_PATH` by `require "ruby_wasm_ic_minimal"`, so a Gemfile that
71
76
  lists the gem shadows nothing; the guard's rule is "no aliases". **Use
@@ -73,7 +78,5 @@ files` lists the lib files before `gem push`.
73
78
  `require "stringio"` on MRI finds the stand-in and raises.
74
79
  - **0.1.2:** the guard asks for `ISO-8859-1` by name, and loads on a
75
80
  `minimal` canister. The stand-ins are still at the top of `lib/`.
76
- - **0.1.1:** the first release with files.
77
- - **0.1.0:** published empty (no `spec.files`).
78
81
 
79
82
  MIT licensed.
@@ -9,7 +9,7 @@
9
9
  # A `minimal` canister is one where the wrapper gem has defined IC::DATA_DIR
10
10
  # (every canister packed by ruby_wasm_builder) and the core registered no
11
11
  # alias for any encoding: `Encoding.name_list` is exactly `Encoding.list`'s
12
- # names. Observed on PocketIC 16.0.0 with the 0.6.0 Base Module (28 October
12
+ # names, once the four pseudo-names are left out (PSEUDO_NAMES, below). Observed on PocketIC 16.0.0 with the 0.6.0 Base Module (28 October
13
13
  # 2026): twelve encodings, the core's built-in table, and twelve names, no
14
14
  # alias among them, which is why `# encoding: binary` traps there. MRI, and a
15
15
  # Build that links the encoding database (`full`), register aliases (BINARY,
@@ -18,14 +18,28 @@
18
18
  # against 3 and refused on every canister; 0.1.2 asked for `ISO-8859-1` by
19
19
  # name, which held on a canister too.
20
20
  #
21
+ # Since 0.1.4 the four pseudo-names CRuby registers for a setting are not
22
+ # counted: `locale` (`rb_locale_encoding`), `external` and `filesystem`
23
+ # (`Encoding.default_external=`) and `internal` (`Encoding.default_internal=`,
24
+ # as Rails's `config.encoding` sets it). They name a setting, not an alias of
25
+ # the encoding table. 0.1.3 counted them, so an Application that set
26
+ # `default_external` before the first stand-in loaded was refused on a
27
+ # canister (W32, observed on the 0.8.0 Release: 12 encodings, 14 names), and a
28
+ # Base Module that sets it at boot, as `ruby` does from the locale, would have
29
+ # been refused always. MRI still has its real aliases (BINARY, ASCII,
30
+ # CP65001, ...), so it is still refused.
31
+ #
21
32
  # It counts names rather than looking for Encoding::UTF_8, which this gem's
22
33
  # own encoding_constants.rb defines, and defining a constant adds no name.
23
34
  # Decided once, at the first stand-in loaded, and kept in
24
35
  # RubyWasmIcMinimal::ON_MINIMAL; a test harness may set that constant first
25
36
  # (ruby_wasm_builder's MRI player does, for `minimal: true`).
26
37
  module RubyWasmIcMinimal
38
+ # The names CRuby registers for a setting rather than as an alias.
39
+ PSEUDO_NAMES = %w[locale external filesystem internal].freeze
40
+
27
41
  unless const_defined?(:ON_MINIMAL, false)
28
- ON_MINIMAL = !defined?(IC::DATA_DIR).nil? && Encoding.name_list.size == Encoding.list.size
42
+ ON_MINIMAL = !defined?(IC::DATA_DIR).nil? && (Encoding.name_list - PSEUDO_NAMES).size == Encoding.list.size
29
43
  end
30
44
 
31
45
  # `feature` is the library a stand-in stands in for, or nil for the entry
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyWasmIcMinimal
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_wasm_ic_minimal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - graial
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-28 00:00:00.000000000 Z
11
+ date: 2026-10-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This gem contains the four carried files required for running rack and
14
14
  roda on the minimal ruby.wasm build.