qiflib 0.5.0 → 0.6.0
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/README.rdoc +6 -4
- data/lib/qiflib_constants.rb +3 -2
- data/lib/qiflib_transaction.rb +3 -1
- data/lib/qiflib_util.rb +17 -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: 51e9dc951067f401ea12b97a400c04e727167c47
|
4
|
+
data.tar.gz: cf6290ce680111e0b545d66ed2cdd805d3f23882
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 192da3e797aca1e72fb78ebee8e7304d06af6512ffc985e41cc8b7bbee35355106470f4036d35d76a8455f8ba1702ebf742f95e24f07f4a3b781040f1f7582b9
|
7
|
+
data.tar.gz: c820482dae899ecd8fcbaa943c0107d37531e000cfb7def5bc9fbf67c925bb1c4d4cba41c7c15b9763a38ed0355d8b2da933aac469919179a86dc9aaa0796e23
|
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
== Qiflib
|
2
2
|
|
3
|
-
version 0.
|
3
|
+
version 0.6.0, released 12-15-2013
|
4
4
|
|
5
5
|
A ruby library for reading and parsing qif files.
|
6
6
|
|
@@ -13,8 +13,8 @@ Category-name parsing is also supported.
|
|
13
13
|
Also includes DDL generation for importing the parsed categories and
|
14
14
|
transactions into a sqlite3 database.
|
15
15
|
|
16
|
-
|
17
|
-
exports
|
16
|
+
Qiflib now includes support for iBank version 4.7.5; this version
|
17
|
+
exports qif-files slightly differently than previous versions.
|
18
18
|
|
19
19
|
|
20
20
|
== Install
|
@@ -123,6 +123,7 @@ exports silightly differently than previous versions.
|
|
123
123
|
address4 varchar(80),
|
124
124
|
address5 varchar(80),
|
125
125
|
address6 varchar(80),
|
126
|
+
end_balance varchar(80),
|
126
127
|
eol_ind char(1)
|
127
128
|
);
|
128
129
|
|
@@ -165,7 +166,8 @@ exports silightly differently than previous versions.
|
|
165
166
|
csv field index 23 = address4
|
166
167
|
csv field index 24 = address5
|
167
168
|
csv field index 25 = address6
|
168
|
-
csv field index 26 =
|
169
|
+
csv field index 26 = end_balance
|
170
|
+
csv field index 27 = eol_ind
|
169
171
|
|
170
172
|
|
171
173
|
== Generated shell script
|
data/lib/qiflib_constants.rb
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
|
5
5
|
module Qiflib
|
6
6
|
|
7
|
-
VERSION = '0.
|
8
|
-
DATE = '2013-12-
|
7
|
+
VERSION = '0.6.0'
|
8
|
+
DATE = '2013-12-15'
|
9
9
|
AUTHOR = 'Chris Joakim'
|
10
10
|
EMAIL = 'cjoakim@bellsouth.net'
|
11
11
|
SOURCE_QUICKEN = 'quicken'
|
@@ -43,6 +43,7 @@ module Qiflib
|
|
43
43
|
address4
|
44
44
|
address5
|
45
45
|
address6
|
46
|
+
end_balance
|
46
47
|
eol_ind
|
47
48
|
)
|
48
49
|
end
|
data/lib/qiflib_transaction.rb
CHANGED
@@ -10,6 +10,7 @@ module Qiflib
|
|
10
10
|
attr_accessor :acct_owner, :acct_name, :acct_type, :source_app # constructor arg fields
|
11
11
|
attr_reader :date, :amount, :cleared, :category, :number, :payee, :memo # data fields
|
12
12
|
attr_reader :splits, :address
|
13
|
+
attr_accessor :balance
|
13
14
|
|
14
15
|
def self.csv_header
|
15
16
|
CSV.generate do | csv |
|
@@ -23,7 +24,7 @@ module Qiflib
|
|
23
24
|
@acct_name = "#{acct_name}".downcase
|
24
25
|
@acct_type = "#{acct_type}".downcase
|
25
26
|
@source_app = "#{source_app}".downcase
|
26
|
-
@id, @date, @amount, @cleared, @category, @number, @memo, @payee = 0, nil, nil, '', '', '', '', ''
|
27
|
+
@id, @date, @amount, @cleared, @category, @number, @memo, @payee, @balance = 0, nil, nil, '', '', '', '', '', ''
|
27
28
|
@splits, @curr_split, @address = [], {}, []
|
28
29
|
end
|
29
30
|
end
|
@@ -128,6 +129,7 @@ module Qiflib
|
|
128
129
|
array << ''
|
129
130
|
end
|
130
131
|
}
|
132
|
+
array << balance
|
131
133
|
array << 'x'
|
132
134
|
array
|
133
135
|
end
|
data/lib/qiflib_util.rb
CHANGED
@@ -144,6 +144,7 @@ module Qiflib
|
|
144
144
|
lines << ' address4 varchar(80),'
|
145
145
|
lines << ' address5 varchar(80),'
|
146
146
|
lines << ' address6 varchar(80),'
|
147
|
+
lines << ' end_balance varchar(80),'
|
147
148
|
lines << ' eol_ind char(1)'
|
148
149
|
lines << ');'
|
149
150
|
lines << ''
|
@@ -205,6 +206,8 @@ module Qiflib
|
|
205
206
|
elsif stripped.match(/^T/)
|
206
207
|
acct_type = line_value(stripped)
|
207
208
|
current_tran.acct_type = acct_type
|
209
|
+
elsif stripped.match(/^B/)
|
210
|
+
current_tran.balance = parse_balance(stripped)
|
208
211
|
elsif stripped == '^'
|
209
212
|
in_acct_header = false
|
210
213
|
end
|
@@ -235,6 +238,20 @@ module Qiflib
|
|
235
238
|
s[1, s.size].strip
|
236
239
|
end
|
237
240
|
|
241
|
+
def self.parse_balance(stripped)
|
242
|
+
lv = line_value(stripped)
|
243
|
+
if lv.size > 0
|
244
|
+
if lv.start_with?('(')
|
245
|
+
numeric = lv.tr('($,)','').strip
|
246
|
+
"-#{numeric}"
|
247
|
+
else
|
248
|
+
lv.tr('$,','').strip
|
249
|
+
end
|
250
|
+
else
|
251
|
+
''
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
238
255
|
end
|
239
256
|
|
240
257
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qiflib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Joakim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|