cani 0.3.0 → 0.3.1

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: 1df7e81ecfee9fcb8dde134bf7d3c6db8ae21520c3185b28055bfdefbf2f2f94
4
- data.tar.gz: c3c2eb816e5ea8fb0707db1a49c19f5fbdd8ac9122f4e8678713e5a9d184b3d9
3
+ metadata.gz: 95f111716af0ddbdcc7341fee4f664ce201f717a0e9eac416f2677149cc641fc
4
+ data.tar.gz: f2284ea6bb64a1087e08d618238898a13f0914cf27d31893e0cbdcd5d4c82579
5
5
  SHA512:
6
- metadata.gz: e5ca259ccc81e38e8646feb058863231439831a1fbc1f6adc06d32240286cf19cb68bbccefd0d9b3275f9d05a7d495472c11a7570056fddafb03a51307c8d3a8
7
- data.tar.gz: a77833ff65dd10cfe9f71ba665d5979acf7d95dcb45042b0083afd023e979bdaebc98846bcc0a8a54682b54ee0595de4a92b03e4643cc746a2bbac1d06f3115a
6
+ metadata.gz: 01c58a9b40c957fc38c538496cf92fb717f1ab0edc0a79c703964516e294eb442003ba0f21338dd87467e6e14e41a2b4cf18f147f8933b9abf81da92bb92ad66
7
+ data.tar.gz: 28ce0494ce59876a5f96ac631461cb43388490e04db11caebe5fc56d9254136043211e3e85cf6167488b3bb92d4c90969994c40addc6557c4e0740a9aa6b4a03
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cani (0.2.2)
4
+ cani (0.3.0)
5
5
  colorize
6
6
  curses
7
7
  json
@@ -110,18 +110,19 @@ module Cani
110
110
  def draw
111
111
  Curses.clear
112
112
 
113
+ outer_width = table_width + 2
113
114
  percent_num = format '%.2f%%', feature.percent
114
115
  status_format = "[#{feature.status}]"
115
116
  percent_label = compact? ? '' : 'support: '
116
- legend_format = 'legend'.center table_width
117
- notes_format = 'notes'.center table_width
117
+ legend_format = 'legend'.center outer_width
118
+ notes_format = 'notes'.center outer_width
118
119
 
119
- offset_x = ((width - table_width) / 2.0).floor
120
+ offset_x = ((width - outer_width) / 2.0).floor
120
121
  offset_y = 1
121
122
  cy = 0
122
123
 
123
124
  # positioning and drawing of percentage
124
- perc_num_xs = table_width - percent_num.size
125
+ perc_num_xs = outer_width - percent_num.size
125
126
  Curses.setpos offset_y + cy, offset_x + perc_num_xs
126
127
  Curses.attron percent_color(feature.percent) do
127
128
  Curses.addstr percent_num
@@ -267,8 +268,8 @@ module Cani
267
268
  # add extra empty line after legend
268
269
  cy += 1
269
270
 
270
- notes_chunked = feature.notes.map { |nt| nt.chars.each_slice(table_width).map(&:join).map(&:strip) }
271
- num_chunked = feature.notes_by_num.each_with_object({}) { |(k, nt), h| h[k] = nt.chars.each_slice(table_width - 5).map(&:join).map(&:strip) }
271
+ notes_chunked = feature.notes.map { |nt| nt.chars.each_slice(outer_width).map(&:join).map(&:strip) }
272
+ num_chunked = feature.notes_by_num.each_with_object({}) { |(k, nt), h| h[k] = nt.chars.each_slice(outer_width - 5).map(&:join).map(&:strip) }
272
273
  notes_total = notes_chunked.map(&:size).sum + num_chunked.map(&:size).sum
273
274
 
274
275
  if height > cy + 2 && (notes_chunked.any? || num_chunked.any?)
data/lib/cani/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cani
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cani
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sidney Liebrand
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-20 00:00:00.000000000 Z
11
+ date: 2018-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize