reckon 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/reckon/app.rb +4 -1
- data/lib/reckon/csv_parser.rb +1 -1
- data/reckon.gemspec +1 -1
- data/spec/reckon/csv_parser_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a16e263b404d2e173ce518b398a1c2c513e90f0
|
4
|
+
data.tar.gz: 376d5cd41c05585df298ca5addf2944780143243
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d259f774788ed00e1ae9c7fbf2c18469a4476dc233fc7cc58d00807c5c8777f13600d4c76b430dc56ebbb206c8df43c03af4c993680f0211c83a149b2c239da
|
7
|
+
data.tar.gz: 9a04a5ed218f9a5b023f46667c58f096b578c7be73492fd9f43ad99cd711dc74f69a015806ede8b46d4a25e04361878c01f9e169360d1a76c56eaa64efaee5dc
|
data/Gemfile.lock
CHANGED
data/lib/reckon/app.rb
CHANGED
@@ -39,7 +39,10 @@ module Reckon
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def extract_account_tokens(subtree, account = nil)
|
42
|
-
if subtree.
|
42
|
+
if subtree.nil?
|
43
|
+
puts "Warning: empty #{account} tree"
|
44
|
+
{}
|
45
|
+
elsif subtree.is_a?(Array)
|
43
46
|
{ account => subtree }
|
44
47
|
else
|
45
48
|
at = subtree.map { |k, v| extract_account_tokens(v, [account, k].compact.join(':')) }
|
data/lib/reckon/csv_parser.rb
CHANGED
@@ -44,7 +44,7 @@ module Reckon
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def description_for(index)
|
47
|
-
description_column_indices.map { |i| columns[i][index] }.join("; ").squeeze(" ").gsub(/(;\s+){2,}/, '').strip
|
47
|
+
description_column_indices.map { |i| columns[i][index] }.reject { |a| a.empty? }.join("; ").squeeze(" ").gsub(/(;\s+){2,}/, '').strip
|
48
48
|
end
|
49
49
|
|
50
50
|
def evaluate_columns(cols)
|
data/reckon.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = %q{reckon}
|
6
|
-
s.version = "0.4.
|
6
|
+
s.version = "0.4.2"
|
7
7
|
s.authors = ["Andrew Cantino", "BlackEdder"]
|
8
8
|
s.email = %q{andrew@iterationlabs.com}
|
9
9
|
s.homepage = %q{https://github.com/cantino/reckon}
|
@@ -188,6 +188,12 @@ describe Reckon::CSVParser do
|
|
188
188
|
@chase.description_for(1).should == "CHECK; CHECK 2656"
|
189
189
|
@chase.description_for(7).should == "CREDIT; PAYPAL TRANSFER PPD ID: PAYPALSDSL"
|
190
190
|
end
|
191
|
+
|
192
|
+
it "should not append empty description column" do
|
193
|
+
parser = Reckon::CSVParser.new(:string => '01/09/2015,05354 SUBWAY,8.19,,',:date_format => '%d/%m/%Y')
|
194
|
+
parser.description_column_indices.should == [1, 4]
|
195
|
+
parser.description_for(0).should == '05354 SUBWAY'
|
196
|
+
end
|
191
197
|
end
|
192
198
|
|
193
199
|
describe "pretty_money_for" 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.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Cantino
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-08-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|