idata 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/idata/detector.rb +6 -1
- data/lib/idata/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee8c06be7ed48caab9e76b6e39544b812849ce3f
|
4
|
+
data.tar.gz: 396a15578b4a4fff1636926b3e71b36fca74f830
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8819c2ba1c7e628a287d2f0ed7e753c0e43f685a04446f0e94da9cf7bf7f36ac970391ea2c347eb45bd88e36be8111d53fb345788ea5746587a5565776eb4ea3
|
7
|
+
data.tar.gz: b0dfe2066c4802aca25639676b1719d8f95c5fcbcdc11a5992e9c1342b81b9b3f11aa367c2557afda79e8b9a8e36c49327dd9b6ee7ba0bd30b36d45d701f193c
|
data/lib/idata/detector.rb
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
require 'csv'
|
2
|
+
|
3
|
+
# Set UTF-8
|
4
|
+
Encoding.default_internal = Encoding::UTF_8
|
5
|
+
Encoding.default_external = Encoding::UTF_8
|
6
|
+
|
2
7
|
module Idata
|
3
8
|
class Detector
|
4
9
|
DEFAULT_DELIMITER = ","
|
@@ -7,7 +12,7 @@ module Idata
|
|
7
12
|
|
8
13
|
def initialize(file)
|
9
14
|
@file = file
|
10
|
-
@sample = `head -n #{SAMPLE_SIZE} #{@file}
|
15
|
+
@sample = `head -n #{SAMPLE_SIZE} #{@file}`.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
|
11
16
|
@sample_lines = @sample.split(/[\r\n]+/)
|
12
17
|
@candidates = COMMON_DELIMITERS.map { |delim|
|
13
18
|
[delim, @sample.scan(delim).count]
|
data/lib/idata/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: idata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nghi Pham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|