hippie_csv 0.0.3 → 0.0.4

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: 662fc68658433183bde7f943fff313555281db4a
4
- data.tar.gz: c0202320766061ee14a7fc7077e3d85d9f0548d7
3
+ metadata.gz: d4c36e47f1db88a3f9f30eafc8eef194becb8ab7
4
+ data.tar.gz: 25f0273e07e06902e369a767b66afc149e554156
5
5
  SHA512:
6
- metadata.gz: 659b01340829dc9056ef86f5df2ad8eb6c70f5ed66977f39bc7720149c5274d0ea26861b4bc7db20c2bc72ff3ca9e9165e09dde31812deb486b0974cbeb2a4d8
7
- data.tar.gz: 5c9118714c431e0385598759b22d6b7d3f90c5b490afb1b8aaf911620a9ae5031c9bce34d0a591b602e395bd4ab8fd35784ef9ecc364f6e3aabbab68fc41344a
6
+ metadata.gz: 23010d852b216afe652be53e65acb917ebfa020b118dd70cceeb48e13ef1831665bacad3fa17e89a87d1027ee66fc3e7394b16be57739492b468af0c9af600df
7
+ data.tar.gz: ce66e8cc0823906bb89dd04a111f53a17f92fa998156a4cdafb5a71534be0752f25e61c0a61186c9f1bb6c3815169e909da87b9a8266248edeb594dffdfb735a
data/hippie_csv.gemspec CHANGED
@@ -22,5 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rspec"
23
23
  spec.add_development_dependency "pry"
24
24
 
25
- spec.add_dependency "charlock_holmes"
25
+ spec.add_dependency "rchardet"
26
26
  end
@@ -1,5 +1,5 @@
1
1
  require "hippie_csv/constants"
2
- require "charlock_holmes"
2
+ require "rchardet"
3
3
 
4
4
  module HippieCSV
5
5
  module Support
@@ -10,10 +10,10 @@ module HippieCSV
10
10
 
11
11
  def encode(string)
12
12
  unless string.valid_encoding?
13
- current_encoding = CharlockHolmes::EncodingDetector.detect(string)[:encoding]
13
+ current_encoding = CharDet.detect(string)["encoding"]
14
14
 
15
15
  string = if !current_encoding.nil?
16
- CharlockHolmes::Converter.convert(string, current_encoding, ENCODING)
16
+ string.encode(ENCODING, current_encoding)
17
17
  else
18
18
  string.encode(ALTERNATE_ENCODING, ENCODING, invalid: :replace, replace: "")
19
19
  .encode(ENCODING, ALTERNATE_ENCODING)
@@ -1,3 +1,3 @@
1
1
  module HippieCSV
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,3 +1,3 @@
1
1
  Vincent;J�rome;jvincent@example.com;06 02 21 32 91;Vincent J�rome;
2
- H�lo�se;Martin ;martinheloise@example.com;06 12 81 12 28;;
2
+ H�loise;Martin ;martinheloise@example.com;06 12 81 12 28;;
3
3
  Guzole;Virgile ;v.guzole@example.com ;02 23 23 20 10;;
@@ -3,7 +3,7 @@ require "spec_helper"
3
3
  describe HippieCSV do
4
4
 
5
5
  it "defines a version" do
6
- expect(HippieCSV::VERSION).to eq("0.0.3")
6
+ expect(HippieCSV::VERSION).to eq("0.0.4")
7
7
  end
8
8
 
9
9
  end
@@ -101,13 +101,13 @@ describe HippieCSV do
101
101
  import = subject.read(path)
102
102
  expect(import[0].count).to eq(9)
103
103
  end
104
-
104
+
105
105
  it "works for a hard case" do
106
106
  path = fixture_path(:accents_semicolon_windows_1252)
107
107
 
108
108
  import = subject.read(path)
109
109
  expect(import[0][1]).to eq("Jérome")
110
- expect(import[1][0]).to eq("Héloïse")
110
+ expect(import[1][0]).to eq("Héloise")
111
111
  end
112
112
  end
113
113
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hippie_csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen O'Brien
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: charlock_holmes
70
+ name: rchardet
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '>='