omnibar 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -0
- data/README.md +3 -0
- data/lib/omnibar.rb +12 -0
- data/lib/omnibar/app.rb +2 -0
- data/lib/omnibar/github.rb +7 -6
- data/lib/omnibar/renderer.rb +2 -2
- data/lib/omnibar/version.rb +1 -1
- data/omnibar.gemspec +7 -6
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cde2fe41dbe7f67c545e0f41a77a37fd17e09297
|
4
|
+
data.tar.gz: a58f27bc5c2cc0a6f84c5132e90a4390d433e923
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2266d2f38a91eabf847239b609657f8056bfc5a1ab1c74a3acae3926844d17520428603385b23bd40ca110bb7952c0212e5e0e9cdbb97397768f13e8d0853b8c
|
7
|
+
data.tar.gz: 9143be880598bc1c52b20a9d7b42653be93db7826b28c141769c75ea9c022bfa9a6ebf6c6bd538ef0b574cc94beae6423c5c515efd84f316ccec5d1ab54d1243
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Omnibar
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/omnibar.svg)](https://badge.fury.io/rb/omnibar)
|
4
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/986aa321241fbeb4a9e1/maintainability)](https://codeclimate.com/github/shreve/omnibar/maintainability)
|
5
|
+
|
3
6
|
Omnibar is a tool for quick access to multiple scripts and searches.
|
4
7
|
|
5
8
|
|
data/lib/omnibar.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'dry-configurable'
|
2
|
+
|
1
3
|
require 'omnibar/version'
|
2
4
|
require 'omnibar/app'
|
3
5
|
|
@@ -8,4 +10,14 @@ require 'omnibar/google'
|
|
8
10
|
require 'omnibar/duck_duck_go'
|
9
11
|
|
10
12
|
module Omnibar
|
13
|
+
extend Dry::Configurable
|
14
|
+
|
15
|
+
setting :github do
|
16
|
+
setting :repos, []
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.load_config
|
20
|
+
load File.expand_path('~/.omnibar')
|
21
|
+
rescue LoadError => _
|
22
|
+
end
|
11
23
|
end
|
data/lib/omnibar/app.rb
CHANGED
@@ -20,6 +20,7 @@ module Omnibar
|
|
20
20
|
def initialize
|
21
21
|
@input = ''
|
22
22
|
@selection = 0
|
23
|
+
Omnibar.load_config
|
23
24
|
end
|
24
25
|
|
25
26
|
def run
|
@@ -66,6 +67,7 @@ module Omnibar
|
|
66
67
|
def perform_action!
|
67
68
|
visible_queries[selection]&.perform!
|
68
69
|
self.input = ""
|
70
|
+
# TODO: after_perform callback
|
69
71
|
end
|
70
72
|
|
71
73
|
def queries
|
data/lib/omnibar/github.rb
CHANGED
@@ -7,19 +7,17 @@ end
|
|
7
7
|
module Omnibar
|
8
8
|
class Github < Query
|
9
9
|
def repos
|
10
|
-
|
11
|
-
wellopp/dashboard
|
12
|
-
wellopp/dispatch
|
13
|
-
wellopp/magic-docs
|
14
|
-
)
|
10
|
+
Omnibar.config.github.repos
|
15
11
|
end
|
16
12
|
|
17
13
|
def result
|
18
14
|
repos.each do |repo|
|
19
15
|
user, name = repo.split('/')
|
16
|
+
name ||= ''
|
20
17
|
return repo if (input & repo or input & user or input & name)
|
21
18
|
end
|
22
|
-
|
19
|
+
|
20
|
+
return input if input.match?(/^[\w-]+\/[\w-]+$/)
|
23
21
|
end
|
24
22
|
|
25
23
|
def perform!
|
@@ -28,3 +26,6 @@ module Omnibar
|
|
28
26
|
end
|
29
27
|
end
|
30
28
|
end
|
29
|
+
|
30
|
+
# TODO: assume name/name is a github repo
|
31
|
+
# TODO: add task for fetching user's repos https://api.github.com/users/:username/repos
|
data/lib/omnibar/renderer.rb
CHANGED
@@ -30,11 +30,11 @@ module Omnibar
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def rpad(text, length = ANSI.size[:width])
|
33
|
-
text + (' ' * (length - text.length))
|
33
|
+
text + (' ' * [0, (length - text.length)].max)
|
34
34
|
end
|
35
35
|
|
36
36
|
def lpad(text, length = ANSI.size[:width])
|
37
|
-
(' ' * (length - text.length)) + text
|
37
|
+
(' ' * [0, (length - text.length)].max) + text
|
38
38
|
end
|
39
39
|
|
40
40
|
def max_label_length
|
data/lib/omnibar/version.rb
CHANGED
data/omnibar.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require 'omnibar/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'omnibar'
|
@@ -17,10 +17,11 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
18
|
f.match(%r{^(test|spec|features)/})
|
19
19
|
end
|
20
|
-
spec.bindir =
|
20
|
+
spec.bindir = 'exe'
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
-
spec.require_paths = [
|
22
|
+
spec.require_paths = ['lib']
|
23
23
|
|
24
|
-
spec.
|
25
|
-
spec.add_development_dependency
|
24
|
+
spec.add_dependency 'dry-configurable', '~> 0.7.0'
|
25
|
+
spec.add_development_dependency 'bundler', '~> 1.16.a'
|
26
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
26
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Evan Shreve
|
@@ -10,6 +10,20 @@ bindir: exe
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2017-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dry-configurable
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.7.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.7.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|