reckon 0.5.4 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +50 -0
  3. data/.gitignore +3 -0
  4. data/.ruby-version +1 -1
  5. data/CHANGELOG.md +73 -4
  6. data/Gemfile.lock +1 -45
  7. data/README.md +84 -33
  8. data/Rakefile +17 -1
  9. data/bin/build-new-version.sh +26 -0
  10. data/bin/reckon +6 -1
  11. data/lib/reckon.rb +2 -2
  12. data/lib/reckon/app.rb +140 -194
  13. data/lib/reckon/csv_parser.rb +2 -7
  14. data/lib/reckon/date_column.rb +10 -0
  15. data/lib/reckon/money.rb +48 -48
  16. data/lib/reckon/options.rb +149 -0
  17. data/lib/reckon/version.rb +1 -1
  18. data/reckon.gemspec +1 -3
  19. data/spec/integration/another_bank_example/input.csv +9 -0
  20. data/spec/integration/another_bank_example/output.ledger +36 -0
  21. data/spec/integration/another_bank_example/test_args +1 -0
  22. data/spec/integration/austrian_example/input.csv +13 -0
  23. data/spec/integration/austrian_example/output.ledger +52 -0
  24. data/spec/integration/austrian_example/test_args +2 -0
  25. data/spec/integration/bom_utf8_file/input.csv +3 -0
  26. data/spec/integration/bom_utf8_file/output.ledger +4 -0
  27. data/spec/integration/bom_utf8_file/test_args +3 -0
  28. data/spec/integration/broker_canada_example/input.csv +12 -0
  29. data/spec/integration/broker_canada_example/output.ledger +48 -0
  30. data/spec/integration/broker_canada_example/test_args +1 -0
  31. data/spec/integration/chase/account_tokens_and_regex/output.ledger +36 -0
  32. data/spec/integration/chase/account_tokens_and_regex/test_args +2 -0
  33. data/spec/integration/chase/account_tokens_and_regex/tokens.yml +16 -0
  34. data/spec/integration/chase/default_account_names/output.ledger +36 -0
  35. data/spec/integration/chase/default_account_names/test_args +3 -0
  36. data/spec/integration/chase/input.csv +9 -0
  37. data/spec/integration/chase/learn_from_existing/learn.ledger +7 -0
  38. data/spec/integration/chase/learn_from_existing/output.ledger +36 -0
  39. data/spec/integration/chase/learn_from_existing/test_args +1 -0
  40. data/spec/integration/chase/simple/output.ledger +36 -0
  41. data/spec/integration/chase/simple/test_args +1 -0
  42. data/spec/integration/danish_kroner_nordea_example/input.csv +6 -0
  43. data/spec/integration/danish_kroner_nordea_example/output.ledger +24 -0
  44. data/spec/integration/danish_kroner_nordea_example/test_args +1 -0
  45. data/spec/integration/english_date_example/input.csv +3 -0
  46. data/spec/integration/english_date_example/output.ledger +12 -0
  47. data/spec/integration/english_date_example/test_args +1 -0
  48. data/spec/integration/extratofake/input.csv +24 -0
  49. data/spec/integration/extratofake/output.ledger +92 -0
  50. data/spec/integration/extratofake/test_args +1 -0
  51. data/spec/integration/french_example/input.csv +9 -0
  52. data/spec/integration/french_example/output.ledger +36 -0
  53. data/spec/integration/french_example/test_args +2 -0
  54. data/spec/integration/german_date_example/input.csv +3 -0
  55. data/spec/integration/german_date_example/output.ledger +12 -0
  56. data/spec/integration/german_date_example/test_args +1 -0
  57. data/spec/integration/harder_date_example/input.csv +5 -0
  58. data/spec/integration/harder_date_example/output.ledger +20 -0
  59. data/spec/integration/harder_date_example/test_args +1 -0
  60. data/spec/integration/ing/input.csv +3 -0
  61. data/spec/integration/ing/output.ledger +12 -0
  62. data/spec/integration/ing/test_args +1 -0
  63. data/spec/integration/intuit_mint_example/input.csv +7 -0
  64. data/spec/integration/intuit_mint_example/output.ledger +28 -0
  65. data/spec/integration/intuit_mint_example/test_args +1 -0
  66. data/spec/integration/invalid_header_example/input.csv +6 -0
  67. data/spec/integration/invalid_header_example/output.ledger +8 -0
  68. data/spec/integration/invalid_header_example/test_args +1 -0
  69. data/spec/integration/inversed_credit_card/input.csv +16 -0
  70. data/spec/integration/inversed_credit_card/output.ledger +64 -0
  71. data/spec/integration/inversed_credit_card/test_args +1 -0
  72. data/spec/integration/nationwide/input.csv +4 -0
  73. data/spec/integration/nationwide/output.ledger +16 -0
  74. data/spec/integration/nationwide/test_args +1 -0
  75. data/spec/integration/regression/issue_51_account_tokens/input.csv +8 -0
  76. data/spec/integration/regression/issue_51_account_tokens/output.ledger +32 -0
  77. data/spec/integration/regression/issue_51_account_tokens/test_args +4 -0
  78. data/spec/integration/regression/issue_51_account_tokens/tokens.yml +9 -0
  79. data/spec/integration/regression/issue_64_date_column/input.csv +3 -0
  80. data/spec/integration/regression/issue_64_date_column/output.ledger +8 -0
  81. data/spec/integration/regression/issue_64_date_column/test_args +1 -0
  82. data/spec/integration/regression/issue_73_account_token_matching/input.csv +2 -0
  83. data/spec/integration/regression/issue_73_account_token_matching/output.ledger +4 -0
  84. data/spec/integration/regression/issue_73_account_token_matching/test_args +6 -0
  85. data/spec/integration/regression/issue_73_account_token_matching/tokens.yml +8 -0
  86. data/spec/integration/regression/issue_85_date_example/input.csv +2 -0
  87. data/spec/integration/regression/issue_85_date_example/output.ledger +8 -0
  88. data/spec/integration/regression/issue_85_date_example/test_args +1 -0
  89. data/spec/integration/spanish_date_example/input.csv +3 -0
  90. data/spec/integration/spanish_date_example/output.ledger +12 -0
  91. data/spec/integration/spanish_date_example/test_args +1 -0
  92. data/spec/integration/suntrust/input.csv +7 -0
  93. data/spec/integration/suntrust/output.ledger +28 -0
  94. data/spec/integration/suntrust/test_args +1 -0
  95. data/spec/integration/test.sh +83 -0
  96. data/spec/integration/test_money_column/input.csv +3 -0
  97. data/spec/integration/test_money_column/output.ledger +8 -0
  98. data/spec/integration/test_money_column/test_args +1 -0
  99. data/spec/integration/two_money_columns/input.csv +5 -0
  100. data/spec/integration/two_money_columns/output.ledger +20 -0
  101. data/spec/integration/two_money_columns/test_args +1 -0
  102. data/spec/integration/yyyymmdd_date_example/input.csv +1 -0
  103. data/spec/integration/yyyymmdd_date_example/output.ledger +4 -0
  104. data/spec/integration/yyyymmdd_date_example/test_args +1 -0
  105. data/spec/reckon/app_spec.rb +25 -7
  106. data/spec/reckon/ledger_parser_spec.rb +2 -2
  107. data/spec/reckon/money_column_spec.rb +24 -24
  108. data/spec/reckon/money_spec.rb +13 -32
  109. data/spec/reckon/options_spec.rb +17 -0
  110. data/spec/spec_helper.rb +6 -1
  111. metadata +97 -35
  112. data/.travis.yml +0 -13
data/spec/spec_helper.rb CHANGED
@@ -16,13 +16,18 @@ public
16
16
  def silence_output
17
17
  # Store the original stderr and stdout in order to restore them later
18
18
  @original_stdout = $stdout
19
+ @original_stderr = $stderr
19
20
 
20
21
  # Redirect stderr and stdout
21
- $stdout = File.new(File.join(File.dirname(__FILE__), 'test_log.txt'), 'w')
22
+ $stderr = File.new(File.join(File.dirname(__FILE__), 'test_log.txt'), 'w')
23
+ $stdout = $stderr
24
+ Reckon::LOGGER.reopen $stderr
22
25
  end
23
26
 
24
27
  # Replace stderr and stdout so anything else is output correctly
25
28
  def enable_output
26
29
  $stdout = @original_stdout
27
30
  @original_stdout = nil
31
+ $stderr = @original_stderr
32
+ @original_stderr = nil
28
33
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reckon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Cantino
8
8
  - BlackEdder
9
9
  - Ben Prew
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-06-05 00:00:00.000000000 Z
13
+ date: 2021-02-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -54,20 +54,6 @@ dependencies:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
56
  version: 1.2.0
57
- - !ruby/object:Gem::Dependency
58
- name: github_changelog_generator
59
- requirement: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: '0'
64
- type: :development
65
- prerelease: false
66
- version_requirements: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- version: '0'
71
57
  - !ruby/object:Gem::Dependency
72
58
  name: chronic
73
59
  requirement: !ruby/object:Gem::Requirement
