dbmlite3 2.0.0.pre.alpha.4 → 2.0.0.pre.alpha.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
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
@@ -97,6 +97,25 @@ files:
97
97
  - README.md
98
98
  - Rakefile
99
99
  - dbmlite3.gemspec
100
+ - doc/Lite3.html
101
+ - doc/Lite3/DBM.html
102
+ - doc/Lite3/Error.html
103
+ - doc/Lite3/InternalError.html
104
+ - doc/Lite3/SQL.html
105
+ - doc/_index.html
106
+ - doc/class_list.html
107
+ - doc/css/common.css
108
+ - doc/css/full_list.css
109
+ - doc/css/style.css
110
+ - doc/file.README.html
111
+ - doc/file_list.html
112
+ - doc/frames.html
113
+ - doc/index.html
114
+ - doc/js/app.js
115
+ - doc/js/full_list.js
116
+ - doc/js/jquery.js
117
+ - doc/method_list.html
118
+ - doc/top-level-namespace.html
100
119
  - extras/benchmark.rb
101
120
  - lib/dbmlite3.rb
102
121
  - lib/internal_lite3/dbm.rb