payoneer_csv 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +13 -0
- data/Gemfile +1 -1
- data/README.md +6 -0
- data/bin/payoneer_csv +5 -3
- data/lib/payoneer_csv/version.rb +1 -1
- data/payoneer_csv.gemspec +1 -1
- data/spec/payoneer_csv/csv_spec.rb +37 -24
- metadata +3 -2
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,8 +2,14 @@
|
|
2
2
|
|
3
3
|
Simple tool for converting payoneer pdf report to csv file.
|
4
4
|
|
5
|
+
[![Build status](https://secure.travis-ci.org/lucassus/payoneer_csv.png)](http://travis-ci.org/lucassus/payoneer_csv)
|
6
|
+
|
5
7
|
## Installation
|
6
8
|
|
9
|
+
First of all install `pdftotext` executable
|
10
|
+
|
11
|
+
$ sudo apt-get install poppler-utils
|
12
|
+
|
7
13
|
Add this line to your application's Gemfile:
|
8
14
|
|
9
15
|
gem 'payoneer_csv'
|
data/bin/payoneer_csv
CHANGED
@@ -5,12 +5,14 @@ unless ARGV[0]
|
|
5
5
|
exit
|
6
6
|
end
|
7
7
|
|
8
|
-
payoneer_csv_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
9
|
-
$LOAD_PATH.unshift(payoneer_csv_dir) unless $LOAD_PATH.include?(payoneer_csv_dir)
|
10
|
-
|
11
8
|
require 'payoneer_csv'
|
12
9
|
|
13
10
|
file_path = File.expand_path(ARGV[0])
|
11
|
+
unless File.exist?(file_path)
|
12
|
+
puts "Cannot find file: #{file_path}"
|
13
|
+
exit
|
14
|
+
end
|
15
|
+
|
14
16
|
reader = PayoneerCsv::PdfReader.new(file_path)
|
15
17
|
csv_string = PayoneerCsv::Csv.new(reader.read).generate
|
16
18
|
puts csv_string
|
data/lib/payoneer_csv/version.rb
CHANGED
data/payoneer_csv.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.email = ["lucassus@gmail.com"]
|
7
7
|
gem.description = %q{Simple tool for converting payoneer pdf report to csv file}
|
8
8
|
gem.summary = %q{Convert payoneer pdf report to csv file}
|
9
|
-
gem.homepage = ""
|
9
|
+
gem.homepage = "https://github.com/lucassus/payoneer_csv"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
@@ -17,30 +17,43 @@ describe PayoneerCsv::Csv do
|
|
17
17
|
|
18
18
|
it { should be_an_instance_of(String) }
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
header
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
20
|
+
describe 'rows' do
|
21
|
+
def nth_row(n)
|
22
|
+
csv_string.split("\n")[n].split(',')
|
23
|
+
end
|
24
|
+
|
25
|
+
describe 'csv header' do
|
26
|
+
subject { nth_row(0) }
|
27
|
+
|
28
|
+
it { should have(4).items }
|
29
|
+
|
30
|
+
its([0]) { should == 'Transaction Date' }
|
31
|
+
its([1]) { should == 'Description' }
|
32
|
+
its([2]) { should == 'Amount' }
|
33
|
+
its([3]) { should == 'Currency' }
|
34
|
+
end
|
35
|
+
|
36
|
+
describe 'first row' do
|
37
|
+
subject { nth_row(1) }
|
38
|
+
|
39
|
+
it { should have(4).items }
|
40
|
+
|
41
|
+
its([0]) { should == '10/11/2011' }
|
42
|
+
its([1]) { should == 'Foo' }
|
43
|
+
its([2]) { should == '123.12' }
|
44
|
+
its([3]) { should == 'USD' }
|
45
|
+
end
|
46
|
+
|
47
|
+
describe 'second row' do
|
48
|
+
subject { nth_row(2) }
|
49
|
+
|
50
|
+
it { should have(4).items }
|
51
|
+
|
52
|
+
its([0]) { should == '01/09/2012' }
|
53
|
+
its([1]) { should == 'Bar' }
|
54
|
+
its([2]) { should == '-9.99' }
|
55
|
+
its([3]) { should == 'USD' }
|
56
|
+
end
|
44
57
|
end
|
45
58
|
end
|
46
59
|
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.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -21,6 +21,7 @@ extra_rdoc_files: []
|
|
21
21
|
files:
|
22
22
|
- .gitignore
|
23
23
|
- .rspec
|
24
|
+
- .travis.yml
|
24
25
|
- Gemfile
|
25
26
|
- LICENSE
|
26
27
|
- README.md
|
@@ -37,7 +38,7 @@ files:
|
|
37
38
|
- spec/payoneer_csv/pdf_reader_spec.rb
|
38
39
|
- spec/payoneer_csv/transaction_spec.rb
|
39
40
|
- spec/spec_helper.rb
|
40
|
-
homepage:
|
41
|
+
homepage: https://github.com/lucassus/payoneer_csv
|
41
42
|
licenses: []
|
42
43
|
post_install_message:
|
43
44
|
rdoc_options: []
|