lucaterm 0.2.0 → 0.2.2
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 +8 -0
- data/README.md +13 -0
- data/lib/luca_term/book.rb +22 -3
- data/lib/luca_term/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54d96bf786cd39ffd8aa30fecb51f15ecc47fe9df16cbdb26765a5b999511e17
|
4
|
+
data.tar.gz: a6e2019a9f7635a4ce03c6ba6d4698bafe247de3b4efd939520cabbda982ba3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e52b886789231af4e2aa01a98c0a0eb42af28c98120f533e0bf9c69f9819d08011eb9edb324a75d5f29568b5e0a10b32c050e71294ab89cbd96d632b02d8ba0a
|
7
|
+
data.tar.gz: cd9b2d385ad3471d73d82001a6691849da7f7ef4777421e82b95e268388cb5772747d6216760a75c667b6c74525593db7582923bfa7bf0dbbb2e3cc0b5d8e4ef
|
data/CHANGELOG.md
CHANGED
data/README.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# LucaTerm
|
2
|
+
|
3
|
+
[](https://badge.fury.io/rb/lucaterm)
|
4
|
+
[](https://www.rubydoc.info/gems/lucaterm/index)
|
5
|
+

|
6
|
+
|
7
|
+
Terminal frontend app for LucaSuite.
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
```bash
|
12
|
+
$ luca book [yyyy m]
|
13
|
+
```
|
data/lib/luca_term/book.rb
CHANGED
@@ -190,6 +190,11 @@ module LucaTerm
|
|
190
190
|
record[position] << { code: new_code, amount: new_amount }
|
191
191
|
debit_length = Array(record[:debit]).length
|
192
192
|
credit_length = Array(record[:credit]).length
|
193
|
+
when 'c'
|
194
|
+
new_note = edit_note(record[:note])
|
195
|
+
next if new_note.nil?
|
196
|
+
|
197
|
+
record[:note] = new_note
|
193
198
|
when KEY_CTRL_J
|
194
199
|
position, counter = [0,1].include?(@d_h) ? [:debit, :credit] : [:credit, :debit]
|
195
200
|
if [0, 2].include? @d_h
|
@@ -211,7 +216,7 @@ module LucaTerm
|
|
211
216
|
LucaBook::Journal.create record
|
212
217
|
end
|
213
218
|
break
|
214
|
-
when 'q'
|
219
|
+
when 'q', 27
|
215
220
|
break
|
216
221
|
end
|
217
222
|
end
|
@@ -231,6 +236,19 @@ module LucaTerm
|
|
231
236
|
end
|
232
237
|
end
|
233
238
|
|
239
|
+
# returns note after edit
|
240
|
+
#
|
241
|
+
def edit_note(current = nil)
|
242
|
+
msg = ''
|
243
|
+
begin
|
244
|
+
scmd = edit_dialog "Current: #{current&.to_s}", msg, title: 'Edit Note'
|
245
|
+
return nil if scmd.length == 0
|
246
|
+
return scmd
|
247
|
+
rescue
|
248
|
+
return nil
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
234
252
|
def edit_dialog(message = '', submessage = '', title: '')
|
235
253
|
sub = window.subwin(5, 30, (window.maxy-5)/2, (window.maxx - 30)/2)
|
236
254
|
sub.setpos(1, 1)
|
@@ -316,12 +334,13 @@ module LucaTerm
|
|
316
334
|
when 'G'
|
317
335
|
cursor_last list, sub.maxy - 2
|
318
336
|
when KEY_CTRL_J
|
337
|
+
selected = list[@index][:code]
|
319
338
|
@visible = visible_dup
|
320
339
|
@index = index_dup
|
321
340
|
@active = active_dup
|
322
341
|
sub.close
|
323
|
-
return
|
324
|
-
when 'q'
|
342
|
+
return selected
|
343
|
+
when 'q', 27
|
325
344
|
@visible = visible_dup
|
326
345
|
@index = index_dup
|
327
346
|
@active = active_dup
|
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.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|
@@ -119,6 +119,7 @@ extensions: []
|
|
119
119
|
extra_rdoc_files: []
|
120
120
|
files:
|
121
121
|
- CHANGELOG.md
|
122
|
+
- README.md
|
122
123
|
- exe/luca
|
123
124
|
- lib/luca_term.rb
|
124
125
|
- lib/luca_term/book.rb
|
@@ -130,7 +131,7 @@ metadata:
|
|
130
131
|
homepage_uri: https://github.com/chumaltd/luca/tree/master/lucaterm
|
131
132
|
source_code_uri: https://github.com/chumaltd/luca/tree/master/lucaterm
|
132
133
|
changelog_uri: https://github.com/chumaltd/luca/tree/master/lucaterm/CHANGELOG.md
|
133
|
-
post_install_message:
|
134
|
+
post_install_message:
|
134
135
|
rdoc_options: []
|
135
136
|
require_paths:
|
136
137
|
- lib
|
@@ -145,8 +146,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
146
|
- !ruby/object:Gem::Version
|
146
147
|
version: '0'
|
147
148
|
requirements: []
|
148
|
-
rubygems_version: 3.
|
149
|
-
signing_key:
|
149
|
+
rubygems_version: 3.3.5
|
150
|
+
signing_key:
|
150
151
|
specification_version: 4
|
151
152
|
summary: Terminal frontend for Luca Suite
|
152
153
|
test_files: []
|