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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c072f724a2ad3fb09fc648c4912c974d8c874fd82165e525bb6cd3d06073f645
4
- data.tar.gz: 6d6a198f22a9fab3ea8c6426f98571927577862b61f1b6b4f955e8442375b778
3
+ metadata.gz: 54d96bf786cd39ffd8aa30fecb51f15ecc47fe9df16cbdb26765a5b999511e17
4
+ data.tar.gz: a6e2019a9f7635a4ce03c6ba6d4698bafe247de3b4efd939520cabbda982ba3b
5
5
  SHA512:
6
- metadata.gz: 8d6b3ec02aaf1dac932d47dc74fa0c61604915a7ab79a3198c83075f67d94a5cffd5c5a2673cd8c852806aafcc8d875cc3040d5680c248fcfdcc25797c0030c2
7
- data.tar.gz: 74d40973ea0f60f6e5dc9d40fd52d3548683525ffe018b5c1e054175dc06303eac3da2d4da9a10bff02c4f5e496bef4d495180dac7a5b37352c7d5816a606d11
6
+ metadata.gz: e52b886789231af4e2aa01a98c0a0eb42af28c98120f533e0bf9c69f9819d08011eb9edb324a75d5f29568b5e0a10b32c050e71294ab89cbd96d632b02d8ba0a
7
+ data.tar.gz: cd9b2d385ad3471d73d82001a6691849da7f7ef4777421e82b95e268388cb5772747d6216760a75c667b6c74525593db7582923bfa7bf0dbbb2e3cc0b5d8e4ef
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## LucaTerm 0.2.2
2
+
3
+ * `luca book`: Basic Note edit('c' on detail screen).
4
+
5
+ ## LucaTerm 0.2.1
6
+
7
+ * `luca book` Fix: proper account code selection
8
+
1
9
  ## LucaTerm 0.2.0
2
10
 
3
11
  * `luca book`: Works without args. Show journals of the latest month.
data/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # LucaTerm
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/lucaterm.svg)](https://badge.fury.io/rb/lucaterm)
4
+ [![doc](https://img.shields.io/badge/doc-rubydoc-green.svg)](https://www.rubydoc.info/gems/lucaterm/index)
5
+ ![license](https://img.shields.io/github/license/chumaltd/luca)
6
+
7
+ Terminal frontend app for LucaSuite.
8
+
9
+ ## Usage
10
+
11
+ ```bash
12
+ $ luca book [yyyy m]
13
+ ```
@@ -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 list[@index][:code]
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucaTerm
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.2'
5
5
  end
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.0
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: 2022-03-16 00:00:00.000000000 Z
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.2.5
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: []