dexter_plusplus 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +6 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +80 -0
- data/LICENSE.txt +21 -0
- data/NOTES.md +129 -0
- data/README.md +40 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/dexter-plusplus +9 -0
- data/bin/setup +8 -0
- data/dexter_plusplus.gemspec +29 -0
- data/lib/concerns/findable.rb +61 -0
- data/lib/dexter_plusplus/ability.rb +82 -0
- data/lib/dexter_plusplus/ability_menu.rb +101 -0
- data/lib/dexter_plusplus/api.rb +186 -0
- data/lib/dexter_plusplus/cli.rb +105 -0
- data/lib/dexter_plusplus/item.rb +75 -0
- data/lib/dexter_plusplus/item_menu.rb +83 -0
- data/lib/dexter_plusplus/move.rb +113 -0
- data/lib/dexter_plusplus/move_menu.rb +178 -0
- data/lib/dexter_plusplus/pokemon.rb +184 -0
- data/lib/dexter_plusplus/pokemon_menu.rb +182 -0
- data/lib/dexter_plusplus/type.rb +183 -0
- data/lib/dexter_plusplus/type_menu.rb +61 -0
- data/lib/dexter_plusplus/version.rb +3 -0
- data/lib/environment.rb +30 -0
- metadata +76 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
class TypeMenu
|
2
|
+
|
3
|
+
attr_accessor :cli
|
4
|
+
|
5
|
+
def initialize(cli)
|
6
|
+
self.cli = cli
|
7
|
+
end
|
8
|
+
|
9
|
+
def main_menu
|
10
|
+
puts "\n\n"
|
11
|
+
options = ["Normal","Flying","Poison","Ground",
|
12
|
+
"Rock","Bug","Ghost","Steel","Fire",
|
13
|
+
"Water","Grass","Electric","Psychic",
|
14
|
+
"Ice","Dragon","Dark","Fairy","Unknown",
|
15
|
+
"Shadow","Return to main menu".light_green, "Exit Dexter++".light_red]
|
16
|
+
|
17
|
+
input = self.cli.prompt.select("Select a type to search for.", options, cycle: true)
|
18
|
+
if input == "Return to main menu".light_green
|
19
|
+
self.cli.main_menu
|
20
|
+
elsif input == "Exit Dexter++".light_red
|
21
|
+
self.cli.exit_program
|
22
|
+
else
|
23
|
+
type = API.get_type_by_name(input.downcase)
|
24
|
+
type.print_all
|
25
|
+
self.display_more_options(type)
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
def display_more_options(type)
|
31
|
+
puts "\n\n"
|
32
|
+
input = self.cli.prompt.select("What information about #{type.name.capitalize} do you want to see?", cycle: true) do |menu|
|
33
|
+
menu.choice 'See Pokemon of this type', 1
|
34
|
+
menu.choice 'See Moves of this type', 2
|
35
|
+
menu.choice 'Return to main menu'.light_green, 3
|
36
|
+
menu.choice 'Exit Dexter++'.light_red, 4
|
37
|
+
end
|
38
|
+
|
39
|
+
case input
|
40
|
+
when 1
|
41
|
+
menu = PokemonMenu.new(self.cli)
|
42
|
+
menu.search_by_type(type)
|
43
|
+
when 2
|
44
|
+
menu = MoveMenu.new(self.cli)
|
45
|
+
menu.search_by_type(type)
|
46
|
+
when 3
|
47
|
+
self.cli.main_menu
|
48
|
+
when 4
|
49
|
+
self.cli.exit_program
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
end
|
data/lib/environment.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require "pry"
|
2
|
+
require "json"
|
3
|
+
require "rest-client"
|
4
|
+
require "colorize"
|
5
|
+
require "tty-prompt"
|
6
|
+
|
7
|
+
|
8
|
+
require_relative "./dexter_plusplus/cli"
|
9
|
+
require_relative "./concerns/findable"
|
10
|
+
require_relative "./dexter_plusplus/version"
|
11
|
+
require_relative "./dexter_plusplus/pokemon"
|
12
|
+
require_relative "./dexter_plusplus/move"
|
13
|
+
require_relative "./dexter_plusplus/ability"
|
14
|
+
require_relative "./dexter_plusplus/item"
|
15
|
+
require_relative "./dexter_plusplus/type"
|
16
|
+
require_relative "./dexter_plusplus/api"
|
17
|
+
require_relative "./dexter_plusplus/pokemon_menu"
|
18
|
+
require_relative "./dexter_plusplus/move_menu"
|
19
|
+
require_relative "./dexter_plusplus/item_menu"
|
20
|
+
require_relative "./dexter_plusplus/ability_menu"
|
21
|
+
require_relative "./dexter_plusplus/type_menu"
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
#TODO Add requirements here - ALL CLASSES YOU WRITE
|
27
|
+
module DexterPlusplus
|
28
|
+
class Error < StandardError; end
|
29
|
+
# Your code goes here...
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dexter_plusplus
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- sean-slaughter
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-06-21 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
- sthompson2822@gmail.com
|
16
|
+
executables:
|
17
|
+
- dexter-plusplus
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- ".gitignore"
|
22
|
+
- ".rspec"
|
23
|
+
- ".travis.yml"
|
24
|
+
- Gemfile
|
25
|
+
- Gemfile.lock
|
26
|
+
- LICENSE.txt
|
27
|
+
- NOTES.md
|
28
|
+
- README.md
|
29
|
+
- Rakefile
|
30
|
+
- bin/console
|
31
|
+
- bin/dexter-plusplus
|
32
|
+
- bin/setup
|
33
|
+
- dexter_plusplus.gemspec
|
34
|
+
- lib/concerns/findable.rb
|
35
|
+
- lib/dexter_plusplus/ability.rb
|
36
|
+
- lib/dexter_plusplus/ability_menu.rb
|
37
|
+
- lib/dexter_plusplus/api.rb
|
38
|
+
- lib/dexter_plusplus/cli.rb
|
39
|
+
- lib/dexter_plusplus/item.rb
|
40
|
+
- lib/dexter_plusplus/item_menu.rb
|
41
|
+
- lib/dexter_plusplus/move.rb
|
42
|
+
- lib/dexter_plusplus/move_menu.rb
|
43
|
+
- lib/dexter_plusplus/pokemon.rb
|
44
|
+
- lib/dexter_plusplus/pokemon_menu.rb
|
45
|
+
- lib/dexter_plusplus/type.rb
|
46
|
+
- lib/dexter_plusplus/type_menu.rb
|
47
|
+
- lib/dexter_plusplus/version.rb
|
48
|
+
- lib/environment.rb
|
49
|
+
homepage: https://github.com/sean-slaughter/dexter-plusplus
|
50
|
+
licenses:
|
51
|
+
- MIT
|
52
|
+
metadata:
|
53
|
+
homepage_uri: https://github.com/sean-slaughter/dexter-plusplus
|
54
|
+
source_code_uri: https://github.com/sean-slaughter/dexter-plusplus
|
55
|
+
changelog_uri: https://github.com/sean-slaughter/dexter-plusplus
|
56
|
+
post_install_message:
|
57
|
+
rdoc_options: []
|
58
|
+
require_paths:
|
59
|
+
- lib
|
60
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 2.3.0
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
requirements: []
|
71
|
+
rubygems_version: 3.0.8
|
72
|
+
signing_key:
|
73
|
+
specification_version: 4
|
74
|
+
summary: A Ruby PokeDex Gem that allows users to explore Pokemon and Items in the
|
75
|
+
Pokemon Universe
|
76
|
+
test_files: []
|