omnibar 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/omnibar.rb +13 -0
- data/lib/omnibar/app.rb +1 -0
- data/lib/omnibar/renderer.rb +10 -2
- data/lib/omnibar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24f7677005fd87a28c0d3bb2d9fbb462b22d4d68
|
4
|
+
data.tar.gz: 1eaf5de0c345a7e64eaa9b029e9d489d40537891
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4883f22dee50d40b30d002303ba70b27e5550c14c25e444adb79e5708a9e6727ccf6b2c727e385ea1a83e0e4a43f1741d1b6cf432564efa1454c35bd89f017d6
|
7
|
+
data.tar.gz: 2f65245d5dc3b705beef56f8843f932e94e70f73416346b270f1f799b42cc342639d5e44a5ae3c97fed9e48b652422cea3fe9d4a04ee59ccae675cc3ae62eab9
|
data/Gemfile.lock
CHANGED
data/lib/omnibar.rb
CHANGED
@@ -16,6 +16,19 @@ module Omnibar
|
|
16
16
|
setting :repos, []
|
17
17
|
end
|
18
18
|
|
19
|
+
setting :render do
|
20
|
+
setting :prompt, ->(width) { ('-' * width) << '>' }
|
21
|
+
|
22
|
+
setting :highlight do
|
23
|
+
setting :fg, :black
|
24
|
+
setting :bg, :yellow
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
setting :events do
|
29
|
+
setting :after_perform, -> {}
|
30
|
+
end
|
31
|
+
|
19
32
|
def self.load_config
|
20
33
|
load File.expand_path('~/.omnibar')
|
21
34
|
rescue LoadError => _
|
data/lib/omnibar/app.rb
CHANGED
data/lib/omnibar/renderer.rb
CHANGED
@@ -19,14 +19,22 @@ module Omnibar
|
|
19
19
|
rpad(result.last, ANSI.size[:width] - max_label_length - 2)
|
20
20
|
].join(': ')
|
21
21
|
|
22
|
-
|
22
|
+
if i == selection
|
23
|
+
text = ANSI.color(text,
|
24
|
+
fg: Omnibar.config.render.highlight.fg,
|
25
|
+
bg: Omnibar.config.render.highlight.bg)
|
26
|
+
end
|
23
27
|
print "#{text}\r\n"
|
24
28
|
end
|
25
29
|
ANSI.move_cursor(0, input_line.length)
|
26
30
|
end
|
27
31
|
|
28
32
|
def input_line
|
29
|
-
|
33
|
+
prompt = Omnibar.config.render.prompt
|
34
|
+
if prompt.respond_to?(:call)
|
35
|
+
prompt = prompt.call(max_label_length)
|
36
|
+
end
|
37
|
+
"#{prompt} #{input}"
|
30
38
|
end
|
31
39
|
|
32
40
|
def rpad(text, length = ANSI.size[:width])
|
data/lib/omnibar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omnibar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Evan Shreve
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-configurable
|