smogon_dex 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/bin/smogon_dex +30 -0
  3. data/lib/smogon_dex.rb +8 -0
  4. metadata +60 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 48ffb182f3ac191c7eeaddaac5e8171e8120bd15
4
+ data.tar.gz: 8ab116a5ea40ef199375365ff05dab8b1a39abcd
5
+ SHA512:
6
+ metadata.gz: f5a09f0fe87edb108aa0890d0ef747da2a56612878ee924d3f9202d569e9bffea06ecdf056f5af33fe2cbf41889b962795b2d386f2b0ac3bca6686c43cb09e72
7
+ data.tar.gz: 130f8f7928ca928c0cb689f12619811abec98fa0d135c5d7ff14b068b0b67e5270eaa42ad8d965319c741ef32043dec04836191bfbc1bd48f587938400672981
data/bin/smogon_dex ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env ruby
2
+ require "launchy"
3
+ require "smogon_dex"
4
+ include SmogonDex
5
+ gen, search_catagory = nil
6
+
7
+ ARGV.each do |arg|
8
+ if arg =~ /\-\-/
9
+ Generations.each do |generation|
10
+ if arg =~ generation and gen.nil?
11
+ gen = generation
12
+ ARGV.delete! arg
13
+ end
14
+ end
15
+ Catagories.each do |catagory|
16
+ if arg =~ catagory and search_catagory.nil?
17
+ search_catagory = catagory
18
+ ARGV.delete! arg
19
+ end
20
+ end
21
+ end
22
+ end
23
+ query = ARGV.shift unless ARGV.empty?
24
+ search_catagory ||= "pokemon"
25
+ gen ||= "xy"
26
+ Launchy.open url(gen, search_catagory, query)
27
+
28
+
29
+
30
+
data/lib/smogon_dex.rb ADDED
@@ -0,0 +1,8 @@
1
+ module SmogonDex
2
+ Catagories = %w(pokemon moves abilities items formats types)
3
+ Generations = %w(xy dp gs bw rb rs)
4
+ module_function
5
+ def url(gen="xy", search_catagory="pokemon", query="")
6
+ "https://www.smogon.com/dex/" + gen + "/" + search_catagory + "/" + query
7
+ end
8
+ end
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: smogon_dex
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Zachary R. Perlmutter
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-04-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: launchy
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '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'
27
+ description:
28
+ email: zrp200@gmail.com
29
+ executables:
30
+ - smogon_dex
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - bin/smogon_dex
35
+ - lib/smogon_dex.rb
36
+ homepage:
37
+ licenses:
38
+ - MIT
39
+ metadata: {}
40
+ post_install_message:
41
+ rdoc_options: []
42
+ require_paths:
43
+ - lib
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ requirements: []
55
+ rubyforge_project:
56
+ rubygems_version: 2.6.3
57
+ signing_key:
58
+ specification_version: 4
59
+ summary: Allows easy searching of the entire Smogon pokedex
60
+ test_files: []