namesies 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/namesies/cli.rb +22 -7
- data/lib/namesies/rubygems.rb +1 -1
- data/lib/namesies/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: 826656073a36a2206d67bfb25a586353fe037f4d
|
4
|
+
data.tar.gz: b80644bc3ec0e90fd6b41b2900266137f9aee92e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3de130a1d80a50a2294cf7edd4d48ea77f8672c8c1245326e3ccf4f9908c3298c01b985fdebb7949dc9cf11835dd755d624af91e634a24a3f6391ff66168f0fc
|
7
|
+
data.tar.gz: bd06115c6bf563d984ef37447670d564d0b1c1a1abe948914af0306f78f1e8a6e40a150ac073ddc0ea7111fe350d76e00a04e51c23f19a39901d2bac4363f245
|
data/lib/namesies/cli.rb
CHANGED
@@ -3,20 +3,35 @@ require 'thor'
|
|
3
3
|
module Namesies
|
4
4
|
class CLI < Thor
|
5
5
|
|
6
|
+
option :only, type: :array, aliases: 'o'
|
7
|
+
option :except, type: :array, aliases: 'e'
|
6
8
|
desc "search QUERY", "search all services for QUERY"
|
7
9
|
def search(q)
|
8
10
|
puts "Searching for #{q}..."
|
9
11
|
puts "\n"
|
10
|
-
|
11
|
-
Namesies
|
12
|
-
|
13
|
-
|
12
|
+
|
13
|
+
services = Namesies.constants - [:VERSION, :CLI, :Reporter]
|
14
|
+
|
15
|
+
if options[:only]
|
16
|
+
options[:only].each do |service|
|
17
|
+
Namesies.const_get(service.capitalize).send(:search, q)
|
18
|
+
end
|
19
|
+
else
|
20
|
+
services.each do |service|
|
21
|
+
next if options[:except] && options[:except].include?(service.to_s.downcase)
|
22
|
+
Namesies.const_get(service.capitalize).send(:search, q)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
14
26
|
puts "\n"
|
15
27
|
end
|
16
28
|
|
17
|
-
desc "
|
18
|
-
def
|
19
|
-
|
29
|
+
desc "services", "list all currently searchable services"
|
30
|
+
def services
|
31
|
+
puts "Namesies currently searches:"
|
32
|
+
Namesies.constants.each do |service|
|
33
|
+
puts " #{service}" unless [:VERSION, :CLI, :Reporter].include? service
|
34
|
+
end
|
20
35
|
end
|
21
36
|
end
|
22
37
|
end
|
data/lib/namesies/rubygems.rb
CHANGED
data/lib/namesies/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: namesies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Dewan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|