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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 249cc65c37f64700d2934e4e60d3674354d55aab
4
- data.tar.gz: bd7d1c2571ffe6ed417674c06810852a90675d00
3
+ metadata.gz: 826656073a36a2206d67bfb25a586353fe037f4d
4
+ data.tar.gz: b80644bc3ec0e90fd6b41b2900266137f9aee92e
5
5
  SHA512:
6
- metadata.gz: dddefc750c2ae935b46dae9777a0f189fee22ae2555d49a3fab0203bc1d5cc39d57058850333bcbb844736738c7f70c707eec36921262d47f700cb69ab546888
7
- data.tar.gz: e898abfdc915e3b347baa9042aba3ff8886937ab16b5b08a8b6cd51254f62d860675c4924d3aef63e47dc34be77bce4f1944cc1599f5835dbde8fe1a613c9e9c
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
- Namesies::Domain.search(q)
11
- Namesies::Twitter.search(q)
12
- Namesies::Trademark.search(q)
13
- Namesies::RubyGems.search(q)
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 "s QUERY", "alias for search QUERY"
18
- def s(q)
19
- search(q)
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
@@ -1,7 +1,7 @@
1
1
  require 'gems'
2
2
 
3
3
  module Namesies
4
- class RubyGems
4
+ class Rubygems
5
5
 
6
6
  def self.search(query)
7
7
  reporter = Namesies::Reporter.new('RubyGems')
@@ -1,3 +1,3 @@
1
1
  module Namesies
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.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-29 00:00:00.000000000 Z
11
+ date: 2013-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor