table_structure 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a8c1be2513b60a1831419aa48faf9c5f326c7dc15ede46343cd9d57cac2caf3
4
- data.tar.gz: 5dfbfbbd2589b94e7fc438422bf6b5b7f49bc9b80b594c8da4a6cccd4c13cb7a
3
+ metadata.gz: 90d27cfdc8700ffb57706bcde59f1aee9786af31fd132478befc8081b0f7cb4c
4
+ data.tar.gz: 5b7e60df0bc67c276cf4f95d70aba5b13a6a5be46004d8eb974c7182ee1261e6
5
5
  SHA512:
6
- metadata.gz: 19dedd18f47cc61c9e9625f23c44cd4423f59423fdfd9906ef694241c08aa182afccd5b93c8be3b13f06ab9abd46465f2c7e959581f72dc52025ebfe1549f611
7
- data.tar.gz: f68ac3210c804de84865e02c80e3aac5831284419e5518c28f2f31197e057eaf3da00aae21c96858b8640b391615961de4500411ae4bf4c39780c4ec6410dd46
6
+ metadata.gz: 228a500f8c1e842dbfed09939b95c0af27237f3ef56e2e2a4c526c0b89fafd73d8a99a9ea1b9ee64f4f3610966f9717c829c2447d2c479f69c09877929f67a65
7
+ data.tar.gz: 44afa3c28a9ad5260361fdea2dcf85ac57b8799735305332bec3e3963b2d770f87fe06f73614e3b2645fe68c9579cbbc1a6e4256bbd39811046d1762db5878f1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- table_structure (0.2.1)
4
+ table_structure (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -29,7 +29,7 @@ module TableStructure
29
29
  private
30
30
 
31
31
  def optimize_size(value)
32
- return value if @size == 1
32
+ return value if @size == 1 && !value.is_a?(Array)
33
33
 
34
34
  values = [value].flatten
35
35
  actual_size = values.size
@@ -16,13 +16,16 @@ module TableStructure
16
16
  raise Error.new('"key" must not be lambda.', @index)
17
17
  end
18
18
  if !key && name.respond_to?(:call) && !size
19
- raise Error.new('"size" must be specified, because column size cannot be determined.', @index)
19
+ raise Error.new('"size" must be defined, because column size cannot be determined.', @index)
20
20
  end
21
21
  if size && size < DEFAULT_SIZE
22
22
  raise Error.new('"size" must be positive.', @index)
23
23
  end
24
24
  if @options[:result_type] == :hash && !key
25
- raise Error.new('"key" must be specified when "result_type: :hash" is specified.', @index)
25
+ raise Error.new('"key" must be defined when "result_type: :hash" is specified.', @index)
26
+ end
27
+ if key && size && [key].flatten.size < size
28
+ raise Error.new('"key" size must be greater than or equal to specified "size".', @index)
26
29
  end
27
30
 
28
31
  true
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TableStructure
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.authors = ['jsmmr']
11
11
  spec.email = ['jsmmr@icloud.com']
12
12
 
13
- spec.summary = 'Create and output table structured data.'
13
+ spec.summary = 'Creates and outputs table structured data.'
14
14
  spec.description = 'This gem creates and outputs table structured data. Useful for creating CSV.'
15
15
  spec.homepage = 'https://github.com/jsmmr/ruby_table_structure'
16
16
  spec.license = 'MIT'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table_structure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - jsmmr
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-23 00:00:00.000000000 Z
11
+ date: 2019-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -110,5 +110,5 @@ rubyforge_project:
110
110
  rubygems_version: 2.7.6.2
111
111
  signing_key:
112
112
  specification_version: 4
113
- summary: Create and output table structured data.
113
+ summary: Creates and outputs table structured data.
114
114
  test_files: []