@@ -96,20 +82,6 @@ dependencies:
96
82
  - - ">="
97
83
  - !ruby/object:Gem::Version
98
84
  version: 1.5.2
99
- - !ruby/object:Gem::Dependency
100
- name: terminal-table
101
- requirement: !ruby/object:Gem::Requirement
102
- requirements:
103
- - - ">="
104
- - !ruby/object:Gem::Version
105
- version: 1.4.2
106
- type: :runtime
107
- prerelease: false
108
- version_requirements: !ruby/object:Gem::Requirement
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- version: 1.4.2
113
85
  - !ruby/object:Gem::Dependency
114
86
  name: rchardet
115
87
  requirement: !ruby/object:Gem::Requirement
@@ -129,21 +101,23 @@ description: Reckon automagically converts CSV files for use with the command-li
129
101
  with the CSV data using Bayesian machine learning.
130
102
  email: andrew@iterationlabs.com
131
103
  executables:
104
+ - build-new-version.sh
132
105
  - reckon
133
106
  extensions: []
134
107
  extra_rdoc_files: []
135
108
  files:
136
109
  - ".document"
110
+ - ".github/workflows/ruby.yml"
137
111
  - ".gitignore"
138
112
  - ".ruby-gemset"
139
113
  - ".ruby-version"
140
- - ".travis.yml"
141
114
  - CHANGELOG.md
142
115
  - Gemfile
143
116
  - Gemfile.lock
144
117
  - LICENSE
145
118
  - README.md
146
119
  - Rakefile
120
+ - bin/build-new-version.sh
147
121
  - bin/reckon
148
122
  - lib/reckon.rb
149
123
  - lib/reckon/app.rb
@@ -153,6 +127,7 @@ files:
153
127
  - lib/reckon/ledger_parser.rb
154
128
  - lib/reckon/logger.rb
155
129
  - lib/reckon/money.rb
130
+ - lib/reckon/options.rb
156
131
  - lib/reckon/version.rb
157
132
  - reckon.gemspec
158
133
  - spec/data_fixtures/51-sample.csv
@@ -184,19 +159,106 @@ files:
184
159
  - spec/data_fixtures/tokens.yaml
185
160
  - spec/data_fixtures/two_money_columns.csv
186
161
  - spec/data_fixtures/yyyymmdd_date_example.csv
162
+ - spec/integration/another_bank_example/input.csv
163
+ - spec/integration/another_bank_example/output.ledger
164
+ - spec/integration/another_bank_example/test_args
165
+ - spec/integration/austrian_example/input.csv
166
+ - spec/integration/austrian_example/output.ledger
167
+ - spec/integration/austrian_example/test_args
168
+ - spec/integration/bom_utf8_file/input.csv
169
+ - spec/integration/bom_utf8_file/output.ledger
170
+ - spec/integration/bom_utf8_file/test_args
171
+ - spec/integration/broker_canada_example/input.csv
172
+ - spec/integration/broker_canada_example/output.ledger
173
+ - spec/integration/broker_canada_example/test_args
174
+ - spec/integration/chase/account_tokens_and_regex/output.ledger
175
+ - spec/integration/chase/account_tokens_and_regex/test_args
176
+ - spec/integration/chase/account_tokens_and_regex/tokens.yml
177
+ - spec/integration/chase/default_account_names/output.ledger
178
+ - spec/integration/chase/default_account_names/test_args
179
+ - spec/integration/chase/input.csv
180
+ - spec/integration/chase/learn_from_existing/learn.ledger
181
+ - spec/integration/chase/learn_from_existing/output.ledger
182
+ - spec/integration/chase/learn_from_existing/test_args
183
+ - spec/integration/chase/simple/output.ledger
184
+ - spec/integration/chase/simple/test_args
185
+ - spec/integration/danish_kroner_nordea_example/input.csv
186
+ - spec/integration/danish_kroner_nordea_example/output.ledger
187
+ - spec/integration/danish_kroner_nordea_example/test_args
188
+ - spec/integration/english_date_example/input.csv
189
+ - spec/integration/english_date_example/output.ledger
190
+ - spec/integration/english_date_example/test_args
191
+ - spec/integration/extratofake/input.csv
192
+ - spec/integration/extratofake/output.ledger
193
+ - spec/integration/extratofake/test_args
194
+ - spec/integration/french_example/input.csv
195
+ - spec/integration/french_example/output.ledger
196
+ - spec/integration/french_example/test_args
197
+ - spec/integration/german_date_example/input.csv
198
+ - spec/integration/german_date_example/output.ledger
199
+ - spec/integration/german_date_example/test_args
200
+ - spec/integration/harder_date_example/input.csv
201
+ - spec/integration/harder_date_example/output.ledger
202
+ - spec/integration/harder_date_example/test_args
203
+ - spec/integration/ing/input.csv
204
+ - spec/integration/ing/output.ledger
205
+ - spec/integration/ing/test_args
206
+ - spec/integration/intuit_mint_example/input.csv
207
+ - spec/integration/intuit_mint_example/output.ledger
208
+ - spec/integration/intuit_mint_example/test_args
209
+ - spec/integration/invalid_header_example/input.csv
210
+ - spec/integration/invalid_header_example/output.ledger
211
+ - spec/integration/invalid_header_example/test_args
212
+ - spec/integration/inversed_credit_card/input.csv
213
+ - spec/integration/inversed_credit_card/output.ledger
214
+ - spec/integration/inversed_credit_card/test_args
215
+ - spec/integration/nationwide/input.csv
216
+ - spec/integration/nationwide/output.ledger
217
+ - spec/integration/nationwide/test_args
218
+ - spec/integration/regression/issue_51_account_tokens/input.csv
219
+ - spec/integration/regression/issue_51_account_tokens/output.ledger
220
+ - spec/integration/regression/issue_51_account_tokens/test_args
221
+ - spec/integration/regression/issue_51_account_tokens/tokens.yml
222
+ - spec/integration/regression/issue_64_date_column/input.csv
223
+ - spec/integration/regression/issue_64_date_column/output.ledger
224
+ - spec/integration/regression/issue_64_date_column/test_args
225
+ - spec/integration/regression/issue_73_account_token_matching/input.csv
226
+ - spec/integration/regression/issue_73_account_token_matching/output.ledger
227
+ - spec/integration/regression/issue_73_account_token_matching/test_args
228
+ - spec/integration/regression/issue_73_account_token_matching/tokens.yml
229
+ - spec/integration/regression/issue_85_date_example/input.csv
230
+ - spec/integration/regression/issue_85_date_example/output.ledger
231
+ - spec/integration/regression/issue_85_date_example/test_args
232
+ - spec/integration/spanish_date_example/input.csv
233
+ - spec/integration/spanish_date_example/output.ledger
234
+ - spec/integration/spanish_date_example/test_args
235
+ - spec/integration/suntrust/input.csv
236
+ - spec/integration/suntrust/output.ledger
237
+ - spec/integration/suntrust/test_args
238
+ - spec/integration/test.sh
239
+ - spec/integration/test_money_column/input.csv
240
+ - spec/integration/test_money_column/output.ledger
241
+ - spec/integration/test_money_column/test_args
242
+ - spec/integration/two_money_columns/input.csv
243
+ - spec/integration/two_money_columns/output.ledger
244
+ - spec/integration/two_money_columns/test_args
245
+ - spec/integration/yyyymmdd_date_example/input.csv
246
+ - spec/integration/yyyymmdd_date_example/output.ledger
247
+ - spec/integration/yyyymmdd_date_example/test_args
187
248
  - spec/reckon/app_spec.rb
188
249
  - spec/reckon/csv_parser_spec.rb
189
250
  - spec/reckon/date_column_spec.rb
190
251
  - spec/reckon/ledger_parser_spec.rb
191
252
  - spec/reckon/money_column_spec.rb
192
253
  - spec/reckon/money_spec.rb
254
+ - spec/reckon/options_spec.rb
193
255
  - spec/spec.opts
194
256
  - spec/spec_helper.rb
195
257
  homepage: https://github.com/cantino/reckon
196
258
  licenses:
197
259
  - MIT
198
260
  metadata: {}
199
- post_install_message:
261
+ post_install_message:
200
262
  rdoc_options: []
201
263
  require_paths:
202
264
  - lib
@@ -211,8 +273,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
273
  - !ruby/object:Gem::Version
212
274
  version: '0'
213
275
  requirements: []
214
- rubygems_version: 3.1.2
215
- signing_key:
276
+ rubygems_version: 3.2.3
277
+ signing_key:
216
278
  specification_version: 4
217
279
  summary: Utility for interactively converting and labeling CSV files for the Ledger
218
280
  accounting tool.
data/.travis.yml DELETED
@@ -1,13 +0,0 @@
1
- language: ruby
2
- rvm:
3
- # Mac High Sierra
4
- - 2.0.0-p648
5
- # Mac Mojave
6
- - 2.3.7
7
- # Ubuntu 19.10
8
- - 2.5
9
- # Mac Catalina
10
- - 2.6
11
- script: "bundle exec rake"
12
- before_install:
13
- - sudo apt-get -y install ledger