iif-parser 1.0.11 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/iif-parser.gemspec +2 -0
- data/lib/iif/parser.rb +5 -0
- data/lib/iif/parser/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11a33f43d6e2fdf4ff559972f271fc04fd0e74a1
|
4
|
+
data.tar.gz: bba94c23a3b5b4cfa50088cdf21f50f2ee7a6e31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 633cd5733d8779a0f9c07a7e2c1baa13818159f9f1c654008ce9301d99f8d38f891b2dd6af4a02a6925081288539f7702b182db312478234d58adcfe52989510
|
7
|
+
data.tar.gz: 2936037aba2d271c32a485ceab7753a440eb4c70ad134c68cc28cb74aa7410f047fb9c47306e33d8963566e9e0909d934be779c58d3168fb1cccc165df1ceb1e
|
data/iif-parser.gemspec
CHANGED
@@ -17,6 +17,8 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
+
spec.add_runtime_dependency "rchardet"
|
21
|
+
|
20
22
|
spec.add_development_dependency "rspec"
|
21
23
|
spec.add_development_dependency "awesome_print"
|
22
24
|
spec.add_development_dependency "bundler", "~> 1.9"
|
data/lib/iif/parser.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'bigdecimal'
|
2
2
|
require 'csv'
|
3
|
+
require 'rchardet'
|
3
4
|
require_relative 'parser/version'
|
4
5
|
require_relative 'parser/transaction'
|
5
6
|
require_relative 'parser/entry'
|
@@ -14,6 +15,10 @@ module Iif
|
|
14
15
|
@definitions = {}
|
15
16
|
@entries = []
|
16
17
|
@transactions = []
|
18
|
+
unless resource.force_encoding('UTF-8').valid_encoding?
|
19
|
+
cd = CharDet.detect(resource)
|
20
|
+
resource.encode!("UTF-8", cd["encoding"])
|
21
|
+
end
|
17
22
|
resource.gsub!(/\r\n?/, "\n") # dos to unix EOL conversion
|
18
23
|
resource = open_resource(resource)
|
19
24
|
resource.rewind
|
data/lib/iif/parser/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iif-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Pelczarski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rchardet
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: rspec
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
121
|
version: '0'
|
108
122
|
requirements: []
|
109
123
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.4.
|
124
|
+
rubygems_version: 2.4.5.2
|
111
125
|
signing_key:
|
112
126
|
specification_version: 4
|
113
127
|
summary: Basic IIF parser written in Ruby
|