reckon 0.6.1 → 0.6.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 +16 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -0
- data/bin/reckon +6 -1
- data/lib/reckon/app.rb +11 -2
- data/lib/reckon/version.rb +1 -1
- data/spec/reckon/app_spec.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5debbf17f216c822d753863d7c4adf18318beaf06f608d9d145e7f07b2a0b91b
|
4
|
+
data.tar.gz: f1d393d4aae4cd646794c2b6388a77f2dcf0b154874b6a379922ab7b05a8da92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e35912bb53131baa9a150ce05eede60946fd0101566e84fd9ab21476fbed54cadc011e56d18b29502d3b2c020cd325d6e8883f9f7827485bab1d8e4e6907a853
|
7
|
+
data.tar.gz: 4e67777ef46d71051372c41ec5be831cf8a6945d2da12d84bfc346b58db5604f79c1b1cfcc1471dd445a8767cc5ec47c4a465af9c41c9c830f38879ed3c3b6e4
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,21 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## [0.6.
|
3
|
+
## [0.6.2](https://github.com/cantino/reckon/tree/0.6.2) (2021-01-24)
|
4
4
|
|
5
|
-
[Full Changelog](https://github.com/cantino/reckon/compare/v0.6.
|
5
|
+
[Full Changelog](https://github.com/cantino/reckon/compare/v0.6.1...0.6.2)
|
6
|
+
|
7
|
+
**Closed issues:**
|
8
|
+
|
9
|
+
- spaces in tokens [\#97](https://github.com/cantino/reckon/issues/97)
|
10
|
+
- read from stdin [\#95](https://github.com/cantino/reckon/issues/95)
|
11
|
+
|
12
|
+
**Merged pull requests:**
|
13
|
+
|
14
|
+
- Allow using '-' as filename in -f to read csv from STDIN. Fixes \#95 [\#98](https://github.com/cantino/reckon/pull/98) ([benprew](https://github.com/benprew))
|
15
|
+
|
16
|
+
## [v0.6.1](https://github.com/cantino/reckon/tree/v0.6.1) (2021-01-23)
|
17
|
+
|
18
|
+
[Full Changelog](https://github.com/cantino/reckon/compare/v0.6.0...v0.6.1)
|
6
19
|
|
7
20
|
**Implemented enhancements:**
|
8
21
|
|
@@ -10,7 +23,6 @@
|
|
10
23
|
|
11
24
|
**Closed issues:**
|
12
25
|
|
13
|
-
- spaces in tokens [\#97](https://github.com/cantino/reckon/issues/97)
|
14
26
|
- Migrate CI system from travis-ci.org [\#93](https://github.com/cantino/reckon/issues/93)
|
15
27
|
- \[Feature Request\] Pipe ledger file input to the bayesian predictor \(instead of csv\) [\#91](https://github.com/cantino/reckon/issues/91)
|
16
28
|
|
@@ -166,7 +178,6 @@
|
|
166
178
|
|
167
179
|
**Merged pull requests:**
|
168
180
|
|
169
|
-
- Fix --encoding option [\#41](https://github.com/cantino/reckon/pull/41) ([mamciek](https://github.com/mamciek))
|
170
181
|
- Bumped version number [\#37](https://github.com/cantino/reckon/pull/37) ([BlackEdder](https://github.com/BlackEdder))
|
171
182
|
|
172
183
|
## [v0.3.9](https://github.com/cantino/reckon/tree/v0.3.9) (2014-02-20)
|
@@ -180,6 +191,7 @@
|
|
180
191
|
|
181
192
|
**Merged pull requests:**
|
182
193
|
|
194
|
+
- Fix --encoding option [\#41](https://github.com/cantino/reckon/pull/41) ([mamciek](https://github.com/mamciek))
|
183
195
|
- Added spec for csv files from Broker Canada [\#36](https://github.com/cantino/reckon/pull/36) ([BlackEdder](https://github.com/BlackEdder))
|
184
196
|
- Date format [\#35](https://github.com/cantino/reckon/pull/35) ([BlackEdder](https://github.com/BlackEdder))
|
185
197
|
- Added example from a french bank [\#34](https://github.com/cantino/reckon/pull/34) ([BlackEdder](https://github.com/BlackEdder))
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -82,6 +82,10 @@ To guess the accounts reckon can use an existing ledger file or a token file wit
|
|
82
82
|
|
83
83
|
`reckon --unattended --account-tokens tokens.yaml -f bank.csv -o ledger.dat`
|
84
84
|
|
85
|
+
In unattended mode, you can use STDIN to read your csv data, by specifying `-` as the argument to `-f`.
|
86
|
+
|
87
|
+
`csv_file_generator | reckon --unattended -l 2010.dat -o ledger.dat -f -`
|
88
|
+
|
85
89
|
### Account Tokens
|
86
90
|
|
87
91
|
The account tokens file provides a way to teach reckon about what tokens are associated with an account. As an example, this `tokens.yaml` file:
|
data/bin/reckon
CHANGED
data/lib/reckon/app.rb
CHANGED
@@ -286,9 +286,9 @@ module Reckon
|
|
286
286
|
print_transaction(rows)
|
287
287
|
end
|
288
288
|
|
289
|
-
def self.parse_opts(args =
|
289
|
+
def self.parse_opts(args=ARGV, stdin=STDIN)
|
290
290
|
options = { :output_file => STDOUT }
|
291
|
-
|
291
|
+
OptionParser.new do |opts|
|
292
292
|
opts.banner = "Usage: Reckon.rb [options]"
|
293
293
|
opts.separator ""
|
294
294
|
|
@@ -394,6 +394,15 @@ module Reckon
|
|
394
394
|
opts.parse!(args)
|
395
395
|
end
|
396
396
|
|
397
|
+
if options[:file] == '-'
|
398
|
+
unless options[:unattended]
|
399
|
+
raise "--unattended is required to use STDIN as CSV source."
|
400
|
+
end
|
401
|
+
|
402
|
+
puts "Reading csv from STDIN"
|
403
|
+
options[:string] = stdin.read
|
404
|
+
end
|
405
|
+
|
397
406
|
unless options[:file]
|
398
407
|
options[:file] = @@cli.ask("What CSV file should I parse? ")
|
399
408
|
unless options[:file].length > 0
|
data/lib/reckon/version.rb
CHANGED
data/spec/reckon/app_spec.rb
CHANGED
@@ -86,6 +86,22 @@ describe Reckon::App do
|
|
86
86
|
expect(output_file.string.scan('Expenses:Websites').count).to eq(2)
|
87
87
|
end
|
88
88
|
end
|
89
|
+
|
90
|
+
describe 'csv from STDIN' do
|
91
|
+
it 'should assign to :string option' do
|
92
|
+
options = Reckon::App.parse_opts(
|
93
|
+
%w[-f - --unattended --account bank],
|
94
|
+
StringIO.new('foo,bar,baz')
|
95
|
+
)
|
96
|
+
expect(options[:string]).to eq('foo,bar,baz')
|
97
|
+
end
|
98
|
+
|
99
|
+
it 'should require --unattended flag' do
|
100
|
+
expect {Reckon::App.parse_opts(%w[-f - --account bank])}.to(
|
101
|
+
raise_error(RuntimeError, "--unattended is required to use STDIN as CSV source.")
|
102
|
+
)
|
103
|
+
end
|
104
|
+
end
|
89
105
|
end
|
90
106
|
|
91
107
|
context "Issue #73 - regression test" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reckon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Cantino
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-01-
|
13
|
+
date: 2021-01-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|