honey_format 0.8.0 → 0.8.1

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
  SHA256:
3
- metadata.gz: cd129c5fad5db62fff083b435b6fcda0ffffd8a267a3212ddf0207d55687b0ea
4
- data.tar.gz: 06bd0c47a814e1d9dba272604438e251a86961928ad403ea51528bd11050a653
3
+ metadata.gz: c6fe52a88163c5a9bf96100e068a0c66128709872327e2048111a162d8058dbd
4
+ data.tar.gz: 7f635b1522f3d16c93efaa57f191441a8667838935518ae7cf5133f0d7fea198
5
5
  SHA512:
6
- metadata.gz: c969983ad1c3af2a1f5c0fff16726e6181b91db3db2504a16a4f71105e213142941ca3b06507e3efff36b111edba7cfbdf8c286f64aadb5e74ed37022c26f57a
7
- data.tar.gz: 2ac22026db03b89aa5f37c64a1be68e40d19b7edc71a5e90af106e15e80e43c0c610233d434da626879419ba132fa64da74869748eee596fbe8a772e463d2740
6
+ metadata.gz: f9dbb76d7b1042b59d420a524cd88623c5d53af8f74bc08709b29b4d69102a05979679c48d5d606c33e763c9696c2649e841897da69577abc3f6bca61d55efd3
7
+ data.tar.gz: 8c4633d67d28053b7b4abb29b6d10cd583150bf222ca77bd88edb6d9f8e63b3a8459f9604529998ec4878bbea71903251cc3208c275d0cf25715df2a8106a0fe
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.8.1
2
+
3
+ * _[Bugfix]_ Properly quote cells with special CSV-characters in them. ([PR#7](https://github.com/buren/honey_format/pull/7))
4
+
1
5
  # v0.8.0
2
6
 
3
7
  * _[Feature]_ Add `#size` and `#length` methods to `Header` and `Rows` objects
@@ -55,7 +55,7 @@ module HoneyFormat
55
55
  # Header as CSV-string
56
56
  # @return [String] CSV-string representation.
57
57
  def to_csv
58
- @columns.to_csv
58
+ ::CSV.generate_line(@columns)
59
59
  end
60
60
 
61
61
  private
@@ -10,14 +10,16 @@ module HoneyFormat
10
10
  # Represent row as CSV
11
11
  # @return [String] CSV-string representation.
12
12
  def to_csv
13
- members.map do |column_name|
13
+ row = members.map do |column_name|
14
14
  column = public_send(column_name)
15
15
  if column.respond_to?(:to_csv)
16
16
  column.to_csv
17
17
  else
18
18
  column.to_s
19
19
  end
20
- end.join(',') + "\n"
20
+ end
21
+
22
+ ::CSV.generate_line(row)
21
23
  end
22
24
  end
23
25
  end
@@ -1,4 +1,4 @@
1
1
  module HoneyFormat
2
2
  # Gem version
3
- VERSION = '0.8.0'
3
+ VERSION = '0.8.1'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honey_format
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Burenstam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-14 00:00:00.000000000 Z
11
+ date: 2018-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler