mrjoy-mintkit 0.0.4 → 0.0.5
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 +11 -1
- data/README.md +2 -1
- data/lib/mintkit/client.rb +22 -22
- data/lib/mintkit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bc6fae8daafc060f403f3e1b88f6509016be05a
|
4
|
+
data.tar.gz: 9b1111adcec6366bb4f6600e1c28584dc7752127
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72a49cf8a2b95b308a2e8d698eb9cdf10ac25c3afd7abafe4d3603c85e7b9fb765b2c57ba64178707349b9a21218fcf212fd3f6365186af91c86e5abd1f4cc76
|
7
|
+
data.tar.gz: 07186b66b7391ee28f794fd273256a919f4680d29b7ec9c21edc8793a3965a0d2426ce2a7c0a05727939b7a4af8bf459bec90f1000c65ad00f67c5a027e29758
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
### dev
|
2
|
-
[full changelog](http://github.com/MrJoy/mintkit/compare/v0.0.
|
2
|
+
[full changelog](http://github.com/MrJoy/mintkit/compare/v0.0.5...master)
|
3
|
+
|
4
|
+
|
5
|
+
### v0.0.5
|
6
|
+
[full changelog](http://github.com/MrJoy/mintkit/compare/v0.0.4...v0.0.5)
|
7
|
+
|
8
|
+
Changes
|
9
|
+
|
10
|
+
* Updated to use a proper CSV parser in order to properly handle transactions
|
11
|
+
with commas in the values.
|
12
|
+
|
3
13
|
|
4
14
|
### v0.0.4
|
5
15
|
[full changelog](http://github.com/MrJoy/mintkit/compare/3f12e2d21ef2adaf79dff02d634d2fd3ea45b33e...v0.0.4)
|
data/README.md
CHANGED
@@ -4,7 +4,8 @@ A Mint.com API. Not at all affiliated with or endorsed by mint.com/intuit. You
|
|
4
4
|
|
5
5
|
## This Fork
|
6
6
|
|
7
|
-
*
|
7
|
+
* Updated to work with Mint.com as of 2013-11-10.
|
8
|
+
* Updated to properly handle transactions with commas in any field.
|
8
9
|
|
9
10
|
## Installation
|
10
11
|
|
data/lib/mintkit/client.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "mechanize"
|
2
2
|
require "json"
|
3
3
|
require "mintkit/error"
|
4
|
+
require "csv"
|
4
5
|
|
5
6
|
module Mintkit
|
6
7
|
|
@@ -21,32 +22,31 @@ module Mintkit
|
|
21
22
|
|
22
23
|
transos = []
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
line_array = line.split(",")
|
28
|
-
transaction = {
|
29
|
-
:date => Date.strptime(remove_quotes(line_array[0]), '%m/%d/%Y'),
|
30
|
-
:description=>remove_quotes(line_array[1]),
|
31
|
-
:original_description=>remove_quotes(line_array[2]),
|
32
|
-
:amount=>remove_quotes(line_array[3]).to_f,
|
33
|
-
:type=>remove_quotes(line_array[4]),
|
34
|
-
:category=>remove_quotes(line_array[5]),
|
35
|
-
:account=>remove_quotes(line_array[6]),
|
36
|
-
:labels=>remove_quotes(line_array[7]),
|
37
|
-
:notes=>remove_quotes(line_array[8])
|
38
|
-
}
|
39
|
-
transos << transaction
|
25
|
+
CSV::Converters[:string] = proc do |field|
|
26
|
+
field.encode(ConverterEncoding) rescue field
|
27
|
+
end
|
40
28
|
|
41
|
-
|
42
|
-
|
43
|
-
|
29
|
+
transos = CSV.parse(raw_transactions, { :headers => true }).map do |row|
|
30
|
+
puts row.inspect
|
31
|
+
{
|
32
|
+
:date => Date.strptime(row['Date'], '%m/%d/%Y'),
|
33
|
+
:description => row['Description'],
|
34
|
+
:original_description => row['Original Description'],
|
35
|
+
:amount => row['Amount'].to_f,
|
36
|
+
:type => row['Transaction Type'],
|
37
|
+
:category => row['Category'],
|
38
|
+
:account => row['Account Name'],
|
39
|
+
:labels => row['Labels'],
|
40
|
+
:notes => row['Notes'],
|
41
|
+
}
|
42
|
+
end
|
44
43
|
|
44
|
+
if block_given?
|
45
|
+
transos.each do |transaction|
|
46
|
+
yield transaction
|
45
47
|
end
|
46
|
-
|
47
48
|
end
|
48
49
|
transos
|
49
|
-
|
50
50
|
end
|
51
51
|
|
52
52
|
def accounts
|
@@ -93,7 +93,7 @@ module Mintkit
|
|
93
93
|
@agent.post("https://wwws.mint.com/refreshFILogins.xevent", {"token"=>@token})
|
94
94
|
|
95
95
|
true
|
96
|
-
|
96
|
+
|
97
97
|
end
|
98
98
|
private
|
99
99
|
|
data/lib/mintkit/version.rb
CHANGED