pokemoves-cli 1.0.2 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/Gemfile.lock +2 -7
- data/bin/pokemoves +6 -0
- data/lib/pokemoves.rb +85 -0
- data/lib/pokemoves/cli/version.rb +1 -1
- data/lib/scraper.rb +0 -1
- data/pokemoves-cli.gemspec +3 -2
- metadata +21 -6
- data/bin/pokemoves-cli +0 -16
- data/lib/cli.rb +0 -82
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 732a8a1db9efc35c555d6588a28345acf413bdcb0be669dbcd6be9214029a5a1
|
4
|
+
data.tar.gz: a364a2d42b880891dbddd5f09216d22e123ee963e4f90325213dec0eb03d70f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c04dcacf11cf91b75b4532b4b8cbe52badcab43eed1a899820020046f2f563bc69f65e277863b2b48988a3dd2d8db3c8e4f774bfb7ffcc5a87c0f32b6272879
|
7
|
+
data.tar.gz: f7799aa935a3ca46686efa9586557d7b0eb2e94d70ccdd0573426aff5f4075cf067748e7ab602e91a48bdde12bb143d8dd271c875e1f415a3471b8a1739d8189
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,23 +1,19 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pokemoves-cli (1.0.
|
4
|
+
pokemoves-cli (1.0.7)
|
5
|
+
httparty
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: https://rubygems.org/
|
8
9
|
specs:
|
9
|
-
coderay (1.1.3)
|
10
10
|
httparty (0.18.1)
|
11
11
|
mime-types (~> 3.0)
|
12
12
|
multi_xml (>= 0.5.2)
|
13
|
-
method_source (1.0.0)
|
14
13
|
mime-types (3.3.1)
|
15
14
|
mime-types-data (~> 3.2015)
|
16
15
|
mime-types-data (3.2020.0512)
|
17
16
|
multi_xml (0.6.0)
|
18
|
-
pry (0.13.1)
|
19
|
-
coderay (~> 1.1)
|
20
|
-
method_source (~> 1.0)
|
21
17
|
rake (12.3.3)
|
22
18
|
|
23
19
|
PLATFORMS
|
@@ -27,7 +23,6 @@ DEPENDENCIES
|
|
27
23
|
bundler (~> 2.0)
|
28
24
|
httparty
|
29
25
|
pokemoves-cli!
|
30
|
-
pry
|
31
26
|
rake (~> 12.3.3)
|
32
27
|
|
33
28
|
BUNDLED WITH
|
data/bin/pokemoves
ADDED
data/lib/pokemoves.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
require_relative "pokemon.rb"
|
2
|
+
require_relative "move.rb"
|
3
|
+
require "pokemoves/cli/version"
|
4
|
+
|
5
|
+
module Pokemoves
|
6
|
+
class CLI
|
7
|
+
puts "Welcome to Pokemoves!"
|
8
|
+
input = 0
|
9
|
+
until input == 3
|
10
|
+
puts "Enter 1 to see a list of a pokemon's given moves."
|
11
|
+
puts "Enter 2 to see if a certain move is learnable by a pokemon."
|
12
|
+
puts "Enter 3 to exit."
|
13
|
+
input = gets.to_i
|
14
|
+
if input == 1
|
15
|
+
puts "Enter the name of a pokemon."
|
16
|
+
pokemon_name = gets.chomp
|
17
|
+
until Pokemon.find_or_create_by_name(pokemon_name.downcase) != nil
|
18
|
+
puts "It doesn't look like we have that pokemon stored."
|
19
|
+
puts "Try a different one."
|
20
|
+
pokemon_name = gets.chomp
|
21
|
+
end
|
22
|
+
current_pokemon = Pokemon.find_or_create_by_name(pokemon_name.downcase)
|
23
|
+
puts "Press enter to see a list of #{pokemon_name.capitalize}'s moves."
|
24
|
+
gets
|
25
|
+
counter = 1
|
26
|
+
current_pokemon.get_moves.each{|move|
|
27
|
+
puts "#{counter}. #{move.split("-").collect{|word| word.capitalize}.join(" ")}"
|
28
|
+
counter += 1
|
29
|
+
}
|
30
|
+
puts "Enter the number of the move you'd like to know the type of."
|
31
|
+
puts "To continue to the main menu, enter -1"
|
32
|
+
num = gets.to_i
|
33
|
+
until num <= 0
|
34
|
+
if(num <= current_pokemon.get_moves.size)
|
35
|
+
current_move = Move.find_or_create_by_name(current_pokemon.get_moves[num - 1])
|
36
|
+
puts "The move #{current_move.name.capitalize} is a #{current_move.type} type move."
|
37
|
+
else
|
38
|
+
puts "That number is not in the list of moves."
|
39
|
+
end
|
40
|
+
puts "Enter the number of the move you'd like to know the type of."
|
41
|
+
puts "Enter -1 to continue to the main menu."
|
42
|
+
num = gets.to_i
|
43
|
+
end
|
44
|
+
|
45
|
+
elsif input == 2
|
46
|
+
puts "Enter the name of a move!"
|
47
|
+
move_name = gets.chomp
|
48
|
+
until Move.find_or_create_by_name(move_name.split(" ").collect{|word| word.downcase}.join("-")) != nil
|
49
|
+
puts "It doesn't look like we have that move stored."
|
50
|
+
puts "Try a different one."
|
51
|
+
move_name = gets.chomp
|
52
|
+
end
|
53
|
+
current_move = Move.find_or_create_by_name(move_name.split(" ").collect{|word| word.downcase}.join("-"))
|
54
|
+
puts "Enter the name of a pokemon to see if they can learn #{current_move.name.split("-").collect{|word| word.capitalize}.join(" ")}"
|
55
|
+
pokemon_name = gets.chomp
|
56
|
+
until Pokemon.find_or_create_by_name(pokemon_name.downcase) != nil
|
57
|
+
puts "It doesn't look like we have that pokemon stored."
|
58
|
+
puts "Try a different one."
|
59
|
+
pokemon_name = gets.chomp
|
60
|
+
end
|
61
|
+
until pokemon_name == "exit"
|
62
|
+
current_pokemon = Pokemon.find_or_create_by_name(pokemon_name.downcase)
|
63
|
+
if current_pokemon.can_learn_move?(current_move.name)
|
64
|
+
puts "It looks like #{current_pokemon.name.capitalize} can learn #{current_move.name.split("-").collect{|word| word.capitalize}.join(" ")}."
|
65
|
+
else
|
66
|
+
puts "It looks like #{current_pokemon.name.capitalize} can't learn #{current_move.name.split("-").collect{|word| word.capitalize}.join(" ")}."
|
67
|
+
end
|
68
|
+
puts "Enter the name of another pokemon to see if they can learn #{current_move.name.split("-").collect{|word| word.capitalize}.join(" ")}."
|
69
|
+
puts "Enter \"exit\" to continue to the main menu."
|
70
|
+
pokemon_name = gets.chomp
|
71
|
+
until Pokemon.find_or_create_by_name(pokemon_name.downcase) != nil || pokemon_name == "exit"
|
72
|
+
puts "It doesn't look like we have that pokemon stored."
|
73
|
+
puts "Try a different one, or enter \"exit\" to exit."
|
74
|
+
pokemon_name = gets.chomp
|
75
|
+
end
|
76
|
+
end
|
77
|
+
else
|
78
|
+
puts "That isn't a vailid choice." unless input == 3
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
data/lib/scraper.rb
CHANGED
data/pokemoves-cli.gemspec
CHANGED
@@ -32,10 +32,11 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
33
33
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
34
34
|
end
|
35
|
-
spec.bindir = "exe"
|
36
|
-
spec.executables =
|
35
|
+
#spec.bindir = "exe"
|
36
|
+
spec.executables = ["pokemoves"]
|
37
37
|
spec.require_paths = ["lib"]
|
38
38
|
|
39
39
|
spec.add_development_dependency "bundler", "~> 2.0"
|
40
40
|
spec.add_development_dependency "rake", "~> 12.3.3"
|
41
|
+
spec.add_runtime_dependency "httparty"
|
41
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pokemoves-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "'Andrew Ribas'"
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,12 +38,27 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 12.3.3
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: httparty
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: '"Pokemoves allows you to easily check which moves pokemon can learn,
|
42
56
|
as well as which pokemon can learn a specific move. You can also check a move''s
|
43
57
|
given type."'
|
44
58
|
email:
|
45
59
|
- "'andrew.j.ribas@gmail.com'"
|
46
|
-
executables:
|
60
|
+
executables:
|
61
|
+
- pokemoves
|
47
62
|
extensions: []
|
48
63
|
extra_rdoc_files: []
|
49
64
|
files:
|
@@ -54,11 +69,11 @@ files:
|
|
54
69
|
- LICENSE.txt
|
55
70
|
- README.md
|
56
71
|
- Rakefile
|
57
|
-
- bin/pokemoves
|
72
|
+
- bin/pokemoves
|
58
73
|
- bin/setup
|
59
|
-
- lib/cli.rb
|
60
74
|
- lib/move.rb
|
61
75
|
- lib/pokemon.rb
|
76
|
+
- lib/pokemoves.rb
|
62
77
|
- lib/pokemoves/cli/version.rb
|
63
78
|
- lib/scraper.rb
|
64
79
|
- pokemoves-cli.gemspec
|
data/bin/pokemoves-cli
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
|
5
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
6
|
-
# with your gem easier. You can also use a different console, if you like.
|
7
|
-
|
8
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
9
|
-
# require "pry"
|
10
|
-
# Pry.start
|
11
|
-
|
12
|
-
require "irb"
|
13
|
-
require "./lib/cli.rb"
|
14
|
-
|
15
|
-
cli = CLI.new
|
16
|
-
|
data/lib/cli.rb
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
require_relative "pokemon.rb"
|
2
|
-
require_relative "move.rb"
|
3
|
-
|
4
|
-
class CLI
|
5
|
-
puts "Welcome to Pokemoves!"
|
6
|
-
input = 0
|
7
|
-
until input == 3
|
8
|
-
puts "Enter 1 to see a list of a pokemon's given moves."
|
9
|
-
puts "Enter 2 to see if a certain move is learnable by a pokemon."
|
10
|
-
puts "Enter 3 to exit."
|
11
|
-
input = gets.to_i
|
12
|
-
if input == 1
|
13
|
-
puts "Enter the name of a pokemon."
|
14
|
-
pokemon_name = gets.chomp
|
15
|
-
until Pokemon.find_or_create_by_name(pokemon_name.downcase) != nil
|
16
|
-
puts "It doesn't look like we have that pokemon stored."
|
17
|
-
puts "Try a different one."
|
18
|
-
pokemon_name = gets.chomp
|
19
|
-
end
|
20
|
-
current_pokemon = Pokemon.find_or_create_by_name(pokemon_name.downcase)
|
21
|
-
puts "Press enter to see a list of #{pokemon_name.capitalize}'s moves."
|
22
|
-
gets
|
23
|
-
counter = 1
|
24
|
-
current_pokemon.get_moves.each{|move|
|
25
|
-
puts "#{counter}. #{move.split("-").collect{|word| word.capitalize}.join(" ")}"
|
26
|
-
counter += 1
|
27
|
-
}
|
28
|
-
puts "Enter the number of the move you'd like to know the type of."
|
29
|
-
puts "To continue to the main menu, enter -1"
|
30
|
-
num = gets.to_i
|
31
|
-
until num <= 0
|
32
|
-
if(num <= current_pokemon.get_moves.size)
|
33
|
-
current_move = Move.find_or_create_by_name(current_pokemon.get_moves[num - 1])
|
34
|
-
puts "The move #{current_move.name.capitalize} is a #{current_move.type} type move."
|
35
|
-
else
|
36
|
-
puts "That number is not in the list of moves."
|
37
|
-
end
|
38
|
-
puts "Enter the number of the move you'd like to know the type of."
|
39
|
-
puts "Enter -1 to continue to the main menu."
|
40
|
-
num = gets.to_i
|
41
|
-
end
|
42
|
-
|
43
|
-
elsif input == 2
|
44
|
-
puts "Enter the name of a move!"
|
45
|
-
move_name = gets.chomp
|
46
|
-
until Move.find_or_create_by_name(move_name.split(" ").collect{|word| word.downcase}.join("-")) != nil
|
47
|
-
puts "It doesn't look like we have that move stored."
|
48
|
-
puts "Try a different one."
|
49
|
-
move_name = gets.chomp
|
50
|
-
end
|
51
|
-
current_move = Move.find_or_create_by_name(move_name.split(" ").collect{|word| word.downcase}.join("-"))
|
52
|
-
puts "Enter the name of a pokemon to see if they can learn #{current_move.name.split("-").collect{|word| word.capitalize}.join(" ")}"
|
53
|
-
pokemon_name = gets.chomp
|
54
|
-
until Pokemon.find_or_create_by_name(pokemon_name.downcase) != nil
|
55
|
-
puts "It doesn't look like we have that pokemon stored."
|
56
|
-
puts "Try a different one."
|
57
|
-
pokemon_name = gets.chomp
|
58
|
-
end
|
59
|
-
until pokemon_name == "exit"
|
60
|
-
current_pokemon = Pokemon.find_or_create_by_name(pokemon_name.downcase)
|
61
|
-
if current_pokemon.can_learn_move?(current_move.name)
|
62
|
-
puts "It looks like #{current_pokemon.name.capitalize} can learn #{current_move.name.split("-").collect{|word| word.capitalize}.join(" ")}."
|
63
|
-
else
|
64
|
-
puts "It looks like #{current_pokemon.name.capitalize} can't learn #{current_move.name.split("-").collect{|word| word.capitalize}.join(" ")}."
|
65
|
-
end
|
66
|
-
puts "Enter the name of another pokemon to see if they can learn #{current_move.name.split("-").collect{|word| word.capitalize}.join(" ")}."
|
67
|
-
puts "Enter \"exit\" to continue to the main menu."
|
68
|
-
pokemon_name = gets.chomp
|
69
|
-
until Pokemon.find_or_create_by_name(pokemon_name.downcase) != nil || pokemon_name == "exit"
|
70
|
-
puts "It doesn't look like we have that pokemon stored."
|
71
|
-
puts "Try a different one, or enter \"exit\" to exit."
|
72
|
-
pokemon_name = gets.chomp
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
else
|
77
|
-
puts "That isn't a vailid choice." unless input == 3
|
78
|
-
end
|
79
|
-
|
80
|
-
end
|
81
|
-
|
82
|
-
end
|