lucaterm 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b89d7a16d5e1b11ec8bc4caccc299fff6dcaa7edceda8d3ae3e0ad8d24686bb
4
- data.tar.gz: 448a0ed6d343ffd78a09f8f83e80cf729699f49db1f0c3cced73d7cb116cc595
3
+ metadata.gz: 8db2cbe8f9fcab98b6d6cd77e1c2949bc0dff1f3ef5b164bf43e03c27b735048
4
+ data.tar.gz: 9c4e0df8cf90e9af93d16391498ad35013435d0b70eb5d78dfbb8af24cfdc301
5
5
  SHA512:
6
- metadata.gz: 9e50a20eb61aa70ac29caefedbb0316aaa578179eed5d5c5df340161e821ab5b02b65657a4b39e473bba547e356537153e405a0c508ecf48ec3b036238dffbce
7
- data.tar.gz: 53fb5a7d452aaaf0a528e2785601a06d36d16f8790fa48981ab21d43d4f08dbdd43925db67a522f6911be7ff348cd911baa1a49447b199f8271a621f6b23cf53
6
+ metadata.gz: 4f9d780234ef4af22676e041b97146632f87302522b8387a025fb3859c3759fb7b08d9bc6949487c89d93a74b50c360ab6b739e267b084f7b98644dc8798299f
7
+ data.tar.gz: e08947c3c436d4dd3ccfaa64d5932f557f908c2358f79d8566e9b4b986f43b1424e7a246f28d1d0f4d86bf64aa356dd8c043a5b26dabdf0cc7b5e789407efda9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## LucaTerm 0.2.2
2
+
3
+ * `luca book`: Basic Note edit('c' on detail screen).
4
+
1
5
  ## LucaTerm 0.2.1
2
6
 
3
7
  * `luca book` Fix: proper account code selection
@@ -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)
@@ -322,7 +340,7 @@ module LucaTerm
322
340
  @active = active_dup
323
341
  sub.close
324
342
  return selected
325
- when 'q'
343
+ when 'q', 27
326
344
  @visible = visible_dup
327
345
  @index = index_dup
328
346
  @active = active_dup
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucaTerm
4
- VERSION = '0.2.1'
4
+ VERSION = '0.3.0'
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.1
4
+ version: 0.3.0
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-27 00:00:00.000000000 Z
11
+ date: 2023-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0.3'
61
+ version: '0.6'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '0.3'
68
+ version: '0.6'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -131,7 +131,7 @@ metadata:
131
131
  homepage_uri: https://github.com/chumaltd/luca/tree/master/lucaterm
132
132
  source_code_uri: https://github.com/chumaltd/luca/tree/master/lucaterm
133
133
  changelog_uri: https://github.com/chumaltd/luca/tree/master/lucaterm/CHANGELOG.md
134
- post_install_message:
134
+ post_install_message:
135
135
  rdoc_options: []
136
136
  require_paths:
137
137
  - lib
@@ -139,15 +139,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
139
139
  requirements:
140
140
  - - ">="
141
141
  - !ruby/object:Gem::Version
142
- version: 2.6.0
142
+ version: 3.0.0
143
143
  required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
145
  - - ">="
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  requirements: []
149
- rubygems_version: 3.2.5
150
- signing_key:
149
+ rubygems_version: 3.4.10
150
+ signing_key:
151
151
  specification_version: 4
152
152
  summary: Terminal frontend for Luca Suite
153
153
  test_files: []