ofx 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ofx/parser/ofx102.rb +3 -1
- data/lib/ofx/version.rb +1 -1
- data/ofx.gemspec +2 -3
- data/spec/ofx/transaction_spec.rb +4 -0
- metadata +4 -4
data/lib/ofx/parser/ofx102.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require "bigdecimal"
|
2
|
+
|
1
3
|
module OFX
|
2
4
|
module Parser
|
3
5
|
class OFX102
|
@@ -46,7 +48,7 @@ module OFX
|
|
46
48
|
end
|
47
49
|
|
48
50
|
def build_transaction(element)
|
49
|
-
amount = element.search("trnamt").inner_text
|
51
|
+
amount = BigDecimal.new(element.search("trnamt").inner_text)
|
50
52
|
|
51
53
|
OFX::Transaction.new({
|
52
54
|
:amount => amount,
|
data/lib/ofx/version.rb
CHANGED
data/ofx.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ofx}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Nando Vieira"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-05-06}
|
13
13
|
s.description = %q{A simple OFX (Open Financial Exchange) parser built on top of Nokogiri. Currently supports OFX 1.0.2.
|
14
14
|
|
15
15
|
Usage:
|
@@ -44,7 +44,6 @@ Usage:
|
|
44
44
|
"spec/ofx/transaction_spec.rb",
|
45
45
|
"spec/spec_helper.rb"
|
46
46
|
]
|
47
|
-
s.has_rdoc = false
|
48
47
|
s.homepage = %q{http://github.com/fnando/ofx}
|
49
48
|
s.rdoc_options = ["--charset=UTF-8"]
|
50
49
|
s.require_paths = ["lib"]
|
@@ -16,6 +16,10 @@ describe OFX::Transaction do
|
|
16
16
|
@transaction.amount.should == -35.34
|
17
17
|
end
|
18
18
|
|
19
|
+
it "should cast amount to BigDecimal" do
|
20
|
+
@transaction.amount.class.should == BigDecimal
|
21
|
+
end
|
22
|
+
|
19
23
|
it "should set amount in pennies" do
|
20
24
|
@transaction.amount_in_pennies.should == -3534
|
21
25
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 6
|
9
|
+
version: 0.2.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Nando Vieira
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-05-06 00:00:00 -03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -67,7 +67,7 @@ files:
|
|
67
67
|
- spec/ofx/transaction_spec.rb
|
68
68
|
- spec/spec_helper.rb
|
69
69
|
- README.rdoc
|
70
|
-
has_rdoc:
|
70
|
+
has_rdoc: true
|
71
71
|
homepage: http://github.com/fnando/ofx
|
72
72
|
licenses: []
|
73
73
|
|