nesquikcsv 0.1.3 → 0.1.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: 3db12fc1239fab060c9570293abcf5f3460e3054
4
- data.tar.gz: e37f17ee6cfba0c33b8ad2539dcd2194d3cf3b17
3
+ metadata.gz: d271c73f54f112004ff11719fbff3c690e18bc55
4
+ data.tar.gz: 5f87efeb1673e2ff5d99bc247d1fa92f630dbbf3
5
5
  SHA512:
6
- metadata.gz: 21ac6172e171f974ec968d02788173b2b4ab5c1e687d38fc9e0f6e28d7873321299389f11dbf256960ddbdea8df03e5d4f0b3fc9ea8817b95ab98e3ba1be1935
7
- data.tar.gz: 50e06a368ded7336c0232d332d12421ca89fa66cec597894fc5f96ead4013525311023cf850e63aed94ef2ba398a1d9395c9ce20cc12f8d446822a7a319ad9f3
6
+ metadata.gz: 5cc8cb08eae5eed24b3c5114194b784ab81e966c153b640fa1c4d16a773cddbb9ed4e2be18487b97bb85da96c3c41305717b0ae5133c8dbdef4d9a9d373e85f7
7
+ data.tar.gz: b25355aac02167cb2a9eda62896579a3e209e7ec69eee6c1b9c8f4b0f24c90e175e87b04e6b685b742b46c74692c3e17e1b266e31d331e6643d0120237fd9512
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # NesquikCSV
2
2
 
3
- Fork of the Fastest-CSV gem to support different encodings. Uses native C code to parse CSV lines in MRI Ruby.
3
+ Fork of the Fastest-CSV gem to support any encoding, using UTF-8 by default.
4
+
5
+ Uses native C code to parse CSV lines in MRI Ruby.
4
6
 
5
7
  Supports standard CSV according to RFC4180. Not the so-called "csv" from Excel.
6
8
 
@@ -27,12 +29,18 @@ Parse single line
27
29
  # If no encoding is specified UTF-8 is assumed
28
30
  NesquikCSV.parse_line "one,two,three"
29
31
  => ["one", "two", "three"]
32
+
33
+ # You can also specify an encoding of choice
30
34
  NesquikCSV.parse_line "uno,dós,trés", "ASCII-8BIT"
31
35
  => ["uno", "d\xC3\xB3s", "tr\xC3\xA9s"]
32
36
 
33
37
  Parse string in array of arrays
34
38
 
35
- # Defaults to UTF-8
39
+ # Read file contents into string
40
+ csv_data = "one,two,three"
41
+ # Defaults to UTF-8 encoding
36
42
  rows = NesquikCSV.parse(csv_data)
37
- # Explicitly
43
+ => ["one", "two", "three"]
44
+ # Or explicitly
38
45
  rows = NesquikCSV.parse(csv_data, "UTF-8")
46
+ => ["one", "two", "three"]
@@ -1,3 +1,3 @@
1
1
  class NesquikCSV
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/nesquikcsv.rb CHANGED
@@ -1,5 +1,3 @@
1
- # This loads either csv_parser.so, csv_parser.bundle or
2
- # csv_parser.jar, depending on your Ruby platform and OS
3
1
  require 'csv_parser'
4
2
  require 'stringio'
5
3
 
@@ -14,7 +12,7 @@ class NesquikCSV
14
12
  end
15
13
  end
16
14
 
17
- # Opens a csv file. Pass a FastestCSV instance to the provided block,
15
+ # Opens a csv file. Pass a NesquikCSV instance to the provided block,
18
16
  # or return it when no block is provided
19
17
  def self.open(path, mode = "rb")
20
18
  csv = new(File.open(path, mode))
data/nesquikcsv.gemspec CHANGED
@@ -17,8 +17,7 @@ Gem::Specification.new do |gem|
17
17
 
18
18
  gem.extensions = ['ext/csv_parser/extconf.rb']
19
19
 
20
- gem.add_dependency "test-unit"
21
-
20
+ gem.add_development_dependency "test-unit"
22
21
  gem.add_development_dependency "rake-compiler"
23
22
 
24
23
  gem.license = 'MIT'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nesquikcsv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Martty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-31 00:00:00.000000000 Z
11
+ date: 2017-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-unit
@@ -17,7 +17,7 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
- type: :runtime
20
+ type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements: