dbmlite3_jruby 2.0.0.pre.alpha.4 → 2.0.0.pre.alpha.6

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.
@@ -0,0 +1,110 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Top Level Namespace
8
+
9
+ &mdash; Documentation by YARD 0.9.26
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index</a> &raquo;
40
+
41
+
42
+ <span class="title">Top Level Namespace</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Top Level Namespace
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ </div>
80
+
81
+ <h2>Defined Under Namespace</h2>
82
+ <p class="children">
83
+
84
+
85
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Lite3.html" title="Lite3 (module)">Lite3</a></span>
86
+
87
+
88
+
89
+
90
+ </p>
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+ </div>
101
+
102
+ <div id="footer">
103
+ Generated on Wed Mar 8 13:02:54 2023 by
104
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
105
+ 0.9.26 (ruby-3.0.1).
106
+ </div>
107
+
108
+ </div>
109
+ </body>
110
+ </html>
@@ -202,7 +202,7 @@ module Lite3
202
202
  # Begins a transaction, evaluates the given block and then ends
203
203
  # the transaction. If no error occurred (i.e. an exception was
204
204
  # thrown), the transaction is committed; otherwise, it is rolled
205
- # back.
205
+ # back. Returns the block's result.
206
206
  #
207
207
  # It is safe to call `DBM.transaction` within another
208
208
  # `DBM.transaction` block's call chain because `DBM` will not
@@ -220,8 +220,10 @@ module Lite3
220
220
  # transactions were always executed in `:deferred` mode via the
221
221
  # `sqlite3` gem.
222
222
  #
223
- # @yield [db] The block takes a reference to the receiver as an
224
- # argument.
223
+ # @return [obj] Returns the block's result.
224
+ #
225
+ # @yield [db] The block takes a reference to the receiver as an
226
+ # argument.
225
227
  #
226
228
  def transaction(&block)
227
229
  return @handle.transaction { block.call(self) }
@@ -88,7 +88,11 @@ module Lite3
88
88
 
89
89
  # Perform &block in a transaction. See DBM.transaction.
90
90
  def transaction(&block)
91
- @db.transaction({}, &block)
91
+ result = nil
92
+ @db.transaction({}) {
93
+ result = block.call
94
+ }
95
+ return result
92
96
  end
93
97
 
94
98
  # Test if there is currently a transaction in progress
@@ -468,6 +468,13 @@ Serializations = Set.new
468
468
  db.close
469
469
  end
470
470
 
471
+ it "transaction returns the result of the transaction block" do
472
+ db = newdb.call(Tmp.file, "floop")
473
+
474
+ result = db.transaction { db['foo'] = 42 }
475
+ expect( result ) .to be 42
476
+ end
477
+
471
478
  it "provides the rest of DBM's interface as convenience methods." do
472
479
  db = newdb.call(Tmp.file, "blopp")
473
480
  vv = {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbmlite3_jruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.alpha.4
4
+ version: 2.0.0.pre.alpha.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Reuter
@@ -100,6 +100,25 @@ files:
100
100
  - README.md
101
101
  - Rakefile
102
102
  - dbmlite3.gemspec
103
+ - doc/Lite3.html
104
+ - doc/Lite3/DBM.html
105
+ - doc/Lite3/Error.html
106
+ - doc/Lite3/InternalError.html
107
+ - doc/Lite3/SQL.html
108
+ - doc/_index.html
109
+ - doc/class_list.html
110
+ - doc/css/common.css
111
+ - doc/css/full_list.css
112
+ - doc/css/style.css
113
+ - doc/file.README.html
114
+ - doc/file_list.html
115
+ - doc/frames.html
116
+ - doc/index.html
117
+ - doc/js/app.js
118
+ - doc/js/full_list.js
119
+ - doc/js/jquery.js
120
+ - doc/method_list.html
121
+ - doc/top-level-namespace.html
103
122
  - extras/benchmark.rb
104
123
  - lib/dbmlite3.rb
105
124
  - lib/internal_lite3/dbm.rb