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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab12304c0fc25d50266b2ce659590f6c66c1dd04
4
- data.tar.gz: 92d45280b7b809bf216f0602860ad0a7b08e3bbc
3
+ metadata.gz: 11a33f43d6e2fdf4ff559972f271fc04fd0e74a1
4
+ data.tar.gz: bba94c23a3b5b4cfa50088cdf21f50f2ee7a6e31
5
5
  SHA512:
6
- metadata.gz: caeca5966d8109dd6797562a3c63f900c5e5c6477df038217625828c08d449b4568e81569e74471e46d9febc6319880942a318e338738aceb54a2b45911a2902
7
- data.tar.gz: 934209ddd5f7e874cdd8ea1639eb17191b9a4827e4bf196aa7431e77619009ec5679dc2f6cabe7e19342b2afb5edb96b4930af9e84a7827049758d5450ed2b1d
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
@@ -1,5 +1,5 @@
1
1
  module Iif
2
2
  class Parser
3
- VERSION = "1.0.11"
3
+ VERSION = "1.0.12"
4
4
  end
5
5
  end
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.11
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: 2017-01-04 00:00:00.000000000 Z
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.6
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