payoneer_csv 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Payoneer::Csv
2
2
 
3
- TODO: Write a gem description
3
+ Simple tool for converting payoneer pdf report to csv file.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
- gem 'payoneer-csv'
9
+ gem 'payoneer_csv'
10
10
 
11
11
  And then execute:
12
12
 
@@ -14,11 +14,23 @@ And then execute:
14
14
 
15
15
  Or install it yourself as:
16
16
 
17
- $ gem install payoneer-csv
17
+ $ gem install payoneer_csv
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ `payoneer_csv [path to pdf report]`
22
+
23
+ Example:
24
+
25
+
26
+ ```
27
+ $ payoneer_csv Transcations.pdf
28
+ Transaction Date,Description,Amount,Currency
29
+ 10/26/2012 8:15:31 PM,Delikatesy Alma,-7.83,USD
30
+ 10/26/2012 12:25:14 AM,DEEZER,-4.87,USD
31
+ 10/23/2012 6:28:09 AM,SJO Empik,-23.17,USD
32
+ ...
33
+ ```
22
34
 
23
35
  ## Contributing
24
36
 
@@ -8,7 +8,7 @@ module PayoneerCsv
8
8
  def initialize(attributes)
9
9
  @created_at = attributes[:created_at]
10
10
  @description = attributes[:description].strip
11
- @amount = attributes[:amount].to_f
11
+ @amount = attributes[:amount].gsub(',', '').to_f
12
12
  end
13
13
  end
14
14
 
@@ -1,3 +1,3 @@
1
1
  module PayoneerCsv
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -41,12 +41,12 @@ describe PayoneerCsv::PdfReader do
41
41
  end
42
42
 
43
43
  context 'on valid row (with positive amount)' do
44
- let(:row) { '10/19/2012 11:38:12 PM PSS SKLEP NR 54 17.36 USD' }
44
+ let(:row) { '10/19/2012 11:38:12 PM PSS SKLEP NR 54 2,117.36 USD' }
45
45
 
46
46
  it { should_not be_nil }
47
47
  its([:created_at]) { should == '10/19/2012 11:38:12 PM' }
48
- its([:description]) { should == 'PSS SKLEP NR 54 ' }
49
- its([:amount]) { should == '17.36' }
48
+ its([:description]) { should == 'PSS SKLEP NR 54 ' }
49
+ its([:amount]) { should == '2,117.36' }
50
50
  end
51
51
 
52
52
  context 'on invalid row' do
@@ -4,7 +4,7 @@ describe PayoneerCsv::Transaction do
4
4
  let(:attributes) {
5
5
  {
6
6
  description: 'Sample transaction',
7
- amount: '123.99',
7
+ amount: '2,123.99',
8
8
  created_at: '10/19/2012 11:38:12 PM'
9
9
  }
10
10
  }
@@ -13,7 +13,7 @@ describe PayoneerCsv::Transaction do
13
13
  subject { transaction }
14
14
 
15
15
  its(:description) { should == attributes[:description] }
16
- its(:amount) { should == attributes[:amount].to_f }
16
+ its(:amount) { should == 2_123.99 }
17
17
  its(:created_at) { should == attributes[:created_at] }
18
18
 
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payoneer_csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: