bank_statement_parser 2.0.1 → 2.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3057b9b620103d8e4bc12d6d19d5029f027a2ed
4
- data.tar.gz: 2497ff82b5a656775518d323c3fb329d4f53a332
3
+ metadata.gz: d99cd373fae3cd429ef8473c7d4a4be5d5a12343
4
+ data.tar.gz: 457db4075dd1eb20a9fcdd4d3283f1a296e473bb
5
5
  SHA512:
6
- metadata.gz: 3a059e351aa1bd4bd5ee1c7d4acc0f65d9d52e2b2ef10970e044e57e8e3d94d512c3c562f7c41a423aaf27f1a51365cde77f6963d8172877fa3c3d44e3065150
7
- data.tar.gz: e3909a9065213cfde80e2a60582b546382994b5725dfcda3ee2d598fc7fd738eaf8d68333acf0a1dd6d3da3920f6a8d2bec86c99b0f19d7cc8fecc274f1fa0a5
6
+ metadata.gz: e1ec92b642c8f1f7e1ccc9f21bbd4ae037e627046b8b5103634aa47f2894a54e4bbb60cf545cff179d7ee8a391df126e7332e18c328e83e9cc8ca85ed41a5b61
7
+ data.tar.gz: 1db173814d4ade098440c9ff692334cecfb2dd8cba70a2e70168e5bbe5d30792117c60a3f2c3e8a12e52faf434ff7c9f64eb186bd7603144746209d2288005fa
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # Convert the specified bank statement PDF file to text
4
4
 
5
- # Copyright 2015 Simon Dawson <spdawson@gmail.com>
5
+ # Copyright 2015-2017 Simon Dawson <spdawson@gmail.com>
6
6
 
7
7
  # This file is part of bank_statement_parser.
8
8
  #
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # Parse the specified HSBC bank statement file to YAML
4
4
 
5
- # Copyright 2015 Simon Dawson <spdawson@gmail.com>
5
+ # Copyright 2015-2017 Simon Dawson <spdawson@gmail.com>
6
6
 
7
7
  # This file is part of bank_statement_parser.
8
8
  #
@@ -1,4 +1,4 @@
1
- # Copyright 2015 Simon Dawson <spdawson@gmail.com>
1
+ # Copyright 2015-2017 Simon Dawson <spdawson@gmail.com>
2
2
 
3
3
  # This file is part of bank_statement_parser.
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright 2015 Simon Dawson <spdawson@gmail.com>
1
+ # Copyright 2015-2017 Simon Dawson <spdawson@gmail.com>
2
2
 
3
3
  # This file is part of bank_statement_parser.
4
4
  #
@@ -15,6 +15,7 @@
15
15
  # You should have received a copy of the GNU General Public License
16
16
  # along with bank_statement_parser. If not, see <http://www.gnu.org/licenses/>.
17
17
 
18
+ require 'fileutils'
18
19
  require 'open-uri'
19
20
  require 'stringio'
20
21
  require 'bank_statement_parser/bank_statement'
@@ -33,8 +34,6 @@ module BankStatementParser
33
34
  # * void reset()
34
35
  class Base
35
36
 
36
- require 'fileutils.rb'
37
-
38
37
  attr_accessor :bank_statement
39
38
 
40
39
  # Constructor
@@ -86,6 +85,13 @@ module BankStatementParser
86
85
  raise "Failed to find account name" if name.nil?
87
86
  raise "Failed to find opening balance" if opening_balance.nil?
88
87
  raise "Failed to find closing balance" if closing_balance.nil?
88
+
89
+ self
90
+ end
91
+
92
+ # Handle the specified line
93
+ def handle_line(line)
94
+ raise NotImplementedError
89
95
  end
90
96
 
91
97
  protected
@@ -98,6 +104,7 @@ module BankStatementParser
98
104
  # Reset the parser
99
105
  def reset
100
106
  @bank_statement = BankStatement.new
107
+ self
101
108
  end
102
109
 
103
110
  # @todo FIXME: Why can't we use Forwardable for these methods?
@@ -1,4 +1,4 @@
1
- # Copyright 2015 Simon Dawson <spdawson@gmail.com>
1
+ # Copyright 2015-2017 Simon Dawson <spdawson@gmail.com>
2
2
 
3
3
  # This file is part of bank_statement_parser.
4
4
  #
@@ -0,0 +1,26 @@
1
+ # Copyright 2015-2017 Simon Dawson <spdawson@gmail.com>
2
+
3
+ # This file is part of bank_statement_parser.
4
+ #
5
+ # bank_statement_parser is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # bank_statement_parser is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with bank_statement_parser. If not, see <http://www.gnu.org/licenses/>.
17
+
18
+ require 'rails/railtie'
19
+
20
+ module BankStatementParser
21
+ class Railtie < Rails::Railtie
22
+ initializer :bank_statement_parser do
23
+ BankStatementParser.logger = Rails.logger
24
+ end
25
+ end
26
+ end
@@ -1,4 +1,4 @@
1
- # Copyright 2015 Simon Dawson <spdawson@gmail.com>
1
+ # Copyright 2015-2017 Simon Dawson <spdawson@gmail.com>
2
2
 
3
3
  # This file is part of bank_statement_parser.
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright 2015 Simon Dawson <spdawson@gmail.com>
1
+ # Copyright 2015-2017 Simon Dawson <spdawson@gmail.com>
2
2
 
3
3
  # This file is part of bank_statement_parser.
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright 2015 Simon Dawson <spdawson@gmail.com>
1
+ # Copyright 2015-2017 Simon Dawson <spdawson@gmail.com>
2
2
 
3
3
  # This file is part of bank_statement_parser.
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright 2015 Simon Dawson <spdawson@gmail.com>
1
+ # Copyright 2015-2017 Simon Dawson <spdawson@gmail.com>
2
2
 
3
3
  # This file is part of bank_statement_parser.
4
4
  #
@@ -47,3 +47,5 @@ module BankStatementParser
47
47
  end
48
48
 
49
49
  end
50
+
51
+ require 'bank_statement_parser/railtie' if defined?(Rails)
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bank_statement_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Dawson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-29 00:00:00.000000000 Z
11
+ date: 2017-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  description: A gem for parsing bank statements
@@ -38,12 +38,13 @@ files:
38
38
  - lib/bank_statement_parser/bank_statement.rb
39
39
  - lib/bank_statement_parser/base.rb
40
40
  - lib/bank_statement_parser/hsbc.rb
41
+ - lib/bank_statement_parser/railtie.rb
41
42
  - lib/bank_statement_parser/statement_record.rb
42
43
  - lib/bank_statement_parser/statement_record_types.rb
43
44
  - lib/bank_statement_parser/utils.rb
44
45
  homepage: https://github.com/spdawson/bank_statement_parser
45
46
  licenses:
46
- - GPLv3
47
+ - GPL-3.0
47
48
  metadata: {}
48
49
  post_install_message:
49
50
  rdoc_options: []
@@ -62,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
63
  requirements:
63
64
  - pdftotext(1)
64
65
  rubyforge_project:
65
- rubygems_version: 2.4.5
66
+ rubygems_version: 2.6.11
66
67
  signing_key:
67
68
  specification_version: 4
68
69
  summary: Bank statement parser