ofx_reader 0.1.0 → 0.1.1
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 +5 -5
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +44 -5
- data/exe/ofx_reader +8 -0
- data/lib/ofx_reader/parser/ofx_102.rb +3 -7
- data/lib/ofx_reader/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5b7c0af542e0bc3eac039e0be6951296fc4bec35a5788a1b57fef2a46a44464f
|
4
|
+
data.tar.gz: e6134bfd4110f53e6346df260ee2a132068c43ae4175030f79af2626932d3ebf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f53b13b9959a2753f60e27fdb398e46bf8cfaa683fbec3b77f0a86c697732f9bccbd14e682d0aeb47b2c2331d6058163e76e65250e4022b0172dc4adc6d680da
|
7
|
+
data.tar.gz: 209ab94d1feba0269ac670f557a69b8f8c6d3cd5466ff424606c50c2b33b9689e390936f7b56b1ed16b87b2f107cf0b79df7faa3b71dd87b68cf8c0a1c0b6924
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# OFXReader
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Simple OFX Reader
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,7 +20,48 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
```ruby
|
24
|
+
ofx = OFXReader::Parser::OFX102.new(ofx_text)
|
25
|
+
```
|
26
|
+
|
27
|
+
#### Headers
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
ofx.headers
|
31
|
+
=> {
|
32
|
+
'OFXHEADER' => '100'
|
33
|
+
'DATA' => 'OFXSGML'
|
34
|
+
'VERSION' => '102'
|
35
|
+
'SECURITY' => 'TYPE1'
|
36
|
+
'ENCODING' => 'USASCII'
|
37
|
+
'CHARSET' => '1252'
|
38
|
+
'COMPRESSION' => 'NONE'
|
39
|
+
'OLDFILEUID' => 'NONE'
|
40
|
+
'NEWFILEUID' => 'NONE'
|
41
|
+
}
|
42
|
+
```
|
43
|
+
|
44
|
+
#### Account
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
ofx.account
|
48
|
+
=> { bank_id: '1', account_id: '1' }
|
49
|
+
```
|
50
|
+
|
51
|
+
#### Transactions
|
52
|
+
|
53
|
+
Will return a hash with all fields on .OFX file, using original names, as symbols:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
ofx.transactions
|
57
|
+
=> [{
|
58
|
+
trntype: "DEBIT",
|
59
|
+
dtposted: '20171214000000[-3:EST]'),
|
60
|
+
trnamt: -99.99,
|
61
|
+
fitid: "00000000000000000000000000",
|
62
|
+
name: "TRANSACTION DESCRIPTION"
|
63
|
+
}, ... ]
|
64
|
+
```
|
26
65
|
|
27
66
|
## Development
|
28
67
|
|
data/exe/ofx_reader
ADDED
@@ -33,13 +33,9 @@ module OFXReader
|
|
33
33
|
private
|
34
34
|
|
35
35
|
def build_transaction(node)
|
36
|
-
{
|
37
|
-
|
38
|
-
|
39
|
-
amount: node.search('TRNAMT').text.to_f,
|
40
|
-
fit_id: node.search('FITID').text,
|
41
|
-
name: node.search('NAME').text
|
42
|
-
}
|
36
|
+
node.children.map.with_object({}) do |field, hash|
|
37
|
+
hash[field.name.downcase.to_sym] = field.text
|
38
|
+
end
|
43
39
|
end
|
44
40
|
end
|
45
41
|
end
|
data/lib/ofx_reader/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ofx_reader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francisco Martins
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -83,7 +83,8 @@ dependencies:
|
|
83
83
|
description:
|
84
84
|
email:
|
85
85
|
- franciscomxs@gmail.com
|
86
|
-
executables:
|
86
|
+
executables:
|
87
|
+
- ofx_reader
|
87
88
|
extensions: []
|
88
89
|
extra_rdoc_files: []
|
89
90
|
files:
|
@@ -96,6 +97,7 @@ files:
|
|
96
97
|
- Rakefile
|
97
98
|
- bin/console
|
98
99
|
- bin/setup
|
100
|
+
- exe/ofx_reader
|
99
101
|
- lib/ofx_reader.rb
|
100
102
|
- lib/ofx_reader/parser/base.rb
|
101
103
|
- lib/ofx_reader/parser/ofx_102.rb
|
@@ -120,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
122
|
version: '0'
|
121
123
|
requirements: []
|
122
124
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.
|
125
|
+
rubygems_version: 2.7.3
|
124
126
|
signing_key:
|
125
127
|
specification_version: 4
|
126
128
|
summary: A simple ofx reader
|