lucaterm 0.3.2 → 0.3.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/luca_term/book.rb +30 -4
- data/lib/luca_term/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7df4a6c4af247cc5988cc6cfb28c7f0cf467201d563cfd79f24e50ec1e1564d2
|
4
|
+
data.tar.gz: f6faeb7ae1c43e29bc4f21595438fd2256716548862ffdef28cda330c6d79f2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e1aadcc16ac61664139964c776aae32f2bd5a8e81cbe438ea5db6171af6a55a9a81638b5034ce659f2b5b67a0c549f70cbb86415f250f361b54d1c1f034e8a0
|
7
|
+
data.tar.gz: 21f5e6a8a05c23cfa1e61281fa0dc322c89b096c9f3cba892a05578e65cbf7a15194f1fcd08afd311c31c98268df0cd0e294b98dfefc33beca03ce7a92a35b7c
|
data/CHANGELOG.md
CHANGED
data/lib/luca_term/book.rb
CHANGED
@@ -210,10 +210,17 @@ module LucaTerm
|
|
210
210
|
record[position][@d_v][:amount] = new_amount
|
211
211
|
end
|
212
212
|
when 's', KEY_CTRL_S
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
213
|
+
begin
|
214
|
+
if record[:id]
|
215
|
+
LucaBook::Journal.save record
|
216
|
+
else
|
217
|
+
LucaBook::Journal.create record
|
218
|
+
end
|
219
|
+
rescue RuntimeError => e
|
220
|
+
if e.message == 'BalanceUnmatch'
|
221
|
+
alert_dialog("Error\n Debit/Credit balance not meet.")
|
222
|
+
next
|
223
|
+
end
|
217
224
|
end
|
218
225
|
break
|
219
226
|
when 'q', 27
|
@@ -350,6 +357,25 @@ module LucaTerm
|
|
350
357
|
end
|
351
358
|
end
|
352
359
|
|
360
|
+
def alert_dialog(msg)
|
361
|
+
top = window.maxy >= 25 ? 5 : 2
|
362
|
+
sub = window.subwin(6, 35, (window.maxy-6)/2, (window.maxx - 35)/2)
|
363
|
+
sub.box(?|, ?-)
|
364
|
+
sub.setpos(2, 2)
|
365
|
+
sub << msg
|
366
|
+
sub.clrtoeol
|
367
|
+
sub.refresh
|
368
|
+
|
369
|
+
loop do
|
370
|
+
cmd = window.getch
|
371
|
+
case cmd
|
372
|
+
when ' ', 'q', KEY_CTRL_J
|
373
|
+
sub.close
|
374
|
+
return
|
375
|
+
end
|
376
|
+
end
|
377
|
+
end
|
378
|
+
|
353
379
|
private
|
354
380
|
|
355
381
|
def account_index(maxx = 50)
|
data/lib/luca_term/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucaterm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|