Skip to content

Commit aba02c0

Browse files
committed
Rename reset to clear
1 parent 2a3878a commit aba02c0

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

packages/core/lib/open-uri/cached.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Entry {
4545
}
4646
}
4747
48-
const reset = () => {
48+
const clear = () => {
4949
cache = new Map()
5050
length = 0
5151
lruList = []
@@ -148,8 +148,8 @@ def max=(maxLength)
148148
}
149149
end
150150

151-
def reset
152-
`reset()`
151+
def clear
152+
`clear()`
153153
end
154154
end
155155
end

packages/core/spec/node/asciidoctor.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,7 @@ include::${testOptions.remoteBaseUri}/include-lines.adoc[lines=3..4]
22792279
expect(requestsReceived.length).to.equal(2)
22802280
} finally {
22812281
asciidoctor.Cache.disable()
2282-
asciidoctor.Cache.reset()
2282+
asciidoctor.Cache.clear()
22832283
asciidoctor.Cache.setMax(Opal.Asciidoctor.Cache.DEFAULT_MAX)
22842284
}
22852285
})
@@ -2309,7 +2309,7 @@ image::${testOptions.remoteBaseUri}/cc-zero.svg[opts=inline]
23092309
expect(requestsReceived.map((request) => request.pathname)).to.have.members(['/cc-zero.svg', '/cc-heart.svg', '/cc-heart.svg'])
23102310
} finally {
23112311
asciidoctor.Cache.disable()
2312-
asciidoctor.Cache.reset()
2312+
asciidoctor.Cache.clear()
23132313
asciidoctor.Cache.setMax(Opal.Asciidoctor.Cache.DEFAULT_MAX)
23142314
}
23152315
})

packages/core/src/template-asciidoctor-node.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,15 @@ export default function (moduleConfig) {
3535
// Alias
3636
Opal.Asciidoctor.Cache = {
3737
disable: function () {
38-
// QUESTION: should we also reset cache?
3938
const openUriSingleton = Opal.OpenURI.$singleton_class()
4039
if (Opal.OpenURI['$respond_to?']('original_open_uri')) {
4140
openUriSingleton.$send('remove_method', 'open_uri')
4241
openUriSingleton.$send('alias_method', 'open_uri', 'original_open_uri')
4342
}
4443
},
45-
reset: function() {
46-
// QUESTION: should we also reset the max value?
47-
if (typeof Opal.OpenURI.Cache['$reset'] === 'function') {
48-
Opal.OpenURI.Cache['$reset']()
44+
clear: function() {
45+
if (typeof Opal.OpenURI.Cache['$clear'] === 'function') {
46+
Opal.OpenURI.Cache['$clear']()
4947
}
5048
},
5149
enable: function () {

0 commit comments

Comments
 (0)