lucabook 0.4.4 → 0.5.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: 210dddde58c2e020242fb4faf8643045b0c46862b050f27dd16c8108baee94d8
4
- data.tar.gz: 95e39bcc78e77c3191e622e64d0b8f3c07738833aeccfadb030348297a38efa8
3
+ metadata.gz: 59f73cb5893a8da8c079d86bc32f1d3b54d04cd6ffc3ae3b09f4272c2b908c6a
4
+ data.tar.gz: 6627a57fda2a20ef8763baabee57117314724f40fd862ee11e5a647239e650e6
5
5
  SHA512:
6
- metadata.gz: 18caa0109f726e8b94d911e39c1f4c5b6d19bbbc7393f1c07f3baadfb197d6b760f8286d13be4fc2ceb393c37690902bd96405031bfa89aa8696f3933f17e55b
7
- data.tar.gz: 15fbecd2cf597ae95d33a6af114fe32ca181bb039fb8d442737303c53ead969c2075a034bfd0ac077bae21587cfc1f623f23108f32fda2e89b542d20bf15d8ae
6
+ metadata.gz: 11a4c3ae324b452ee28c049fc5254c3d899a1857094d338e625c8e1d163619e39d7b8cefa44b335287cf4ad0aee0a0028c9b8951a2fe83a8e4d211c0e4ab4edb
7
+ data.tar.gz: 2d31fdc8cc07909fdc2517286f074f34a3a7fb31408852ca6d5453b7cc562cf8b8ad789e9897574b7e8473c775fdaaf88c6236accd3ca5fff25625392ee559a4
data/exe/luca-book CHANGED
@@ -1,4 +1,15 @@
1
1
  #!/usr/bin/ruby
2
+ # frozen_string_literal: true
3
+
4
+ unless Dir.exist?('data') || ARGV[0] == 'new'
5
+ target = 'journals'
6
+ Dir.glob('*').reject { |f| File.symlink?(f) }
7
+ .find { |f| File.directory?("#{f}/data/#{target}") }.tap do |d|
8
+ abort "No valid data directory, exit..." if d.nil?
9
+
10
+ Dir.chdir(d)
11
+ end
12
+ end
2
13
 
3
14
  require 'json'
4
15
  require 'optparse'
@@ -20,6 +31,7 @@ class LucaCmd
20
31
 
21
32
  def self.list(args, params)
22
33
  args = gen_range(params[:n]) if args.empty?
34
+ params[:col_order] = %w(date diff balance counter_code note code id no)
23
35
  if params['code']
24
36
  if params['headers']
25
37
  render(LucaBook::ListByHeader.term(*args, code: params['code'], header: params['headers']).list_by_code, params)
@@ -140,9 +152,10 @@ class LucaCmd
140
152
  if dat.length == 1 and dat.first['balance'] == 0
141
153
  puts 'ⓘ Initial balance & records empty in the specified term.'
142
154
  else
143
- column_ord = %w(date diff balance counter_code note code id no)
144
- LucaSupport::View.nushell(dat, column_ord)
155
+ LucaSupport::View.nushell(dat, :expand, params[:col_order] || [])
145
156
  end
157
+ when 'explore'
158
+ LucaSupport::View.nushell(dat, :explore, params[:col_order] || [])
146
159
  else
147
160
  puts YAML.dump(dat)
148
161
  end
@@ -189,6 +202,7 @@ when /journals?/, 'j'
189
202
  opt.on('--customer', 'categorize by x-customer header') { |_v| params['headers'] = 'x-customer' }
190
203
  opt.on('-n VAL', 'report count') { |v| params[:n] = v.to_i }
191
204
  opt.on('--nu', 'show table in nushell') { |_v| params[:output] = 'nu' }
205
+ opt.on('--explore', 'explore table in nushell') { |_v| params[:output] = 'explore' }
192
206
  opt.on('-o', '--output VAL', 'output serialized data') { |v| params[:output] = v }
193
207
  opt.on('--html', 'output journals html') { |_v| params['render'] = :html }
194
208
  opt.on('--pdf', 'output journals PDF') { |_v| params['render'] = :pdf }
@@ -214,6 +228,7 @@ when /journals?/, 'j'
214
228
  opt.on('-r', '--recursive', 'include subaccounts') { |_v| params[:recursive] = true }
215
229
  opt.on('-n VAL', 'report count') { |v| params[:n] = v.to_i }
216
230
  opt.on('--nu', 'show table in nushell') { |_v| params[:output] = 'nu' }
231
+ opt.on('--explore', 'explore table in nushell') { |_v| params[:output] = 'explore' }
217
232
  opt.on('-o', '--output VAL', 'output serialized data') { |v| params[:output] = v }
218
233
  args = opt.parse!(ARGV)
219
234
  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.4'
4
+ VERSION = '0.5.0'
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.4
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chuma Takahiro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-11 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: lucarecord
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.4
19
+ version: 0.6.0
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.5.4
26
+ version: 0.6.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -116,14 +116,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - ">="
118
118
  - !ruby/object:Gem::Version
119
- version: 2.6.0
119
+ version: 3.0.0
120
120
  required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
- rubygems_version: 3.3.5
126
+ rubygems_version: 3.4.10
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Book keep