smogon 0.4 → 0.4.1
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 +4 -4
- data/lib/smogon/movesetdex.rb +15 -8
- data/lib/smogon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ba6ba8d6786aa123bc34b4044a46f118e5bcd5d
|
|
4
|
+
data.tar.gz: c5a5b8932d81bc6c67b4b689f36b3163df36ec27
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0c10dda50d5cb1e6edc7896863d872a732faae6527909f8438704510e0d8551981c7807acc56f90afadd71db108219bcf61c4e8fac09d1499a0d139beb1851b3
|
|
7
|
+
data.tar.gz: 5f32c923725fa660d84e7582f61267807866e4723f02f3ea416bf8862e042061139b489d81fcb9062a58dd1ba086b90fb9e1ef5a084ec34693fa3344e76b7494
|
data/lib/smogon/movesetdex.rb
CHANGED
|
@@ -37,21 +37,28 @@ module Smogon
|
|
|
37
37
|
moveset.name = s.xpath('tr')[1].xpath('td[@class="name"]/h2').first.text
|
|
38
38
|
moveset.tier = smogon.xpath('//div[@id="content_wrapper"]/ul/li/strong').last.text
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
if metagame == 'gs'
|
|
41
|
+
s.xpath('.//a').each { |a|
|
|
42
|
+
moveset.item << a.text if a['href'].include? '/items/'
|
|
43
|
+
}
|
|
44
|
+
elsif metagame != 'rb'
|
|
45
|
+
s.xpath('.//a').each { |a|
|
|
46
|
+
moveset.item << a.text if a['href'].include? '/items/'
|
|
47
|
+
moveset.ability << a.text if a['href'].include? '/abilities/'
|
|
48
|
+
moveset.nature << a.text if a['href'].include? '/natures/'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
45
51
|
|
|
46
52
|
movesets << moveset
|
|
47
53
|
}
|
|
48
54
|
|
|
49
55
|
i = 0
|
|
50
|
-
|
|
56
|
+
xpath = metagame == 'rb' ? '//td[@class="rbymoves"]' : '//table[@class="info moveset"]'
|
|
57
|
+
smogon.xpath(xpath).each { |s|
|
|
51
58
|
moveset = movesets[i]
|
|
52
59
|
|
|
53
60
|
continue = false
|
|
54
|
-
s.xpath('.//td')[0].text.each_line { |a|
|
|
61
|
+
(metagame == 'rb' ? s : s.xpath('.//td')[0]).text.each_line { |a|
|
|
55
62
|
a = a.gsub(/\n?/, '').strip
|
|
56
63
|
if a == ?~
|
|
57
64
|
continue = false
|
|
@@ -69,7 +76,7 @@ module Smogon
|
|
|
69
76
|
end
|
|
70
77
|
}
|
|
71
78
|
|
|
72
|
-
moveset.evs = s.xpath('.//td').last.text.strip
|
|
79
|
+
moveset.evs = s.xpath('.//td').last.text.strip if metagame != 'rb' && metagame != 'gs'
|
|
73
80
|
|
|
74
81
|
movesets[i] = moveset
|
|
75
82
|
i += 1
|
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:
|
|
4
|
+
version: 0.4.1
|
|
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-09-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|