honey_format 0.15.0 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/exe/honey_format +1 -0
- data/lib/honey_format/cli/cli.rb +11 -1
- data/lib/honey_format/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9afe55f28e5bdd981ecf3a73fc49c52a145442c8ebf3e0c5da2e18c4d43eea6
|
4
|
+
data.tar.gz: 3943032cb540bb1ce70b2cb21e99e5288d42ba06b261e08e125c0f9d895c67ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1476f913fa1eabc823295cc327b13ba188fb5be82e76e72e6b3d60f8d80bbda098cb4170a2d7e081026dcf9a5fdfd0f9ce0d632e5d37f064ae744c8f5ebacd34
|
7
|
+
data.tar.gz: e957fbd91dd47ca60bd4581b754c6667992cdc96ac79c6f66171f90d9647db6f08387c6e6cedf0681efc5b18535fc37eb75fcb0039b3fd4fa0a6973337c49c71
|
data/CHANGELOG.md
CHANGED
data/exe/honey_format
CHANGED
data/lib/honey_format/cli/cli.rb
CHANGED
@@ -30,6 +30,7 @@ module HoneyFormat
|
|
30
30
|
header_only = false
|
31
31
|
rows_only = false
|
32
32
|
skip_lines = nil
|
33
|
+
type_map = {}
|
33
34
|
|
34
35
|
OptionParser.new do |parser|
|
35
36
|
parser.banner = "Usage: honey_format [options] <file.csv>"
|
@@ -55,6 +56,10 @@ module HoneyFormat
|
|
55
56
|
skip_lines = value
|
56
57
|
end
|
57
58
|
|
59
|
+
parser.on('--type-map=[key1=val1,key2=val2]', Array, 'Type map') do |value|
|
60
|
+
type_map = option_to_h(value || [])
|
61
|
+
end
|
62
|
+
|
58
63
|
parser.on("--[no-]header-only", "Print only the header") do |value|
|
59
64
|
header_only = value
|
60
65
|
end
|
@@ -90,8 +95,13 @@ module HoneyFormat
|
|
90
95
|
delimiter: delimiter,
|
91
96
|
header_only: header_only,
|
92
97
|
rows_only: rows_only,
|
93
|
-
skip_lines: skip_lines
|
98
|
+
skip_lines: skip_lines,
|
99
|
+
type_map: type_map
|
94
100
|
}
|
95
101
|
end
|
102
|
+
|
103
|
+
def option_to_h(option)
|
104
|
+
option.map { |v| v.split('=').map(&:to_sym) }.to_h
|
105
|
+
end
|
96
106
|
end
|
97
107
|
end
|
data/lib/honey_format/version.rb
CHANGED