smogon 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smogon/movesetdex.rb +6 -6
- data/lib/smogon/types/moveset.rb +7 -0
- data/lib/smogon/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68899beb3f6cac4f510727d7af5cda4457b4126e
|
4
|
+
data.tar.gz: 839f085730d3a701c65ed3b52acb1f3ba41e1326
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c5e651aec97357258a8a44e01019819bed0672b88c524a79fb77bc359fab25a95cd6d74eee05fafaf11b87a07f8dd874ced4f1190ad40af5af158e8fa3b1ce4
|
7
|
+
data.tar.gz: ee3619904557d8a85f35feb86c07c3a9fe170cd3d5770867567d71e9bb7827554444808ef87f858bb0390a3adf44ddf283c3fa066d918300e0798bd101045951
|
data/lib/smogon/movesetdex.rb
CHANGED
@@ -19,9 +19,9 @@
|
|
19
19
|
|
20
20
|
module Smogon
|
21
21
|
class Movesetdex
|
22
|
-
def self.get(name, tier)
|
22
|
+
def self.get(name, tier, metagame)
|
23
23
|
begin
|
24
|
-
url = URI::encode "http://www.smogon.com/
|
24
|
+
url = URI::encode "http://www.smogon.com/#{metagame}/pokemon/#{name}/#{tier}"
|
25
25
|
|
26
26
|
smogon = Nokogiri::HTML(open(url))
|
27
27
|
rescue
|
@@ -38,9 +38,9 @@ module Smogon
|
|
38
38
|
moveset.tier = smogon.xpath('//div[@id="content_wrapper"]/ul/li/strong').last.text
|
39
39
|
|
40
40
|
s.xpath('.//a').each { |a|
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
moveset.item << a.text if a['href'].include? '/items/'
|
42
|
+
moveset.ability << a.text if a['href'].include? '/abilities/'
|
43
|
+
moveset.nature << a.text if a['href'].include? '/natures/'
|
44
44
|
}
|
45
45
|
|
46
46
|
movesets << moveset
|
@@ -63,7 +63,7 @@ module Smogon
|
|
63
63
|
if continue
|
64
64
|
moveset.moves.last << a
|
65
65
|
else
|
66
|
-
|
66
|
+
moveset.moves << [a]
|
67
67
|
end
|
68
68
|
continue = false
|
69
69
|
end
|
data/lib/smogon/types/moveset.rb
CHANGED
@@ -22,6 +22,13 @@ module Smogon
|
|
22
22
|
class Moveset
|
23
23
|
attr_accessor :pokemon, :name, :tier, :item, :ability, :nature, :moves, :evs
|
24
24
|
|
25
|
+
def initialize
|
26
|
+
@item = []
|
27
|
+
@ability = []
|
28
|
+
@nature = []
|
29
|
+
@moves = []
|
30
|
+
end
|
31
|
+
|
25
32
|
def to_s
|
26
33
|
"Pokémon: #{pokemon}\nSet: #{name}\nItem: #{item.join(' / ')}\nAbility: #{ability.join(' / ')}\nNature: #{nature.join(' / ')}\nMoves: #{''.tap { |s| moves.each { |move| s << move.join(' / ') + ', '}}[0..-3]}\nEVs: #{evs}"
|
27
34
|
end
|
data/lib/smogon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smogon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giovanni Capuano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
description: API
|
27
|
+
description: API to get (Poké|Ability|Item|Move|Moveset)dex from Smogon
|
28
28
|
email: webmaster@giovannicapuano.net
|
29
29
|
executables: []
|
30
30
|
extensions: []
|
@@ -63,5 +63,5 @@ rubyforge_project:
|
|
63
63
|
rubygems_version: 2.0.3
|
64
64
|
signing_key:
|
65
65
|
specification_version: 4
|
66
|
-
summary:
|
66
|
+
summary: API for Smogon.
|
67
67
|
test_files: []
|