cl 0.1.5 → 0.1.6

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: c813741e86f3ae66b08d918f981295c587adc05a5bf7d3d22d017baaea69ff7f
4
- data.tar.gz: cd4c7aff4a9148c819e8c7f09e14d3b3878c02aade25168dd9468db44eb7a7c8
3
+ metadata.gz: 1d8b11aefb42c1dd4ae929b2b446a99c1387d5a72d8eec551ce60c597b96fd5a
4
+ data.tar.gz: 334eb82a210381312bb0c2b363ded74d6475334891d1bf233cddc1840e818272
5
5
  SHA512:
6
- metadata.gz: bf49bbbc715debc03060ba8c7ae63036f13993557eebafabbfcd2972150b57d0041dc7bb72d7c40d826f7901ca115eb2558fe0506b0abdd510e7ff72027c532b
7
- data.tar.gz: 2d4a88d405fee25d8e0500096ef9edb44d7068ea52aa1476f83d72fc7f2892b8904adc1009679335d7cce8ed6c74314d906beec3d2053e525b47947c078ec4de
6
+ metadata.gz: cb6223e4079a9d1524a3519f146ae23902fcb3c9b936941e98ae88deff88b088278ac34b3905e7dc8eca067fac31994b7407cadc43f4db08af4b949ea443294e
7
+ data.tar.gz: ce7ff7f47ba1dc0305d93d29a42c3a7a5bebbeda4acb9904816f6215380f3dc3c2838c90601129f6a4e31bd46ec6c392ab6fe9d99c0c54195f2173b4879c29bc
data/lib/cl/help/table.rb CHANGED
@@ -41,8 +41,9 @@ class Cl
41
41
 
42
42
  def widths
43
43
  cols.map.with_index do |col, ix|
44
- width = col.compact.max_by(&:size)&.size
45
- ix < cols.size - 2 ? width.to_i : width.to_i + padding.to_i
44
+ max = col.compact.max_by(&:size)
45
+ width = max ? max.size : 0
46
+ ix < cols.size - 2 ? width : width + padding.to_i
46
47
  end
47
48
  end
48
49
 
data/lib/cl/helper.rb CHANGED
@@ -27,3 +27,11 @@ class Cl
27
27
 
28
28
  extend Merge, Regex, Wrap
29
29
  end
30
+
31
+ if RUBY_VERSION == '2.0.0'
32
+ Array.class_eval do
33
+ def to_h
34
+ Hash[self]
35
+ end
36
+ end
37
+ end
data/lib/cl/opt.rb CHANGED
@@ -20,7 +20,7 @@ class Cl
20
20
 
21
21
  def define(const)
22
22
  return unless __key__ = name
23
- const.include Module.new {
23
+ const.send :include, Module.new {
24
24
  define_method (__key__) { opts[__key__] }
25
25
  define_method (:"#{__key__}?") { !!opts[__key__] }
26
26
  }
data/lib/cl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Cl
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs
@@ -32,7 +32,6 @@ extra_rdoc_files: []
32
32
  files:
33
33
  - CHANGELOG.md
34
34
  - Gemfile
35
- - Gemfile.lock
36
35
  - MIT_LICENSE.md
37
36
  - NOTES.md
38
37
  - README.md
data/Gemfile.lock DELETED
@@ -1,36 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- cl (0.1.1)
5
- regstry (~> 1.0.3)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- diff-lcs (1.3)
11
- memfs (1.0.0)
12
- regstry (1.0.6)
13
- rspec (3.8.0)
14
- rspec-core (~> 3.8.0)
15
- rspec-expectations (~> 3.8.0)
16
- rspec-mocks (~> 3.8.0)
17
- rspec-core (3.8.0)
18
- rspec-support (~> 3.8.0)
19
- rspec-expectations (3.8.3)
20
- diff-lcs (>= 1.2.0, < 2.0)
21
- rspec-support (~> 3.8.0)
22
- rspec-mocks (3.8.0)
23
- diff-lcs (>= 1.2.0, < 2.0)
24
- rspec-support (~> 3.8.0)
25
- rspec-support (3.8.0)
26
-
27
- PLATFORMS
28
- ruby
29
-
30
- DEPENDENCIES
31
- cl!
32
- memfs
33
- rspec
34
-
35
- BUNDLED WITH
36
- 2.0.1