botemon 0.2.3
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 +15 -0
- data/bin/botemon +124 -0
- data/lib/botemon.rb +37 -0
- data/lib/botemon/movedex.rb +60 -0
- data/lib/botemon/moveset.rb +27 -0
- data/lib/botemon/pokedex.rb +69 -0
- data/lib/botemon/pokemon.rb +51 -0
- data/lib/botemon/storage.rb +58 -0
- data/lib/botemon/string.rb +24 -0
- data/lib/botemon/version.rb +25 -0
- metadata +108 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MWM2NTA2NzA1OWZiMzYwMzZlNDNhMjEwZmY5MjcwYjBkYmM2MjM4OQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MDhkMmE0ZjVlY2RlNGZhZDRhMDU4MWU2MzcxOTM2M2FlODQ4NTViYg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NmQyNzk0MjFiZDFjZTcwYWY3ZTY2MjhhZDU1NWYzNzMzZTNkOWU0ODQ2MDc5
|
10
|
+
ZjdkMmI4ZDE1YTA3MzI4MmU3YTliMWYyNmU0ZmU1NTgyODJlNzVlMThhYjNk
|
11
|
+
NzVmMGI0YjUwNTg0YzQ2YzgxNTJiNDY5MzRmMWZkMzlkZTM3NGI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZWFjODljNTlhNDRkOWIyNWI0MzUxMTU1M2NhNDRiOGY0MWFlYWZiNmRjNjRl
|
14
|
+
YTQ3OTdhNTJhYzZlODQ0ZGYzNDAwZmQ3MjUwMzQ4NDZjZDhlZTEyMmZiZjA3
|
15
|
+
NTJmZjg4NTI0OGQyOTVjZWNmM2RkMGI4MTBhZjI1ODI5ZDM3NzI=
|
data/bin/botemon
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#encoding: utf-8
|
3
|
+
#--
|
4
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
5
|
+
#
|
6
|
+
# This file is part of Botémon.
|
7
|
+
#
|
8
|
+
# Botémon is free software: you can redistribute it and/or modify
|
9
|
+
# it under the terms of the GNU General Public License as published by
|
10
|
+
# the Free Software Foundation, either version 3 of the License, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# Botémon is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU General Public License
|
19
|
+
# along with Botémon. If not, see <http://www.gnu.org/licenses/>.
|
20
|
+
#++
|
21
|
+
|
22
|
+
require 'botemon'
|
23
|
+
|
24
|
+
abort 'Usage: botemon <bot_name> <bot_password> <server> <channels>' if ARGV.length < 4
|
25
|
+
|
26
|
+
Cinch::Bot.new {
|
27
|
+
configure do |c|
|
28
|
+
c.nick = ARGV[0]
|
29
|
+
c.realname = ARGV[0]
|
30
|
+
c.user = ARGV[0]
|
31
|
+
c.password = ARGV[1]
|
32
|
+
c.server = ARGV[2]
|
33
|
+
c.channels = ARGV.drop(3).map { |c| "\##{c}" }
|
34
|
+
|
35
|
+
c.plugins.plugins = [Cinch::Plugins::Login]
|
36
|
+
c.plugins.options[Cinch::Plugins::Login] = { :password => ARGV[1] }
|
37
|
+
|
38
|
+
@storage = Storage.new './cache.db'
|
39
|
+
@pokemon_trivia = nil
|
40
|
+
@players = []
|
41
|
+
@trivia_owner = ''
|
42
|
+
end
|
43
|
+
|
44
|
+
on :message, /^pkmn (.+)/ do |m, name|
|
45
|
+
@storage = Storage.new('./cache.db') unless @storage
|
46
|
+
|
47
|
+
name = Pokedex.id2name(name) if name.numeric?
|
48
|
+
|
49
|
+
if name == nil
|
50
|
+
m.reply Format(:red, 'Pokémon not found.')
|
51
|
+
else
|
52
|
+
pokemon = Pokedex.get name, @storage
|
53
|
+
m.reply pokemon ? "#{pokemon.to_s}\nhttp://www.smogon.com/bw/pokemon/#{name}".split("\n").map { |l| Format(:red, l) }.join("\n") : 'Pokémon not found.'
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
on :message, /^moveset (.+) (.+)/ do |m, name, tier|
|
58
|
+
name = Pokedex.id2name(name) if name.numeric?
|
59
|
+
|
60
|
+
if name == nil
|
61
|
+
m.reply Format(:red, 'Pokémon not found.')
|
62
|
+
else
|
63
|
+
moveset = Movedex.get name, tier
|
64
|
+
m.reply Format(:red, moveset ? moveset.to_s : 'Moveset not found.')
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
on :message, /^pktrivia$/ do |m|
|
69
|
+
@storage = Storage.new('./cache.db') unless @storage
|
70
|
+
|
71
|
+
if @pokemon_trivia != nil
|
72
|
+
m.reply Format(:red, 'Other players are playing, wait until they finish.')
|
73
|
+
m.reply Format(:red, @pokemon_trivia.clues)
|
74
|
+
else
|
75
|
+
@pokemon_trivia = Pokedex.get Pokedex.id2name(Random.new.rand(1..649)), @storage
|
76
|
+
@trivia_owner = m.user.nick
|
77
|
+
|
78
|
+
m.reply @pokemon_trivia.clues.split("\n").map { |l| Format(:red, l) }.join("\n")
|
79
|
+
m.reply Format(:red, "You have 30 seconds. Try to say which Pokémon is this!")
|
80
|
+
|
81
|
+
Timer(60) {
|
82
|
+
if @pokemon_trivia != nil
|
83
|
+
m.reply Format(:red, "Time expired. The secret Pokémon is #{@pokemon_trivia.name}!")
|
84
|
+
@pokemon_trivia = nil
|
85
|
+
end
|
86
|
+
}
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
on :message, /^pkstop$/ do |m|
|
91
|
+
if @pokemon_trivia != nil && (m.user.nick == 'mirkosp' || m.user.nick == 'RoxasShadowRS' || m.user.nick == @trivia_owner)
|
92
|
+
@pokemon_trivia = nil
|
93
|
+
@trivia_owner = ''
|
94
|
+
m.reply Format(:red, "Game aborted by #{m.user.nick}.")
|
95
|
+
else
|
96
|
+
m.reply Format(:red, "Only ops can stop the game. #{m.user.nick} GTFO.")
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
on :message, /^pktrivia (.+)$/ do |m, pokemon|
|
101
|
+
if @pokemon_trivia == nil
|
102
|
+
m.reply Format(:red, 'You have to start the game before to play.')
|
103
|
+
elsif pokemon.downcase == @pokemon_trivia.name.downcase
|
104
|
+
m.reply Format(:red, "Right, #{m.user.nick} won!")
|
105
|
+
@pokemon_trivia = nil
|
106
|
+
else
|
107
|
+
m.reply Format(:red, "Nope, #{m.user.nick} was wrong.")
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
on :message, /^pkdebug$/ do |m|
|
112
|
+
if @pokemon_trivia == nil
|
113
|
+
m.reply Format(:red, 'Game not started.')
|
114
|
+
elsif m.user.nick == 'mirkosp' || m.user.nick == 'RoxasShadowRS'
|
115
|
+
m.reply Format(:red, @pokemon_trivia.name)
|
116
|
+
else
|
117
|
+
m.reply Format(:red, 'VAI A ZAPPARE LA TERRA')
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
on :message, /^pkversion$/ do |m|
|
122
|
+
m.reply Botemon::version
|
123
|
+
end
|
124
|
+
}.start
|
data/lib/botemon.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
+
#
|
4
|
+
# This file is part of Botémon.
|
5
|
+
#
|
6
|
+
# Botémon is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# Botémon is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with Botémon. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
|
20
|
+
require 'cinch'
|
21
|
+
require 'cinch/plugins/login'
|
22
|
+
|
23
|
+
require 'open-uri'
|
24
|
+
require 'nokogiri'
|
25
|
+
require 'sanitize'
|
26
|
+
require 'json'
|
27
|
+
|
28
|
+
require 'botemon/string'
|
29
|
+
require 'botemon/pokemon'
|
30
|
+
require 'botemon/storage'
|
31
|
+
require 'botemon/pokedex'
|
32
|
+
|
33
|
+
require 'botemon/moveset'
|
34
|
+
require 'botemon/movedex'
|
35
|
+
|
36
|
+
|
37
|
+
require 'botemon/version'
|
@@ -0,0 +1,60 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
+
#
|
4
|
+
# This file is part of Botémon.
|
5
|
+
#
|
6
|
+
# Botémon is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# Botémon is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with Botémon. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
|
20
|
+
class Movedex
|
21
|
+
def self.id2name(id)
|
22
|
+
begin
|
23
|
+
return Nokogiri::HTML(open("http://pokemondb.net/pokedex/#{id}")).xpath('//div[@class="navbar"]/h1')[0].text
|
24
|
+
rescue
|
25
|
+
return nil
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.tiers
|
30
|
+
['uber', 'ou', 'bl', 'uu', 'bl2', 'ru', 'nu', 'lc', 'limbo', 'nfe']
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.get(name, tier)
|
34
|
+
return nil if name == nil || tier == nil || !Movedex.tiers.include?(tier.downcase)
|
35
|
+
|
36
|
+
begin
|
37
|
+
url = URI::encode "http://www.smogon.com/bw/pokemon/#{name}/#{tier}"
|
38
|
+
|
39
|
+
moveset = Moveset.new
|
40
|
+
smogon = Nokogiri::HTML(open(url))
|
41
|
+
rescue
|
42
|
+
return nil
|
43
|
+
end
|
44
|
+
|
45
|
+
moveset.pokemon = smogon.xpath('//td[@class="header"]/h1').last.text
|
46
|
+
moveset.name = smogon.xpath('//td[@class="name"]/h2').first.text
|
47
|
+
moveset.tier = smogon.xpath('//table[@class="info"]/tr/td/a').last.text
|
48
|
+
|
49
|
+
section = smogon.xpath('//table[@class="info strategyheader"]/tr')[1].children
|
50
|
+
moveset.item = section[2].text.gsub(/\n/m, '').gsub(/\t/m, '').strip
|
51
|
+
moveset.ability = section[4].text.gsub(/\n/m, '').gsub(/\t/m, '').strip
|
52
|
+
moveset.nature = section[6].text.gsub(/\n/m, '').gsub(/\t/m, '').strip
|
53
|
+
|
54
|
+
section = smogon.xpath('//table[@class="info moveset"]/tr')[1].children
|
55
|
+
moveset.moves = section[0].text.strip.gsub(/\n/, '').gsub(/~/, ',').gsub(/\s\s/, '')[2..-1]
|
56
|
+
moveset.evs = section[2].text.strip
|
57
|
+
|
58
|
+
return moveset
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
+
#
|
4
|
+
# This file is part of Botémon.
|
5
|
+
#
|
6
|
+
# Botémon is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# Botémon is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with Botémon. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
|
20
|
+
class Moveset
|
21
|
+
attr_accessor :pokemon, :name, :tier, :item, :ability, :nature, :moves, :evs
|
22
|
+
|
23
|
+
def to_s
|
24
|
+
"Name: #{pokemon}\nSet: #{name}\nTier: #{tier}\nItem: #{item}\nAbility: #{ability}\nNature: #{nature}\nMoves: #{moves}\nEVs: #{evs}"
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
+
#
|
4
|
+
# This file is part of Botémon.
|
5
|
+
#
|
6
|
+
# Botémon is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# Botémon is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with Botémon. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
|
20
|
+
class Pokedex
|
21
|
+
def self.id2name(id)
|
22
|
+
begin
|
23
|
+
return Nokogiri::HTML(open("http://pokemondb.net/pokedex/#{id}")).xpath('//div[@class="navbar"]/h1')[0].text
|
24
|
+
rescue
|
25
|
+
return nil
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.get(name, storage)
|
30
|
+
return nil if name == nil
|
31
|
+
return storage.get(name) if storage.is_cached? name
|
32
|
+
|
33
|
+
begin
|
34
|
+
url = URI::encode "http://www.smogon.com/bw/pokemon/#{name}"
|
35
|
+
|
36
|
+
pokemon = Pokemon.new
|
37
|
+
smogon = Nokogiri::HTML(open(url))
|
38
|
+
rescue
|
39
|
+
return nil
|
40
|
+
end
|
41
|
+
|
42
|
+
pokemon.name = smogon.xpath('//td[@class="header"]/h1').last.text
|
43
|
+
pokemon._name = pokemon.name.downcase
|
44
|
+
|
45
|
+
smogon.xpath('//table[@class="info"]/tr/td/a')[0..-2].each { |type|
|
46
|
+
(pokemon.types ||= []) << type.text
|
47
|
+
}
|
48
|
+
|
49
|
+
pokemon.tier = smogon.xpath('//table[@class="info"]/tr/td/a').last.text
|
50
|
+
|
51
|
+
smogon.xpath('//td[@class="ability"]/dl/dt/a').each { |ability|
|
52
|
+
(pokemon.abilities ||= []) << ability.text
|
53
|
+
}
|
54
|
+
|
55
|
+
begin
|
56
|
+
(pokemon.abilities ||= []) << smogon.xpath('//td[@class="ability"]/dl/dt/em/a').first.text
|
57
|
+
rescue
|
58
|
+
# No dream world ability :(
|
59
|
+
end
|
60
|
+
|
61
|
+
smogon.xpath('//td[@class="bar"]').each { |base_stat|
|
62
|
+
(pokemon.base_stats ||= []) << base_stat.text.strip
|
63
|
+
}
|
64
|
+
|
65
|
+
storage.add pokemon
|
66
|
+
storage.save
|
67
|
+
return pokemon
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
+
#
|
4
|
+
# This file is part of Botémon.
|
5
|
+
#
|
6
|
+
# Botémon is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# Botémon is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with Botémon. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
|
20
|
+
class Pokemon
|
21
|
+
attr_accessor :name, :_name, :types, :tier, :abilities, :base_stats
|
22
|
+
|
23
|
+
def to_s
|
24
|
+
"Name: #{name}\nAbility: #{abilities.join(', ')}\nType: #{types.join(?/)}\nTier: #{tier}\nBase stats: #{base_stats.join(?/)}"
|
25
|
+
end
|
26
|
+
|
27
|
+
def clues
|
28
|
+
"Ability: #{abilities.join(', ')}\nType: #{types.join(?/)}\nTier: #{tier}\nBase stats: #{base_stats.join(?/)}"
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.to_pokemon(ary)
|
32
|
+
pokemon = Pokemon.new
|
33
|
+
pokemon.name = ary['name']
|
34
|
+
pokemon._name = ary['_name']
|
35
|
+
pokemon.types = ary['types']
|
36
|
+
pokemon.tier = ary['tier']
|
37
|
+
pokemon.abilities = ary['abilities']
|
38
|
+
pokemon.base_stats = ary['base_stats']
|
39
|
+
return pokemon
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_ary
|
43
|
+
{ 'name' => name,
|
44
|
+
'_name' => _name,
|
45
|
+
'types' => types,
|
46
|
+
'tier' => tier,
|
47
|
+
'abilities' => abilities,
|
48
|
+
'base_stats' => base_stats
|
49
|
+
}
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
+
#
|
4
|
+
# This file is part of Botémon.
|
5
|
+
#
|
6
|
+
# Botémon is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# Botémon is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with Botémon. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
|
20
|
+
class Storage
|
21
|
+
attr_accessor :file, :db
|
22
|
+
|
23
|
+
def initialize(file)
|
24
|
+
@file = file
|
25
|
+
db = File.exists?(file) ? JSON.load(File.read(file)) : []
|
26
|
+
@db = [].tap { |d|
|
27
|
+
db.each { |p| d << Pokemon.to_pokemon(p) }
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
def is_cached?(name)
|
32
|
+
return @db.select { |p| p._name == name.downcase }.any?
|
33
|
+
end
|
34
|
+
|
35
|
+
def get(name)
|
36
|
+
return @db.select { |p| p._name == name.downcase }.first
|
37
|
+
end
|
38
|
+
|
39
|
+
def get_all
|
40
|
+
@db
|
41
|
+
end
|
42
|
+
alias :dump :get_all
|
43
|
+
|
44
|
+
def add(pokemon)
|
45
|
+
@db << pokemon
|
46
|
+
end
|
47
|
+
alias :put :add
|
48
|
+
|
49
|
+
def save
|
50
|
+
db_ary = [].tap { |ary|
|
51
|
+
@db.each { |p| ary << p.to_ary }
|
52
|
+
}
|
53
|
+
|
54
|
+
File.open(@file, 'wb') { |f|
|
55
|
+
f.write JSON.dump(db_ary)
|
56
|
+
}
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
+
#
|
4
|
+
# This file is part of Botémon.
|
5
|
+
#
|
6
|
+
# Botémon is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# Botémon is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with Botémon. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
|
20
|
+
class String
|
21
|
+
def numeric?
|
22
|
+
self.to_i.to_s == self || self.to_f.to_s == self
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
#--
|
3
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
4
|
+
#
|
5
|
+
# This file is part of BOTémon.
|
6
|
+
#
|
7
|
+
# BOTémon is free software: you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU General Public License as published by
|
9
|
+
# the Free Software Foundation, either version 3 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# BOTémon is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU General Public License
|
18
|
+
# along with BOTémon. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
#++
|
20
|
+
|
21
|
+
module Botemon
|
22
|
+
def self.version
|
23
|
+
'0.2.3'
|
24
|
+
end
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: botemon
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Giovanni Capuano
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-07-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cinch
|
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
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: cinch-login
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: nokogiri
|
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'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sanitize
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: IRC bot which implements a Pokédex and a simple trivia game.
|
70
|
+
email: webmaster@giovannicapuano.net
|
71
|
+
executables:
|
72
|
+
- botemon
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- lib/botemon/movedex.rb
|
77
|
+
- lib/botemon/moveset.rb
|
78
|
+
- lib/botemon/pokedex.rb
|
79
|
+
- lib/botemon/pokemon.rb
|
80
|
+
- lib/botemon/storage.rb
|
81
|
+
- lib/botemon/string.rb
|
82
|
+
- lib/botemon/version.rb
|
83
|
+
- lib/botemon.rb
|
84
|
+
- bin/botemon
|
85
|
+
homepage: http://www.giovannicapuano.net
|
86
|
+
licenses: []
|
87
|
+
metadata: {}
|
88
|
+
post_install_message:
|
89
|
+
rdoc_options: []
|
90
|
+
require_paths:
|
91
|
+
- lib
|
92
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
requirements: []
|
103
|
+
rubyforge_project:
|
104
|
+
rubygems_version: 2.0.4
|
105
|
+
signing_key:
|
106
|
+
specification_version: 4
|
107
|
+
summary: IRC bot for pokéfag.
|
108
|
+
test_files: []
|