Skip to content

Commit 2c8f554

Browse files
committed
revert to using a class name check to determine if a DepCtrl initializer has already run
1 parent 45e4688 commit 2c8f554

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

DependencyControl.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@
6969
"fileBaseUrl": "@{fileBaseUrl}v@{version}-@{channel}/modules/@{scriptName}",
7070
"channels": {
7171
"alpha": {
72-
"version": "0.6.2",
72+
"version": "0.6.3",
7373
"released": "2016-02-06",
7474
"default": true,
7575
"files": [
7676
{
7777
"name": ".moon",
7878
"url": "@{fileBaseUrl}@{fileName}",
79-
"sha1": "0135ADCF023F2150B7324C5BABE72F0F26E412F1"
79+
"sha1": "76C22149258CB1189265A367C1B28046F54F8FB3"
8080
},
8181
{
8282
"name": "/ConfigHandler.moon",
@@ -134,6 +134,9 @@
134134
}
135135
},
136136
"changelog": {
137+
"0.6.3": [
138+
"Fixed a v0.6.2 regression that caused DependencyControl to fail loading the first time after a scheduled self-update."
139+
],
137140
"0.6.2": [
138141
"An issue was fixed that would cause DepCtrl initializer code in modules previously loaded with regular Lua loading mechanisms to be skipped when requested in a _DependencyControl_- context. This kept the [requireffi](https://github.com/torque/ffi-experiments/tree/master/requireffi) _DependencyControl_ record from being established, preventing any updates from taking place.",
139142
"UnitTestSuite: Fixed several broken assertions and related error messages, among them the `assertMatches` and `assertErrorMatches` assertions always returning `true`. Please make sure to rerun your tests after upgrading to confirm your tested actually return values whatever they were supposed to match.",

modules/DependencyControl.moon

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,12 @@ class DependencyControl
322322
return [mdl for mdl, _ in pairs mdlConfig.c when mdl\match pattern], mdlConfig
323323

324324
loadModule: (mdl, usePrivate, reload) =>
325-
runInitializer = (rec) ->
326-
return unless type(rec) == "table" and rec.__depCtrlInit
327-
if type(rec.version) != "table" or rec.version.__class != @@
328-
rec.__depCtrlInit @@
325+
runInitializer = (ref) ->
326+
return unless type(ref) == "table" and ref.__depCtrlInit
327+
-- Note to future self: don't change this to a class check! When DepCtrl self-updates
328+
-- any managed module initialized before will still use the same instance
329+
if type(ref.version) != "table" or ref.version.__name != @@__name
330+
ref.__depCtrlInit @@
329331

330332
with mdl
331333
._missing, ._error = nil
@@ -540,7 +542,7 @@ class DependencyControl
540542

541543
rec = DependencyControl{
542544
name: "DependencyControl",
543-
version: "0.6.2",
545+
version: "0.6.3",
544546
description: "Provides script management and auto-updating for Aegisub macros and modules.",
545547
author: "line0",
546548
url: "http://github.com/TypesettingTools/DependencyControl",

0 commit comments

Comments
 (0)