cani 0.4.1 → 0.4.2
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 +4 -4
- data/cani.gemspec +14 -12
- data/exe/cani +0 -1
- data/lib/cani/api/feature/viewer.rb +1 -1
- data/lib/cani/api.rb +1 -1
- data/lib/cani/completions.rb +2 -2
- data/lib/cani/fzf.rb +1 -1
- data/lib/cani/version.rb +1 -1
- data/lib/cani.rb +1 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae8ae8c652d00d36462bc6061152f8fc0ace6a1ef2a60829454e36a13724c61b
|
4
|
+
data.tar.gz: 57c8faa58ecee7055cd551cd04c22ec716741ffe4efdc8d1a2c039dd63fe6392
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b1a3afd03c2ee8a129ed679693f4c632c64221297ae2467194c41dad11baa1fb579a4288871613d0afe4bb759a8859b4a4771bb085438c072a156248e336532
|
7
|
+
data.tar.gz: 89939e8bceaf23bcd3e94317de9ed73231da669d339c828a06932d3864fe3b2a268fba435498b1a642e00b3411711f36577742662985e99145f44f448a976ad2
|
data/cani.gemspec
CHANGED
@@ -3,24 +3,26 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
require 'cani/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
|
-
spec.
|
7
|
-
spec.
|
8
|
-
spec.
|
9
|
-
spec.
|
6
|
+
spec.required_ruby_version = '>= 2.1'
|
7
|
+
spec.name = 'cani'
|
8
|
+
spec.version = Cani::VERSION
|
9
|
+
spec.authors = ['Sidney Liebrand']
|
10
|
+
spec.email = ['sidneyliebrand@gmail.com']
|
10
11
|
|
11
|
-
spec.summary
|
12
|
-
spec.description
|
13
|
-
spec.homepage
|
14
|
-
spec.license
|
12
|
+
spec.summary = 'A simple caniuse CLI.'
|
13
|
+
spec.description = 'An interactive TUI (using FZF / Curses) for exploring caniuse.com in your terminal.'
|
14
|
+
spec.homepage = 'https://github.com/SidOfc/cani'
|
15
|
+
spec.license = 'MIT'
|
15
16
|
|
16
|
-
spec.files
|
17
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
17
18
|
`git ls-files -z`.split("\x0").reject do |f|
|
18
19
|
f.match(%r{^(test|spec|features|assets)/})
|
19
20
|
end
|
20
21
|
end
|
21
|
-
|
22
|
-
spec.
|
23
|
-
spec.require_paths
|
22
|
+
|
23
|
+
spec.bindir = 'exe'
|
24
|
+
spec.require_paths = ['lib']
|
25
|
+
spec.executables << 'cani'
|
24
26
|
|
25
27
|
spec.add_runtime_dependency 'colorize'
|
26
28
|
spec.add_runtime_dependency 'curses'
|
data/exe/cani
CHANGED
@@ -270,7 +270,7 @@ module Cani
|
|
270
270
|
|
271
271
|
notes_chunked = feature.notes.map { |nt| nt.chars.each_slice(outer_width).map(&:join).map(&:strip) }
|
272
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) }
|
273
|
-
notes_total = notes_chunked.map(&:size)
|
273
|
+
notes_total = (notes_chunked.map(&:size) + num_chunked.map(&:size)).reduce(0) { |total, add| total + add }
|
274
274
|
|
275
275
|
if height > cy + 2 && (notes_chunked.any? || num_chunked.any?)
|
276
276
|
# print notes header
|
data/lib/cani/api.rb
CHANGED
@@ -56,7 +56,7 @@ module Cani
|
|
56
56
|
def find_feature(name)
|
57
57
|
name = Regexp.new name.to_s.downcase.gsub(/(\W)/, '.*'), :i
|
58
58
|
idx = features.find_index do |ft|
|
59
|
-
ft.title.downcase.match
|
59
|
+
ft.title.downcase.match(name) || ft.name.downcase.match(name)
|
60
60
|
end
|
61
61
|
|
62
62
|
features[idx] if idx
|
data/lib/cani/completions.rb
CHANGED
@@ -90,7 +90,7 @@ module Cani
|
|
90
90
|
shellrc = File.join Dir.home, ".#{shell}rc"
|
91
91
|
lines = File.read(shellrc).split "\n"
|
92
92
|
comp_path = File.join Cani.config.comp_dir, "_cani.#{shell}"
|
93
|
-
rm_idx = lines.find_index { |l| l.match
|
93
|
+
rm_idx = lines.find_index { |l| l.match comp_path }
|
94
94
|
|
95
95
|
lines.delete_at rm_idx unless rm_idx.nil?
|
96
96
|
File.write shellrc, lines.join("\n")
|
@@ -102,7 +102,7 @@ module Cani
|
|
102
102
|
shellrc = File.join Dir.home, ".#{shell}rc"
|
103
103
|
lines = File.read(shellrc).split "\n"
|
104
104
|
comp_path = File.join Cani.config.comp_dir, "_cani.#{shell}"
|
105
|
-
slidx = lines.find_index { |l| l.match
|
105
|
+
slidx = lines.find_index { |l| l.match comp_path }
|
106
106
|
|
107
107
|
if slidx
|
108
108
|
lines[slidx] =
|
data/lib/cani/fzf.rb
CHANGED
@@ -41,7 +41,7 @@ module Cani
|
|
41
41
|
|
42
42
|
def self.browser_rows
|
43
43
|
@browser_rows ||= Cani.api.browsers.map do |bwsr|
|
44
|
-
[bwsr.title, 'usage: ' + format('%.4f%%', bwsr.usage.values.
|
44
|
+
[bwsr.title, 'usage: ' + format('%.4f%%', bwsr.usage.values.reduce(0) { |total, add| total + add })]
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
data/lib/cani/version.rb
CHANGED
data/lib/cani.rb
CHANGED
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.4.
|
4
|
+
version: 0.4.2
|
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-
|
11
|
+
date: 2018-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -108,7 +108,8 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '3.0'
|
111
|
-
description:
|
111
|
+
description: An interactive TUI (using FZF / Curses) for exploring caniuse.com in
|
112
|
+
your terminal.
|
112
113
|
email:
|
113
114
|
- sidneyliebrand@gmail.com
|
114
115
|
executables:
|
@@ -152,7 +153,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
152
153
|
requirements:
|
153
154
|
- - ">="
|
154
155
|
- !ruby/object:Gem::Version
|
155
|
-
version: '
|
156
|
+
version: '2.1'
|
156
157
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
158
|
requirements:
|
158
159
|
- - ">="
|