syntropy 0.55.0 → 0.55.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7a3a2c629bb6813de3a542947b74922cc9249bce4745d2a8f7e6afe2fb09856
4
- data.tar.gz: 6104bf7c532a05e720ed441d9eb356d2041ee0a280e32ed904cf37ac346625b8
3
+ metadata.gz: 54653d185c0731b7355b83a92f25d15e9e61b6a21a46824f152db99e697c60c3
4
+ data.tar.gz: e8c9d61ddaaea29fa3877cfe15ad5034a3301c3702a8d91e8740306bbf7b76fe
5
5
  SHA512:
6
- metadata.gz: c460abb65dd668c39c2f197b13fc5f3f3f2571da354be44d0e2b927b6fcad2699e20ec501fe0d19074441902df152767cfe66c533b53a74ff596778dda39d716
7
- data.tar.gz: e018f96ebafe0ab53c17d812c34958715f6a4cfcd6275deb6f77268781ed88659205430f84f3551dde0e29f33f7ae2d467a86387a00437070d7f7bcc5f75bcd4
6
+ metadata.gz: 6e0d47dbeca935d3f90641a00d350092956741828cdc395cb65d95f34d63eae91d0766df747103abbdd9027327eb1a2213abe79dbac88f128a136cb45c340bf2
7
+ data.tar.gz: 7a48ee09fd64eab3626d8b552295650b9036d6b3b8254c758e08da53cc20563dbb8cb678f386ec3808e62baef17a9e7016c503161fd61487af92f3a66b47b095
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.55.1 2026-11-21
2
+
3
+ - Remove superfluous `on_load` hook
4
+
1
5
  # 0.55.0 2026-11-21
2
6
 
3
7
  - Add `on_load`, `on_unload` hooks to modules
@@ -73,16 +73,12 @@ end
73
73
 
74
74
  @board_updates = @machine.broadcaster
75
75
  @board = setup_board
76
-
77
- on_load {
78
- update_fiber = @machine.spin do
79
- @machine.periodically(0.1) {
80
- @board = next_generation(@board)
81
- @board_updates.broadcast(@board)
82
- }
83
- end
76
+ update_fiber = @machine.spin {
77
+ @machine.periodically(0.1) {
78
+ @board = next_generation(@board)
79
+ @board_updates.broadcast(@board)
80
+ }
84
81
  }
85
-
86
82
  on_unload { @machine.terminate(update_fiber) }
87
83
 
88
84
  # Populate board
@@ -2,18 +2,13 @@ game = import '/_lib/game'
2
2
  template = import '/_templates/board'
3
3
 
4
4
  html_updates = @machine.broadcaster
5
-
6
- on_load {
7
- update_fiber = @machine.spin {
8
- game.board_updates.each { |board|
9
- html_updates.broadcast(template.render(board))
10
- }
5
+ update_fiber = @machine.spin {
6
+ game.board_updates.each { |board|
7
+ html_updates.broadcast(template.render(board))
11
8
  }
12
9
  }
13
10
 
14
- on_unload {
15
- @machine.terminate(update_fiber)
16
- }
11
+ on_unload { @machine.terminate(update_fiber) }
17
12
 
18
13
  export ->(req) {
19
14
  req.validate_http_method('get')
@@ -306,7 +306,6 @@ module Syntropy
306
306
 
307
307
  apply_extensions(extensions)
308
308
  instance_eval(code, fn)
309
- __invoke_on_load_hook__
310
309
  end
311
310
 
312
311
  attr_reader :__export_value__, :__dependencies__
@@ -319,13 +318,6 @@ module Syntropy
319
318
  @collection_module_p
320
319
  end
321
320
 
322
- # Invokes the module's on_load hook if set
323
- #
324
- # @return [void]
325
- def __invoke_on_load_hook__
326
- @__on_load_hook__&.()
327
- end
328
-
329
321
  # Invokes the module's on_unload hook if set
330
322
  #
331
323
  # @return [void]
@@ -335,15 +327,6 @@ module Syntropy
335
327
 
336
328
  private
337
329
 
338
- # Sets the module's on_load hook to the given block.
339
- #
340
- # @return [void]
341
- def on_load(&hook)
342
- raise Syntropy::Error, "No block given" if !hook
343
-
344
- @__on_load_hook__ = hook
345
- end
346
-
347
330
  # Sets the module's on_unload hook to the given block.
348
331
  #
349
332
  # @return [void]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Syntropy
4
- VERSION = '0.55.0'
4
+ VERSION = '0.55.1'
5
5
  end
@@ -4,5 +4,5 @@ def loaded?
4
4
  @loaded
5
5
  end
6
6
 
7
- on_load { @loaded = true }
7
+ @loaded = true
8
8
  on_unload { @loaded = false }
@@ -1,16 +1,10 @@
1
- def loaded?
2
- !!@fiber
3
- end
4
-
5
- export ->() { loaded? }
1
+ export ->() { !!@fiber }
6
2
 
7
- on_load {
8
- @fiber = @machine.spin do
9
- @machine.sleep(0)
10
- ensure
11
- @fiber = nil
12
- end
13
- }
3
+ @fiber = @machine.spin do
4
+ @machine.sleep(0)
5
+ ensure
6
+ @fiber = nil
7
+ end
14
8
 
15
9
  on_unload {
16
10
  @machine.terminate(@fiber)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syntropy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.55.0
4
+ version: 0.55.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner