dbmlite3_jruby 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc9a9987d754b2458c7bcc27b496d523e513e219114b93ad3a41ed694205f9a8
4
- data.tar.gz: be1f42c19e8c873559c998f7fc9f4e8e05ba823027846bea6d96271f8872ea91
3
+ metadata.gz: 56a425553d0773203e75c26009ca4a98af622e919cf5f0e779b3f9be85bbcfea
4
+ data.tar.gz: 5b73289b8d8b20b2e4bee5f5eb3a498ece7e7c0a6a6ec4e7a1e143b665fa55c3
5
5
  SHA512:
6
- metadata.gz: 424d21a67b715aff352c20fd117930eea7ad179cac5f8a86f9e10adb474bd63e5cbf79572186272bb1a8b0e6c786b76b60e7e4f64e88c7779d90385b29d964cc
7
- data.tar.gz: 3f1a519635b8725d938b69b49e0a7ee523f3ae950fc445150530c7df8ddcc67bdfc90d49f5817dddbc225fe6f24cbceacdf0713ef5a703dabddbbbad9ec87307
6
+ metadata.gz: d2622c814701c0f79e15947b4f3351b76e5b582788a9a587d0b5e0006298c4f91b0746729188bb69ba95ddce48fcbcd45520d502b7e7dcb2cd95b5bb5c93a2da
7
+ data.tar.gz: 4cec5d6c2e49552486fa22d769452d10c3d5573e2cd1c3e280cf51fb5c7b3bf7c21d169ef2e75f80a8475d7162ddc34c134aa0e29e46cb4fe6e7c5de01a3fec6
data/.yardopts CHANGED
@@ -1,3 +1,3 @@
1
1
  --markup markdown
2
2
  --readme README.md
3
- lib/*.rb
3
+ lib/*.rb lib/internal_lite3/*.rb
data/Rakefile CHANGED
@@ -6,9 +6,7 @@ RSpec::Core::RakeTask.new(:test) do |t|
6
6
  t.pattern = Dir.glob('spec/*_spec.rb')
7
7
  end
8
8
 
9
- YARD::Rake::YardocTask.new(:docs_via_yard) do |t|
10
- t.files = ['lib/*.rb', 'lib/internal_lite3/*.rb']
11
- end
9
+ YARD::Rake::YardocTask.new(:docs_via_yard)
12
10
 
13
11
  task :gem => [:doc] do
14
12
  gem_prefix = "JRUBY_GEM=yes " if RUBY_PLATFORM == "java"
data/dbmlite3.gemspec CHANGED
@@ -18,8 +18,8 @@ end
18
18
 
19
19
  Gem::Specification.new do |s|
20
20
  s.name = "dbmlite3#{SUFFIX}"
21
- s.version = '2.0.0'
22
- s.date = '2022-02-21'
21
+ s.version = '2.0.1'
22
+ s.date = '2024-03-30'
23
23
  s.summary = "A DBM-style key-value store using SQLite3#{SUMMARY_EXTRA}"
24
24
  s.description = <<-EOF + DESC_EXTRA
25
25
  Lite3::DBM is an object that behaves like a Ruby Hash but stores
data/doc/Lite3/DBM.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Lite3::DBM
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.36
10
10
 
11
11
  </title>
12
12
 
@@ -150,7 +150,7 @@
150
150
 
151
151
 
152
152
  <span class="summary_desc"><div class='inline'>
153
- <p>Identical to <code>initialize</code> except that if a block is provided, it is evaluated with a new Lite3::DBM which is then closed afterward.</p>
153
+ <p>Identical to <code>new</code> except that if a block is provided, it is evaluated with a new Lite3::DBM which is then closed afterward.</p>
154
154
  </div></span>
155
155
 
156
156
  </li>
@@ -982,7 +982,7 @@
982
982
  </h3><div class="docstring">
983
983
  <div class="discussion">
984
984
 
985
- <p>Identical to <code>initialize</code> except that if a block is provided, it is evaluated with a new Lite3::DBM which is then closed afterward. This is analagous to <code>File.open</code>.</p>
985
+ <p>Identical to <code>new</code> except that if a block is provided, it is evaluated with a new Lite3::DBM which is then closed afterward. This is analagous to <code>File.open</code>. See <code>initialize</code> for an explanation of the arguments and caveats.</p>
986
986
 
987
987
 
988
988
  </div>
@@ -996,7 +996,6 @@
996
996
  <pre class="lines">
997
997
 
998
998
 
999
- 93
1000
999
  94
1001
1000
  95
1002
1001
  96
@@ -1005,10 +1004,11 @@
1005
1004
  99
1006
1005
  100
1007
1006
  101
1008
- 102</pre>
1007
+ 102
1008
+ 103</pre>
1009
1009
  </td>
1010
1010
  <td>
1011
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 93</span>
1011
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 94</span>
1012
1012
 
1013
1013
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_tablename'>tablename</span><span class='comma'>,</span> <span class='id identifier rubyid_serializer'>serializer</span> <span class='op'>=</span> <span class='symbol'>:yaml</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
1014
1014
  <span class='id identifier rubyid_instance'>instance</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_tablename'>tablename</span><span class='comma'>,</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='rparen'>)</span>
@@ -1057,12 +1057,12 @@
1057
1057
  <pre class="lines">
1058
1058
 
1059
1059
 
1060
- 262
1061
1060
  263
1062
- 264</pre>
1061
+ 264
1062
+ 265</pre>
1063
1063
  </td>
1064
1064
  <td>
1065
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 262</span>
1065
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 263</span>
1066
1066
 
1067
1067
  <span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
1068
1068
  <span class='kw'>return</span> <span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
@@ -1106,17 +1106,17 @@
1106
1106
  <pre class="lines">
1107
1107
 
1108
1108
 
1109
- 250
1110
1109
  251
1111
1110
  252
1112
1111
  253
1113
1112
  254
1114
1113
  255
1115
1114
  256
1116
- 257</pre>
1115
+ 257
1116
+ 258</pre>
1117
1117
  </td>
1118
1118
  <td>
1119
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 250</span>
1119
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 251</span>
1120
1120
 
1121
1121
  <span class='kw'>def</span> <span class='op'>[]=</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1122
1122
  <span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_check_key'>check_key</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
@@ -1157,12 +1157,12 @@
1157
1157
  <pre class="lines">
1158
1158
 
1159
1159
 
1160
- 348
1161
- 349
1162
- 350</pre>
1160
+ 354
1161
+ 355
1162
+ 356</pre>
1163
1163
  </td>
1164
1164
  <td>
1165
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 348</span>
1165
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 354</span>
1166
1166
 
1167
1167
  <span class='kw'>def</span> <span class='id identifier rubyid_clear'>clear</span>
1168
1168
  <span class='ivar'>@handle</span><span class='period'>.</span><span class='id identifier rubyid_clear_table'>clear_table</span><span class='lparen'>(</span><span class='id identifier rubyid_actual_tbl'>actual_tbl</span><span class='lparen'>(</span><span class='rparen'>)</span><span class='rparen'>)</span>
@@ -1200,13 +1200,13 @@
1200
1200
  <pre class="lines">
1201
1201
 
1202
1202
 
1203
- 185
1204
1203
  186
1205
1204
  187
1206
- 188</pre>
1205
+ 188
1206
+ 189</pre>
1207
1207
  </td>
1208
1208
  <td>
1209
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 185</span>
1209
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 186</span>
1210
1210
 
1211
1211
  <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
1212
1212
  <span class='ivar'>@handle</span><span class='period'>.</span><span class='id identifier rubyid_delref'>delref</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
@@ -1256,12 +1256,12 @@
1256
1256
  <pre class="lines">
1257
1257
 
1258
1258
 
1259
- 192
1260
1259
  193
1261
- 194</pre>
1260
+ 194
1261
+ 195</pre>
1262
1262
  </td>
1263
1263
  <td>
1264
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 192</span>
1264
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 193</span>
1265
1265
 
1266
1266
  <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
1267
1267
  <span class='kw'>return</span> <span class='ivar'>@handle</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>ClosedHandle</span>
@@ -1297,12 +1297,12 @@
1297
1297
  <pre class="lines">
1298
1298
 
1299
1299
 
1300
- 434
1301
- 435
1302
- 436</pre>
1300
+ 440
1301
+ 441
1302
+ 442</pre>
1303
1303
  </td>
1304
1304
  <td>
1305
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 434</span>
1305
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 440</span>
1306
1306
 
1307
1307
  <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
1308
1308
  <span class='ivar'>@handle</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_actual_tbl'>actual_tbl</span><span class='lparen'>(</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
@@ -1360,14 +1360,14 @@
1360
1360
  <pre class="lines">
1361
1361
 
1362
1362
 
1363
- 442
1364
- 443
1365
- 444
1366
- 445
1367
- 446</pre>
1363
+ 448
1364
+ 449
1365
+ 450
1366
+ 451
1367
+ 452</pre>
1368
1368
  </td>
1369
1369
  <td>
1370
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 442</span>
1370
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 448</span>
1371
1371
 
1372
1372
  <span class='kw'>def</span> <span class='id identifier rubyid_delete_if'>delete_if</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
1373
1373
  <span class='id identifier rubyid_transaction'>transaction</span> <span class='lbrace'>{</span>
@@ -1431,14 +1431,14 @@
1431
1431
  <pre class="lines">
1432
1432
 
1433
1433
 
1434
- 386
1435
- 387
1436
- 388
1437
- 389
1438
- 390</pre>
1434
+ 392
1435
+ 393
1436
+ 394
1437
+ 395
1438
+ 396</pre>
1439
1439
  </td>
1440
1440
  <td>
1441
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 386</span>
1441
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 392</span>
1442
1442
 
1443
1443
  <span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
1444
1444
  <span class='kw'>return</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_enum'>to_enum</span><span class='lparen'>(</span><span class='symbol'>:nt_each</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_block'>block</span>
@@ -1494,13 +1494,13 @@
1494
1494
  <pre class="lines">
1495
1495
 
1496
1496
 
1497
- 409
1498
- 410
1499
- 411
1500
- 412</pre>
1497
+ 415
1498
+ 416
1499
+ 417
1500
+ 418</pre>
1501
1501
  </td>
1502
1502
  <td>
1503
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 409</span>
1503
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 415</span>
1504
1504
 
1505
1505
  <span class='kw'>def</span> <span class='id identifier rubyid_each_key'>each_key</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
1506
1506
  <span class='kw'>return</span> <span class='const'>Enumerator</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_y'>y</span><span class='op'>|</span> <span class='id identifier rubyid_nt_each'>nt_each</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_k'>k</span> <span class='rbrace'>}</span> <span class='rbrace'>}</span> <span class='kw'>unless</span> <span class='id identifier rubyid_block'>block</span>
@@ -1555,13 +1555,13 @@
1555
1555
  <pre class="lines">
1556
1556
 
1557
1557
 
1558
- 418
1559
- 419
1560
- 420
1561
- 421</pre>
1558
+ 424
1559
+ 425
1560
+ 426
1561
+ 427</pre>
1562
1562
  </td>
1563
1563
  <td>
1564
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 418</span>
1564
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 424</span>
1565
1565
 
1566
1566
  <span class='kw'>def</span> <span class='id identifier rubyid_each_value'>each_value</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
1567
1567
  <span class='kw'>return</span> <span class='const'>Enumerator</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_y'>y</span><span class='op'>|</span> <span class='id identifier rubyid_nt_each'>nt_each</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_v'>v</span> <span class='rbrace'>}</span> <span class='rbrace'>}</span> <span class='kw'>unless</span> <span class='id identifier rubyid_block'>block</span>
@@ -1611,12 +1611,12 @@
1611
1611
  <pre class="lines">
1612
1612
 
1613
1613
 
1614
- 456
1615
- 457
1616
- 458</pre>
1614
+ 462
1615
+ 463
1616
+ 464</pre>
1617
1617
  </td>
1618
1618
  <td>
1619
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 456</span>
1619
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 462</span>
1620
1620
 
1621
1621
  <span class='kw'>def</span> <span class='id identifier rubyid_empty?'>empty?</span>
1622
1622
  <span class='kw'>return</span> <span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>0</span>
@@ -1674,16 +1674,16 @@
1674
1674
  <pre class="lines">
1675
1675
 
1676
1676
 
1677
- 365
1678
- 366
1679
- 367
1680
- 368
1681
- 369
1682
- 370
1683
- 371</pre>
1677
+ 371
1678
+ 372
1679
+ 373
1680
+ 374
1681
+ 375
1682
+ 376
1683
+ 377</pre>
1684
1684
  </td>
1685
1685
  <td>
1686
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 365</span>
1686
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 371</span>
1687
1687
 
1688
1688
  <span class='kw'>def</span> <span class='id identifier rubyid_fast_each'>fast_each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
1689
1689
  <span class='id identifier rubyid_transaction'>transaction</span> <span class='lbrace'>{</span>
@@ -1713,11 +1713,9 @@
1713
1713
 
1714
1714
  <p><code>key</code> <strong>must</strong> be a String or a Symbol; Symbols are transparently converted to Strings.</p>
1715
1715
 
1716
- <p>If it is not present and a block is given, evaluate the block with the key as its argument and return that.</p>
1717
-
1718
- <p>If no block was given either but one extra parameter was given, that value is returned instead.</p>
1716
+ <p>If it is not present and a block is given, evaluate the block with the key as its argument and return that. If no block was given either but one extra parameter was given, that value is returned instead. Finally, if none of these was given, it throws an <code>IndexError</code> exception.</p>
1719
1717
 
1720
- <p>Finally, if none of these was given, it throws an <code>IndexError</code> exception.</p>
1718
+ <p>All database accesses occur within a transaction, so it is safe to consider <code>fetch</code> atomic. This includes evaluating a block argument.</p>
1721
1719
 
1722
1720
  <p>It is an error if <code>fetch</code> is called with more than two arguments.</p>
1723
1721
 
@@ -1764,8 +1762,6 @@
1764
1762
  <pre class="lines">
1765
1763
 
1766
1764
 
1767
- 283
1768
- 284
1769
1765
  285
1770
1766
  286
1771
1767
  287
@@ -1789,10 +1785,16 @@
1789
1785
  305
1790
1786
  306
1791
1787
  307
1792
- 308</pre>
1788
+ 308
1789
+ 309
1790
+ 310
1791
+ 311
1792
+ 312
1793
+ 313
1794
+ 314</pre>
1793
1795
  </td>
1794
1796
  <td>
1795
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 283</span>
1797
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 285</span>
1796
1798
 
1797
1799
  <span class='kw'>def</span> <span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_default_block'>default_block</span><span class='rparen'>)</span>
1798
1800
 
@@ -1805,17 +1807,21 @@
1805
1807
  <span class='comment'># Retrieve the value
1806
1808
  </span> <span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_check_key'>check_key</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
1807
1809
 
1808
- <span class='comment'># Return the value if found. (nil will always mean the entry
1809
- </span> <span class='comment'># isn&#39;t present because values are encoded in strings.)
1810
- </span> <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='ivar'>@handle</span><span class='period'>.</span><span class='id identifier rubyid_lookup'>lookup</span><span class='lparen'>(</span><span class='id identifier rubyid_actual_tbl'>actual_tbl</span><span class='lparen'>(</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
1811
- <span class='kw'>return</span> <span class='ivar'>@valdec</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span>
1810
+ <span class='comment'># We do the lookup-and-maybe-replace in a transaction so that
1811
+ </span> <span class='comment'># it&#39;s atomic.
1812
+ </span> <span class='id identifier rubyid_transaction'>transaction</span> <span class='kw'>do</span>
1813
+ <span class='comment'># Return the value if found. (nil will always mean the entry
1814
+ </span> <span class='comment'># isn&#39;t present because values are encoded in strings.)
1815
+ </span> <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='ivar'>@handle</span><span class='period'>.</span><span class='id identifier rubyid_lookup'>lookup</span><span class='lparen'>(</span><span class='id identifier rubyid_actual_tbl'>actual_tbl</span><span class='lparen'>(</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
1816
+ <span class='kw'>return</span> <span class='ivar'>@valdec</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span>
1812
1817
 
1813
- <span class='comment'># Not found. If a block was given, evaluate it and return its
1814
- </span> <span class='comment'># result.
1815
- </span> <span class='kw'>return</span> <span class='id identifier rubyid_default_block'>default_block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_default_block'>default_block</span>
1818
+ <span class='comment'># Not found. If a block was given, evaluate it and return its
1819
+ </span> <span class='comment'># result.
1820
+ </span> <span class='kw'>return</span> <span class='id identifier rubyid_default_block'>default_block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_default_block'>default_block</span>
1816
1821
 
1817
- <span class='comment'># Next, see if we have a default value we can return
1818
- </span> <span class='kw'>return</span> <span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>&gt;</span> <span class='int'>0</span>
1822
+ <span class='comment'># Next, see if we have a default value we can return
1823
+ </span> <span class='kw'>return</span> <span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>&gt;</span> <span class='int'>0</span>
1824
+ <span class='kw'>end</span>
1819
1825
 
1820
1826
  <span class='comment'># And if all else fails, raise an IndexError.
1821
1827
  </span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>IndexError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>key &#39;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'>&#39; not found.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
@@ -1868,14 +1874,14 @@
1868
1874
  <pre class="lines">
1869
1875
 
1870
1876
 
1871
- 338
1872
- 339
1873
- 340
1874
- 341
1875
- 342</pre>
1877
+ 344
1878
+ 345
1879
+ 346
1880
+ 347
1881
+ 348</pre>
1876
1882
  </td>
1877
1883
  <td>
1878
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 338</span>
1884
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 344</span>
1879
1885
 
1880
1886
  <span class='kw'>def</span> <span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
1881
1887
  <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'>==</span> <span class='const'>String</span> <span class='op'>||</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'>==</span> <span class='const'>Symbol</span>
@@ -1932,13 +1938,13 @@
1932
1938
  <pre class="lines">
1933
1939
 
1934
1940
 
1935
- 499
1936
- 500
1937
- 501
1938
- 502</pre>
1941
+ 505
1942
+ 506
1943
+ 507
1944
+ 508</pre>
1939
1945
  </td>
1940
1946
  <td>
1941
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 499</span>
1947
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 505</span>
1942
1948
 
1943
1949
  <span class='kw'>def</span> <span class='id identifier rubyid_has_value?'>has_value?</span><span class='lparen'>(</span><span class='id identifier rubyid_val'>val</span><span class='rparen'>)</span>
1944
1950
  <span class='id identifier rubyid_fast_each'>fast_each</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_v'>v</span> <span class='op'>==</span> <span class='id identifier rubyid_val'>val</span> <span class='rbrace'>}</span>
@@ -1977,14 +1983,14 @@
1977
1983
  <pre class="lines">
1978
1984
 
1979
1985
 
1980
- 511
1981
- 512
1982
- 513
1983
- 514
1984
- 515</pre>
1986
+ 517
1987
+ 518
1988
+ 519
1989
+ 520
1990
+ 521</pre>
1985
1991
  </td>
1986
1992
  <td>
1987
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 511</span>
1993
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 517</span>
1988
1994
 
1989
1995
  <span class='kw'>def</span> <span class='id identifier rubyid_invert'>invert</span>
1990
1996
  <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
@@ -2024,14 +2030,14 @@
2024
2030
  <pre class="lines">
2025
2031
 
2026
2032
 
2027
- 320
2028
- 321
2029
- 322
2030
- 323
2031
- 324</pre>
2033
+ 326
2034
+ 327
2035
+ 328
2036
+ 329
2037
+ 330</pre>
2032
2038
  </td>
2033
2039
  <td>
2034
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 320</span>
2040
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 326</span>
2035
2041
 
2036
2042
  <span class='kw'>def</span> <span class='id identifier rubyid_keys'>keys</span>
2037
2043
  <span class='id identifier rubyid_keys'>keys</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
@@ -2069,19 +2075,19 @@
2069
2075
  <pre class="lines">
2070
2076
 
2071
2077
 
2072
- 520
2073
- 521
2074
- 522
2075
- 523
2076
- 524
2077
- 525
2078
2078
  526
2079
2079
  527
2080
2080
  528
2081
- 529</pre>
2081
+ 529
2082
+ 530
2083
+ 531
2084
+ 532
2085
+ 533
2086
+ 534
2087
+ 535</pre>
2082
2088
  </td>
2083
2089
  <td>
2084
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 520</span>
2090
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 526</span>
2085
2091
 
2086
2092
  <span class='kw'>def</span> <span class='id identifier rubyid_shift'>shift</span>
2087
2093
  <span class='id identifier rubyid_transaction'>transaction</span> <span class='lbrace'>{</span>
@@ -2128,12 +2134,12 @@
2128
2134
  <pre class="lines">
2129
2135
 
2130
2136
 
2131
- 450
2132
- 451
2133
- 452</pre>
2137
+ 456
2138
+ 457
2139
+ 458</pre>
2134
2140
  </td>
2135
2141
  <td>
2136
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 450</span>
2142
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 456</span>
2137
2143
 
2138
2144
  <span class='kw'>def</span> <span class='id identifier rubyid_size'>size</span>
2139
2145
  <span class='kw'>return</span> <span class='ivar'>@handle</span><span class='period'>.</span><span class='id identifier rubyid_get_size'>get_size</span><span class='lparen'>(</span><span class='id identifier rubyid_actual_tbl'>actual_tbl</span><span class='lparen'>(</span><span class='rparen'>)</span><span class='rparen'>)</span>
@@ -2171,14 +2177,14 @@
2171
2177
  <pre class="lines">
2172
2178
 
2173
2179
 
2174
- 484
2175
- 485
2176
- 486
2177
- 487
2178
- 488</pre>
2180
+ 490
2181
+ 491
2182
+ 492
2183
+ 493
2184
+ 494</pre>
2179
2185
  </td>
2180
2186
  <td>
2181
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 484</span>
2187
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 490</span>
2182
2188
 
2183
2189
  <span class='kw'>def</span> <span class='id identifier rubyid_to_a'>to_a</span>
2184
2190
  <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
@@ -2218,14 +2224,14 @@
2218
2224
  <pre class="lines">
2219
2225
 
2220
2226
 
2221
- 471
2222
- 472
2223
- 473
2224
- 474
2225
- 475</pre>
2227
+ 477
2228
+ 478
2229
+ 479
2230
+ 480
2231
+ 481</pre>
2226
2232
  </td>
2227
2233
  <td>
2228
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 471</span>
2234
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 477</span>
2229
2235
 
2230
2236
  <span class='kw'>def</span> <span class='id identifier rubyid_to_hash'>to_hash</span>
2231
2237
  <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
@@ -2256,14 +2262,14 @@
2256
2262
  <pre class="lines">
2257
2263
 
2258
2264
 
2259
- 170
2260
2265
  171
2261
2266
  172
2262
2267
  173
2263
- 174</pre>
2268
+ 174
2269
+ 175</pre>
2264
2270
  </td>
2265
2271
  <td>
2266
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 170</span>
2272
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 171</span>
2267
2273
 
2268
2274
  <span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
2269
2275
  <span class='id identifier rubyid_openstr'>openstr</span> <span class='op'>=</span> <span class='id identifier rubyid_closed?'>closed?</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>CLOSED</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>OPEN</span><span class='tstring_end'>&#39;</span></span>
@@ -2343,12 +2349,12 @@
2343
2349
  <pre class="lines">
2344
2350
 
2345
2351
 
2346
- 228
2347
2352
  229
2348
- 230</pre>
2353
+ 230
2354
+ 231</pre>
2349
2355
  </td>
2350
2356
  <td>
2351
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 228</span>
2357
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 229</span>
2352
2358
 
2353
2359
  <span class='kw'>def</span> <span class='id identifier rubyid_transaction'>transaction</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
2354
2360
  <span class='kw'>return</span> <span class='ivar'>@handle</span><span class='period'>.</span><span class='id identifier rubyid_transaction'>transaction</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
@@ -2397,12 +2403,12 @@
2397
2403
  <pre class="lines">
2398
2404
 
2399
2405
 
2400
- 233
2401
2406
  234
2402
- 235</pre>
2407
+ 235
2408
+ 236</pre>
2403
2409
  </td>
2404
2410
  <td>
2405
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 233</span>
2411
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 234</span>
2406
2412
 
2407
2413
  <span class='kw'>def</span> <span class='id identifier rubyid_transaction_active?'>transaction_active?</span>
2408
2414
  <span class='kw'>return</span> <span class='ivar'>@handle</span><span class='period'>.</span><span class='id identifier rubyid_transaction_active?'>transaction_active?</span>
@@ -2438,14 +2444,14 @@
2438
2444
  <pre class="lines">
2439
2445
 
2440
2446
 
2441
- 426
2442
- 427
2443
- 428
2444
- 429
2445
- 430</pre>
2447
+ 432
2448
+ 433
2449
+ 434
2450
+ 435
2451
+ 436</pre>
2446
2452
  </td>
2447
2453
  <td>
2448
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 426</span>
2454
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 432</span>
2449
2455
 
2450
2456
  <span class='kw'>def</span> <span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span>
2451
2457
  <span class='id identifier rubyid_transaction'>transaction</span> <span class='lbrace'>{</span>
@@ -2485,14 +2491,14 @@
2485
2491
  <pre class="lines">
2486
2492
 
2487
2493
 
2488
- 330
2489
- 331
2490
- 332
2491
- 333
2492
- 334</pre>
2494
+ 336
2495
+ 337
2496
+ 338
2497
+ 339
2498
+ 340</pre>
2493
2499
  </td>
2494
2500
  <td>
2495
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 330</span>
2501
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 336</span>
2496
2502
 
2497
2503
  <span class='kw'>def</span> <span class='id identifier rubyid_values'>values</span>
2498
2504
  <span class='id identifier rubyid_values'>values</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
@@ -2530,12 +2536,12 @@
2530
2536
  <pre class="lines">
2531
2537
 
2532
2538
 
2533
- 312
2534
- 313
2535
- 314</pre>
2539
+ 318
2540
+ 319
2541
+ 320</pre>
2536
2542
  </td>
2537
2543
  <td>
2538
- <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 312</span>
2544
+ <pre class="code"><span class="info file"># File 'lib/internal_lite3/dbm.rb', line 318</span>
2539
2545
 
2540
2546
  <span class='kw'>def</span> <span class='id identifier rubyid_values_at'>values_at</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_keys'>keys</span><span class='rparen'>)</span>
2541
2547
  <span class='kw'>return</span> <span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='op'>|</span> <span class='kw'>self</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span><span class='rbrace'>}</span>
@@ -2550,9 +2556,9 @@
2550
2556
  </div>
2551
2557
 
2552
2558
  <div id="footer">
2553
- Generated on Sat Aug 19 13:24:30 2023 by
2559
+ Generated on Sat Mar 30 16:17:32 2024 by
2554
2560
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2555
- 0.9.34 (ruby-3.1.0).
2561
+ 0.9.36 (ruby-3.1.4).
2556
2562
  </div>
2557
2563
 
2558
2564
  </div>
data/doc/Lite3/Error.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Exception: Lite3::Error
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.36
10
10
 
11
11
  </title>
12
12
 
@@ -129,9 +129,9 @@
129
129
  </div>
130
130
 
131
131
  <div id="footer">
132
- Generated on Sat Aug 19 13:24:30 2023 by
132
+ Generated on Sat Mar 30 16:17:32 2024 by
133
133
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
134
- 0.9.34 (ruby-3.1.0).
134
+ 0.9.36 (ruby-3.1.4).
135
135
  </div>
136
136
 
137
137
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Exception: Lite3::InternalError
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.36
10
10
 
11
11
  </title>
12
12
 
@@ -133,9 +133,9 @@
133
133
  </div>
134
134
 
135
135
  <div id="footer">
136
- Generated on Sat Aug 19 13:24:30 2023 by
136
+ Generated on Sat Mar 30 16:17:32 2024 by
137
137
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
138
- 0.9.34 (ruby-3.1.0).
138
+ 0.9.36 (ruby-3.1.4).
139
139
  </div>
140
140
 
141
141
  </div>
data/doc/Lite3/SQL.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Lite3::SQL
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.36
10
10
 
11
11
  </title>
12
12
 
@@ -333,9 +333,9 @@
333
333
  </div>
334
334
 
335
335
  <div id="footer">
336
- Generated on Sat Aug 19 13:24:28 2023 by
336
+ Generated on Sat Mar 30 16:17:30 2024 by
337
337
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
338
- 0.9.34 (ruby-3.1.0).
338
+ 0.9.36 (ruby-3.1.4).
339
339
  </div>
340
340
 
341
341
  </div>
data/doc/Lite3.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Lite3
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.36
10
10
 
11
11
  </title>
12
12
 
@@ -109,9 +109,9 @@
109
109
  </div>
110
110
 
111
111
  <div id="footer">
112
- Generated on Sat Aug 19 13:24:28 2023 by
112
+ Generated on Sat Mar 30 16:17:30 2024 by
113
113
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
114
- 0.9.34 (ruby-3.1.0).
114
+ 0.9.36 (ruby-3.1.4).
115
115
  </div>
116
116
 
117
117
  </div>
data/doc/_index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>
7
- Documentation by YARD 0.9.34
7
+ Documentation by YARD 0.9.36
8
8
 
9
9
  </title>
10
10
 
@@ -52,7 +52,7 @@
52
52
  <div class="clear"></div>
53
53
  </div>
54
54
 
55
- <div id="content"><h1 class="noborder title">Documentation by YARD 0.9.34</h1>
55
+ <div id="content"><h1 class="noborder title">Documentation by YARD 0.9.36</h1>
56
56
  <div id="listing">
57
57
  <h1 class="alphaindex">Alphabetic Index</h1>
58
58
 
@@ -157,9 +157,9 @@
157
157
  </div>
158
158
 
159
159
  <div id="footer">
160
- Generated on Sat Aug 19 13:24:26 2023 by
160
+ Generated on Sat Mar 30 16:17:28 2024 by
161
161
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
162
- 0.9.34 (ruby-3.1.0).
162
+ 0.9.36 (ruby-3.1.4).
163
163
  </div>
164
164
 
165
165
  </div>
data/doc/file.README.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.36
10
10
 
11
11
  </title>
12
12
 
@@ -207,9 +207,9 @@ $ rake
207
207
  </div></div>
208
208
 
209
209
  <div id="footer">
210
- Generated on Sat Aug 19 13:24:28 2023 by
210
+ Generated on Sat Mar 30 16:17:30 2024 by
211
211
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
212
- 0.9.34 (ruby-3.1.0).
212
+ 0.9.36 (ruby-3.1.4).
213
213
  </div>
214
214
 
215
215
  </div>
data/doc/frames.html CHANGED
@@ -2,13 +2,18 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8">
5
- <title>Documentation by YARD 0.9.34</title>
5
+ <title>Documentation by YARD 0.9.36</title>
6
6
  </head>
7
7
  <script type="text/javascript">
8
- var match = unescape(window.location.hash).match(/^#!(.+)/);
9
- var name = match ? match[1] : 'index.html';
10
- name = name.replace(/^(\w+):\/\//, '').replace(/^\/\//, '');
11
- window.top.location = name;
8
+ var mainUrl = 'index.html';
9
+ try {
10
+ var match = decodeURIComponent(window.location.hash).match(/^#!(.+)/);
11
+ var name = match ? match[1] : mainUrl;
12
+ var url = new URL(name, location.href);
13
+ window.top.location.replace(url.origin === location.origin ? name : mainUrl);
14
+ } catch (e) {
15
+ window.top.location.replace(mainUrl);
16
+ }
12
17
  </script>
13
18
  <noscript>
14
19
  <h1>Oops!</h1>
data/doc/index.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.36
10
10
 
11
11
  </title>
12
12
 
@@ -207,9 +207,9 @@ $ rake
207
207
  </div></div>
208
208
 
209
209
  <div id="footer">
210
- Generated on Sat Aug 19 13:24:27 2023 by
210
+ Generated on Sat Mar 30 16:17:29 2024 by
211
211
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
212
- 0.9.34 (ruby-3.1.0).
212
+ 0.9.36 (ruby-3.1.4).
213
213
  </div>
214
214
 
215
215
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Top Level Namespace
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.36
10
10
 
11
11
  </title>
12
12
 
@@ -100,9 +100,9 @@
100
100
  </div>
101
101
 
102
102
  <div id="footer">
103
- Generated on Sat Aug 19 13:24:28 2023 by
103
+ Generated on Sat Mar 30 16:17:30 2024 by
104
104
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
105
- 0.9.34 (ruby-3.1.0).
105
+ 0.9.36 (ruby-3.1.4).
106
106
  </div>
107
107
 
108
108
  </div>
@@ -87,9 +87,10 @@ module Lite3
87
87
  end
88
88
 
89
89
 
90
- # Identical to `initialize` except that if a block is provided, it
91
- # is evaluated with a new Lite3::DBM which is then closed afterward.
92
- # This is analagous to `File.open`.
90
+ # Identical to `new` except that if a block is provided, it is
91
+ # evaluated with a new Lite3::DBM which is then closed afterward.
92
+ # This is analagous to `File.open`. See `initialize` for an
93
+ # explanation of the arguments and caveats.
93
94
  def self.open(filename, tablename, serializer = :yaml, &block)
94
95
  instance = self.new(filename, tablename, serializer)
95
96
  return instance unless block
@@ -269,13 +270,14 @@ module Lite3
269
270
  # transparently converted to Strings.
270
271
  #
271
272
  # If it is not present and a block is given, evaluate the block
272
- # with the key as its argument and return that.
273
+ # with the key as its argument and return that. If no block was
274
+ # given either but one extra parameter was given, that value is
275
+ # returned instead. Finally, if none of these was given, it
276
+ # throws an `IndexError` exception.
273
277
  #
274
- # If no block was given either but one extra parameter was given,
275
- # that value is returned instead.
276
- #
277
- # Finally, if none of these was given, it throws an `IndexError`
278
- # exception.
278
+ # All database accesses occur within a transaction, so it is safe
279
+ # to consider `fetch` atomic. This includes evaluating a block
280
+ # argument.
279
281
  #
280
282
  # It is an error if `fetch` is called with more than two arguments.
281
283
  #
@@ -291,17 +293,21 @@ module Lite3
291
293
  # Retrieve the value
292
294
  key = check_key(key)
293
295
 
294
- # Return the value if found. (nil will always mean the entry
295
- # isn't present because values are encoded in strings.)
296
- value = @handle.lookup(actual_tbl(), key)
297
- return @valdec.call(value) if value
296
+ # We do the lookup-and-maybe-replace in a transaction so that
297
+ # it's atomic.
298
+ transaction do
299
+ # Return the value if found. (nil will always mean the entry
300
+ # isn't present because values are encoded in strings.)
301
+ value = @handle.lookup(actual_tbl(), key)
302
+ return @valdec.call(value) if value
298
303
 
299
- # Not found. If a block was given, evaluate it and return its
300
- # result.
301
- return default_block.call(key) if default_block
304
+ # Not found. If a block was given, evaluate it and return its
305
+ # result.
306
+ return default_block.call(key) if default_block
302
307
 
303
- # Next, see if we have a default value we can return
304
- return args[0] if args.size > 0
308
+ # Next, see if we have a default value we can return
309
+ return args[0] if args.size > 0
310
+ end
305
311
 
306
312
  # And if all else fails, raise an IndexError.
307
313
  raise IndexError.new("key '#{key}' not found.")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbmlite3_jruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Reuter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-21 00:00:00.000000000 Z
11
+ date: 2024-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -17,8 +17,8 @@ dependencies:
17
17
  - !ruby/object:Gem::Version
18
18
  version: 5.71.0
19
19
  name: sequel
20
- prerelease: false
21
20
  type: :runtime
21
+ prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
@@ -31,8 +31,8 @@ dependencies:
31
31
  - !ruby/object:Gem::Version
32
32
  version: 3.42.0.0
33
33
  name: jdbc-sqlite3
34
- prerelease: false
35
34
  type: :runtime
35
+ prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
@@ -48,8 +48,8 @@ dependencies:
48
48
  - !ruby/object:Gem::Version
49
49
  version: 3.10.0
50
50
  name: rspec
51
- prerelease: false
52
51
  type: :development
52
+ prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - "~>"
@@ -68,8 +68,8 @@ dependencies:
68
68
  - !ruby/object:Gem::Version
69
69
  version: 0.9.25
70
70
  name: yard
71
- prerelease: false
72
71
  type: :development
72
+ prerelease: false
73
73
  version_requirements: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - "~>"
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  version: '0'
147
147
  requirements:
148
148
  - Sequel, jdbc-sqlite3, JRuby
149
- rubygems_version: 3.3.25
149
+ rubygems_version: 3.3.26
150
150
  signing_key:
151
151
  specification_version: 4
152
152
  summary: A DBM-style key-value store using SQLite3 (JRuby version)