lucabook 0.4.3 → 0.4.5

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: 39278cdf39756e6e6a1a5c0a8eef40c1c262040675e5359d520edc4ba49ab483
4
- data.tar.gz: 5b50f82fa507ab782533d5ba99e83e39009f9d8b0054492891f48838afecf44f
3
+ metadata.gz: bc7304203698a38027accd15c692ae271e6e35cadecf4382a07fec093e2498b1
4
+ data.tar.gz: 12294609a4306921c552a7bbd1695fce2a10f1d689016c4b479ec3aa6880441f
5
5
  SHA512:
6
- metadata.gz: 4124b5e84e92f6482023843225091b89c96035d7f4fac4212818ddbebd74b320a7d0a15fcffd8421c88638722710452874fe87e034be5ea3729e2690b7b584ec
7
- data.tar.gz: 52cc24f8b86ed042b6ee4ac9d936bb17a2a28ffee09fd70ffe96d0568afb0d0a23273cb88e0d97fce003e482a3c1c4a5ff259aabf0b14791d7f495369eadf237
6
+ metadata.gz: f01f815713717ad5d12b10dd741560ca179c49865cd596e836ed60c699a2d3ea7dead69802d5f207f3dacde11ea51b54a99120ffdbce182825be4c28412c52ad
7
+ data.tar.gz: c36a05d9b0cae4ec3ae33ad8a07e139b66b642858a940cd68e6d688f2939d9154c618a93060278b75f7115713e5317d5edd9e49ecab1d1198f85ecc2f31ee90f
data/exe/luca-book CHANGED
@@ -20,6 +20,7 @@ class LucaCmd
20
20
 
21
21
  def self.list(args, params)
22
22
  args = gen_range(params[:n]) if args.empty?
23
+ params[:col_order] = %w(date diff balance counter_code note code id no)
23
24
  if params['code']
24
25
  if params['headers']
25
26
  render(LucaBook::ListByHeader.term(*args, code: params['code'], header: params['headers']).list_by_code, params)
@@ -137,7 +138,13 @@ class LucaCmd
137
138
  when 'json'
138
139
  puts JSON.dump(dat)
139
140
  when 'nu'
140
- LucaSupport::View.nushell(YAML.dump(dat))
141
+ if dat.length == 1 and dat.first['balance'] == 0
142
+ puts 'ⓘ Initial balance & records empty in the specified term.'
143
+ else
144
+ LucaSupport::View.nushell(dat, :expand, params[:col_order] || [])
145
+ end
146
+ when 'explore'
147
+ LucaSupport::View.nushell(dat, :explore, params[:col_order] || [])
141
148
  else
142
149
  puts YAML.dump(dat)
143
150
  end
@@ -184,6 +191,7 @@ when /journals?/, 'j'
184
191
  opt.on('--customer', 'categorize by x-customer header') { |_v| params['headers'] = 'x-customer' }
185
192
  opt.on('-n VAL', 'report count') { |v| params[:n] = v.to_i }
186
193
  opt.on('--nu', 'show table in nushell') { |_v| params[:output] = 'nu' }
194
+ opt.on('--explore', 'explore table in nushell') { |_v| params[:output] = 'explore' }
187
195
  opt.on('-o', '--output VAL', 'output serialized data') { |v| params[:output] = v }
188
196
  opt.on('--html', 'output journals html') { |_v| params['render'] = :html }
189
197
  opt.on('--pdf', 'output journals PDF') { |_v| params['render'] = :pdf }
@@ -209,6 +217,7 @@ when /journals?/, 'j'
209
217
  opt.on('-r', '--recursive', 'include subaccounts') { |_v| params[:recursive] = true }
210
218
  opt.on('-n VAL', 'report count') { |v| params[:n] = v.to_i }
211
219
  opt.on('--nu', 'show table in nushell') { |_v| params[:output] = 'nu' }
220
+ opt.on('--explore', 'explore table in nushell') { |_v| params[:output] = 'explore' }
212
221
  opt.on('-o', '--output VAL', 'output serialized data') { |v| params[:output] = v }
213
222
  args = opt.parse!(ARGV)
214
223
  LucaCmd::Journal.stats(args, params)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucaBook
4
- VERSION = '0.4.3'
4
+ VERSION = '0.4.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucabook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.5
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-04-20 00:00:00.000000000 Z
11
+ date: 2023-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lucarecord
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.5.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 0.5.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -108,7 +108,7 @@ licenses:
108
108
  metadata:
109
109
  homepage_uri: https://github.com/chumaltd/luca/tree/master/lucabook
110
110
  source_code_uri: https://github.com/chumaltd/luca/tree/master/lucabook
111
- post_install_message:
111
+ post_install_message:
112
112
  rdoc_options: []
113
113
  require_paths:
114
114
  - lib
@@ -123,8 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
- rubygems_version: 3.2.5
127
- signing_key:
126
+ rubygems_version: 3.3.5
127
+ signing_key:
128
128
  specification_version: 4
129
129
  summary: Book keep
130
130
  test_files: []