csv_shaper 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/csv_shaper/shaper.rb +6 -2
- data/lib/csv_shaper/version.rb +1 -1
- data/spec/config_spec.rb +14 -0
- 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: 76a5437adbc2bf71d5c1938a2bb6e7086ef944dd
|
4
|
+
data.tar.gz: 5530c88d1eb91af5f4193ab26d82de35e33d5ee9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3364d9d38707acfa5dc0b07e1113a9e65ad808219da8ae15eb9952f7f3d6936f55919b33563be521531394d91698879402cde5416a20706a41892ab4d3b7dc4e
|
7
|
+
data.tar.gz: 77a1096fec7de79cdb3fe474bd1e8b303017daae68285014e9e21117bfc368faf30f0dbd83e4693e13f52bdb0dd4974c1cbce7a5899bd6eb45f6ace4aa19f18b
|
data/lib/csv_shaper/shaper.rb
CHANGED
data/lib/csv_shaper/version.rb
CHANGED
data/spec/config_spec.rb
CHANGED
@@ -13,6 +13,20 @@ describe CsvShaper::Config do
|
|
13
13
|
expect(config.options).to eq({ write_headers: false, col_sep: "\t", header_inflector: :titleize })
|
14
14
|
end
|
15
15
|
|
16
|
+
it "does not require setting up the config before generating a CSV file" do
|
17
|
+
shaper = CsvShaper::Shaper.new do |csv|
|
18
|
+
csv.headers :name, :age, :gender
|
19
|
+
|
20
|
+
csv.row do |csv|
|
21
|
+
csv.cell :name, 'Paul'
|
22
|
+
csv.cell :age, '27'
|
23
|
+
csv.cell :gender, 'Male'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
expect(shaper.to_csv).to eq "Name,Age,Gender\nPaul,27,Male\n"
|
28
|
+
end
|
29
|
+
|
16
30
|
it "should exclude the headers if specified" do
|
17
31
|
CsvShaper::Shaper.config = config
|
18
32
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csv_shaper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Springett
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|