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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b3b4088d077cc7f00227616a72cb8b3ceee7ec6b
4
- data.tar.gz: f0af12774c1ac656196e2ab6c4fd344a2cc09c1e
3
+ metadata.gz: 9a16e263b404d2e173ce518b398a1c2c513e90f0
4
+ data.tar.gz: 376d5cd41c05585df298ca5addf2944780143243
5
5
  SHA512:
6
- metadata.gz: 1f8fe4aa72b96c8deeff382b18c6dc3fdd8df5360b859e49891beed8522b79a135d0f8f4994bc5d90137457407fd68d567faa6f1b4837d96a6f006775a4387e8
7
- data.tar.gz: 9d8cfe9ffab12fcc0e77af8e5f613ab12d9b403a5122ed42cf983cedc24696ec5b4df90ae046ab5575301e6f51f23522f516ace2782c8934c381d7e79a640b21
6
+ metadata.gz: 8d259f774788ed00e1ae9c7fbf2c18469a4476dc233fc7cc58d00807c5c8777f13600d4c76b430dc56ebbb206c8df43c03af4c993680f0211c83a149b2c239da
7
+ data.tar.gz: 9a04a5ed218f9a5b023f46667c58f096b578c7be73492fd9f43ad99cd711dc74f69a015806ede8b46d4a25e04361878c01f9e169360d1a76c56eaa64efaee5dc
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- reckon (0.4.1)
4
+ reckon (0.4.2)
5
5
  chronic (>= 0.3.0)
6
6
  fastercsv (>= 1.5.1)
7
7
  highline (>= 1.5.2)
@@ -39,7 +39,10 @@ module Reckon
39
39
  end
40
40
 
41
41
  def extract_account_tokens(subtree, account = nil)
42
- if subtree.is_a?(Array)
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(':')) }
@@ -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)
@@ -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.1"
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.1
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-07-08 00:00:00.000000000 Z
12
+ date: 2015-08-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec