typedcsv 0.1.1 → 1.0.0
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 +4 -4
- data/CHANGELOG +6 -0
- data/README.md +4 -4
- data/benchmark/benchmark.rb +1 -1
- data/lib/typedcsv.rb +1 -1
- data/lib/typedcsv/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da6be8a2ddd7600570ea8ebb99192933440e8b54
|
4
|
+
data.tar.gz: 29d852057d2dc2c2d3d4bf2b52e9b82351f7748f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd1886238aad66edeb4def0fef211f963c720dafa7e2ede06114808f311b2890dbb056ea74f21479af491e9263611f140a005c81512245288c7fca4da512d68f
|
7
|
+
data.tar.gz: 3ad641d3d9677a16f19a1a3b070e51c29ab9f95232913368c6f89584f4d5aa74c24556a50f1216320105ad470d92d8dd2eb57c1040f280a4c8cea38339f64b1e
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -4,14 +4,14 @@ Here's your standard untyped CSV:
|
|
4
4
|
|
5
5
|
```
|
6
6
|
name,income,created_at,tags,great
|
7
|
-
Seamus,12301.2,2012-02-21,red
|
7
|
+
Seamus,12301.2,2012-02-21,"red,blue",true
|
8
8
|
```
|
9
9
|
|
10
|
-
Now, you and I know that `12301.2` is a number and `2012-02-21` is a date and `red
|
10
|
+
Now, you and I know that `12301.2` is a number and `2012-02-21` is a date and `"red,blue"` is a list... so let's just write that into the headers:
|
11
11
|
|
12
12
|
```
|
13
13
|
name,income:number,created_at:date,tags:list,great:boolean
|
14
|
-
Seamus,12301.2,2012-02-21,red
|
14
|
+
Seamus,12301.2,2012-02-21,"red,blue",true
|
15
15
|
```
|
16
16
|
|
17
17
|
Now let's parse it:
|
@@ -31,7 +31,7 @@ This gem provides `Typedcsv.foreach()`, which takes exactly the same arguments a
|
|
31
31
|
|
32
32
|
* text (default)
|
33
33
|
* number
|
34
|
-
* list (must be
|
34
|
+
* list (must be comma-separated and therefore quoted)
|
35
35
|
* date (must be ISO8601)
|
36
36
|
* time (must be ISO8601)
|
37
37
|
* boolean (recognizes "true" or "false")
|
data/benchmark/benchmark.rb
CHANGED
@@ -28,7 +28,7 @@ else
|
|
28
28
|
rand(2**16) + rand(),
|
29
29
|
Faker::Date.backward(900),
|
30
30
|
Faker::Address.zip_code,
|
31
|
-
rand(5).times.map { Faker::TwinPeaks.location }.to_csv
|
31
|
+
rand(5).times.map { Faker::TwinPeaks.location }.to_csv.chomp,
|
32
32
|
SecureRandom.uuid,
|
33
33
|
Faker::TwinPeaks.quote
|
34
34
|
].to_csv
|
data/lib/typedcsv.rb
CHANGED
data/lib/typedcsv/version.rb
CHANGED