honey_format 0.17.0 → 0.18.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 997883e33f720a7dc6c0d3f2a552b4dcd68cfa1bac8be23d5a36332c83bf0e32
4
- data.tar.gz: dd522a2171b7befc1e41e80022dade22d18d3d9228c8b40eb6b7d3f8d032005b
3
+ metadata.gz: ab1d4f7975362d7a1e5a63dc5d2709a8859fa8bc2563a616c42dbe181285de28
4
+ data.tar.gz: e582e7495778b83d6f1776bbc3048103b3df55ba79d6e6c0383a591e85d768c1
5
5
  SHA512:
6
- metadata.gz: c6e15af7156b78f97f02e1e42f9c961116ad7e09428ccaa6eb7b0651d93f162f2417381d034b82eaefa843d0b5aceab1cfb824347db1701ed5186d575c6d88eb
7
- data.tar.gz: dfa13256a8446d9b7f6bedf4505e9c275268999098befd62a81174ef5d682185ea4e379e07b870e3554ecdb983714bac31b1175422dd750dc07d6997b52233b9
6
+ metadata.gz: 97a9841215e292ce71e2288ee2d54b01a9befd9ad81fda41e8a0bcc3a34e0b2a045fd4a5b782ea97f6d77820a207e8f3a962a5d8f7c5282db0bff7e37a98c615
7
+ data.tar.gz: 00f215cfbee51d5b9f075b32a5e321754753c0f7292f985fccab51983bee6f084eef6409b2d753af37a2a18fcdc9ef71c348063fb0756b36de0122621934addd
@@ -1,5 +1,10 @@
1
1
  # HEAD
2
2
 
3
+
4
+ * Require `set` class in `ConvertBoolean` - fixes crash when set is already required in environment
5
+ * Allow symbols to be passed to `HeaderColumnConverter`
6
+ * Replace `.` and `,` with `_` in header column converter
7
+
3
8
  ## v0.17.0
4
9
 
5
10
  :warning: This release contains some backwards compatible changes.
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'set'
4
+
3
5
  module HoneyFormat
4
6
  # String values considered truthy
5
7
  TRUTHY = Set.new(%w[t T 1 y Y true TRUE]).freeze
@@ -21,7 +21,8 @@ module HoneyFormat
21
21
  [/\} /, '}'], # replace "} " with "}"
22
22
  [BRACKETS, '_'], # replace (, [, {, ), ] and } with "_"
23
23
  [/ +/, '_'], # replace one or more spaces with "_"
24
- [/-/, '_'], # replace "-" with "("
24
+ [/-/, '_'], # replace "-" with "_"
25
+ [/\.|,/, '_'], # replace "." and "," with "_"
25
26
  [/::/, '_'], # replace "::" with "_"
26
27
  [%r{/}, '_'], # replace "/" with "_"
27
28
  [SEPS, '_'], # replace separator chars with "_"
@@ -32,7 +33,7 @@ module HoneyFormat
32
33
 
33
34
  # Returns converted value and mutates the argument.
34
35
  # @return [Symbol] the cleaned header column.
35
- # @param [String] column the string to be cleaned.
36
+ # @param [String, Symbol] column the string to be cleaned.
36
37
  # @param [Integer] index the column index.
37
38
  # @example Convert simple header
38
39
  # HeaderColumnConverter.call(" User name ") #=> "user_name"
@@ -44,7 +45,7 @@ module HoneyFormat
44
45
  return :"column#{index}"
45
46
  end
46
47
 
47
- column = column.dup
48
+ column = column.to_s.dup
48
49
  column.strip!
49
50
  column.downcase!
50
51
  REPLACE_MAP.each do |data|
@@ -4,7 +4,7 @@ module HoneyFormat
4
4
  # Gem version
5
5
  VERSION = [
6
6
  MAJOR_VERSION = 0,
7
- MINOR_VERSION = 17,
7
+ MINOR_VERSION = 18,
8
8
  PATCH_VERSION = 0,
9
9
  ].join('.')
10
10
  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.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Burenstam
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-11 00:00:00.000000000 Z
11
+ date: 2018-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark-ips