meimei 0.1.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +20 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +40 -9
- data/VERSION +1 -0
- data/cron.sh +8 -0
- data/lib/meimei/client.rb +18 -8
- data/lib/meimei.rb +0 -25
- data/plugins/an2.rb +5 -0
- data/plugins/ann.rb +47 -0
- data/plugins/autoping.rb +5 -0
- data/plugins/cco.rb +4 -0
- data/plugins/choose.rb +13 -0
- data/plugins/courage.rb +7 -0
- data/plugins/dan.rb +13 -0
- data/plugins/dg.rb +25 -0
- data/plugins/dwiki.rb +6 -0
- data/plugins/eta.rb +43 -0
- data/plugins/g.rb +30 -0
- data/plugins/gc.rb +34 -0
- data/plugins/godfinger.rb +9 -0
- data/plugins/hammerhell.rb +7 -0
- data/plugins/hanase.rb +14 -0
- data/plugins/hellheaven.rb +6 -0
- data/plugins/help.rb +7 -0
- data/plugins/jtime.rb +9 -0
- data/plugins/nai_ja_nai.rb +4 -0
- data/plugins/note.rb +10 -0
- data/plugins/ranking.rb +422 -0
- data/plugins/reload.rb +3 -0
- data/plugins/retard.rb +4 -0
- data/plugins/rs.rb +8 -0
- data/plugins/shiningfinger.rb +9 -0
- data/plugins/shuffle.rb +3 -0
- data/plugins/sugei_inaka.rb +4 -0
- data/plugins/suki_dakara.rb +4 -0
- data/plugins/ts.rb +25 -0
- data/plugins/tsundere.rb +5 -0
- data/plugins/tt.rb +50 -0
- data/plugins/ttt.rb +5 -0
- data/plugins/uptime.rb +20 -0
- data/plugins/wawawa.rb +5 -0
- data/plugins/weather.rb +39 -0
- data/test/helper.rb +18 -0
- data/test/test_meimei.rb +7 -0
- metadata +139 -56
- data/CHANGES +0 -10
- data/LICENSE +0 -31
- data/README +0 -30
- data/lib/meimei/gemspec.rb +0 -45
- data/lib/meimei/specification.rb +0 -128
- data/lib/meimei/version.rb +0 -18
metadata
CHANGED
@@ -1,66 +1,149 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.2
|
3
|
-
specification_version: 1
|
1
|
+
--- !ruby/object:Gem::Specification
|
4
2
|
name: meimei
|
5
|
-
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
-
|
11
|
-
email: r888888888@gmail.com
|
12
|
-
homepage: http://meimei.rubyforge.org/
|
13
|
-
rubyforge_project: meimei
|
14
|
-
description: Meimei is a simple IRC bot framework. It is designed to be easily extensible. In the interest of simplicity it only implements a subset RFC 1459, mainly those dealing with PRIVMSGs.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- r888888888
|
15
9
|
autorequire:
|
16
|
-
default_executable:
|
17
10
|
bindir: bin
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-03-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: jeweler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rdoc
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: If all you need is a simple infobot and don't need a full RFC1459 implementation.
|
63
|
+
email: r888888888@gmail.com
|
64
|
+
executables: []
|
65
|
+
extensions: []
|
66
|
+
extra_rdoc_files:
|
67
|
+
- LICENSE.txt
|
68
|
+
- README.rdoc
|
69
|
+
files:
|
70
|
+
- .document
|
71
|
+
- Gemfile
|
72
|
+
- Gemfile.lock
|
73
|
+
- LICENSE.txt
|
74
|
+
- README.rdoc
|
34
75
|
- Rakefile
|
35
|
-
-
|
76
|
+
- VERSION
|
77
|
+
- cron.sh
|
78
|
+
- lib/meimei.rb
|
36
79
|
- lib/meimei/array_extensions.rb
|
37
80
|
- lib/meimei/client.rb
|
38
81
|
- lib/meimei/exception_dump.rb
|
39
|
-
- lib/meimei/gemspec.rb
|
40
82
|
- lib/meimei/persistent_hash.rb
|
41
83
|
- lib/meimei/server.rb
|
42
|
-
-
|
43
|
-
-
|
44
|
-
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
-
|
49
|
-
-
|
50
|
-
-
|
51
|
-
-
|
52
|
-
-
|
53
|
-
-
|
54
|
-
|
55
|
-
-
|
56
|
-
-
|
57
|
-
-
|
58
|
-
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
84
|
+
- plugins/an2.rb
|
85
|
+
- plugins/ann.rb
|
86
|
+
- plugins/autoping.rb
|
87
|
+
- plugins/cco.rb
|
88
|
+
- plugins/choose.rb
|
89
|
+
- plugins/courage.rb
|
90
|
+
- plugins/dan.rb
|
91
|
+
- plugins/dg.rb
|
92
|
+
- plugins/dwiki.rb
|
93
|
+
- plugins/eta.rb
|
94
|
+
- plugins/g.rb
|
95
|
+
- plugins/gc.rb
|
96
|
+
- plugins/godfinger.rb
|
97
|
+
- plugins/hammerhell.rb
|
98
|
+
- plugins/hanase.rb
|
99
|
+
- plugins/hellheaven.rb
|
100
|
+
- plugins/help.rb
|
101
|
+
- plugins/jtime.rb
|
102
|
+
- plugins/nai_ja_nai.rb
|
103
|
+
- plugins/note.rb
|
104
|
+
- plugins/ranking.rb
|
105
|
+
- plugins/reload.rb
|
106
|
+
- plugins/retard.rb
|
107
|
+
- plugins/rs.rb
|
108
|
+
- plugins/shiningfinger.rb
|
109
|
+
- plugins/shuffle.rb
|
110
|
+
- plugins/sugei_inaka.rb
|
111
|
+
- plugins/suki_dakara.rb
|
112
|
+
- plugins/ts.rb
|
113
|
+
- plugins/tsundere.rb
|
114
|
+
- plugins/tt.rb
|
115
|
+
- plugins/ttt.rb
|
116
|
+
- plugins/uptime.rb
|
117
|
+
- plugins/wawawa.rb
|
118
|
+
- plugins/weather.rb
|
119
|
+
- test/helper.rb
|
120
|
+
- test/test_meimei.rb
|
121
|
+
homepage: http://github.com/r888888888/meimei
|
122
|
+
licenses:
|
123
|
+
- MIT
|
124
|
+
post_install_message:
|
125
|
+
rdoc_options: []
|
126
|
+
require_paths:
|
127
|
+
- lib
|
128
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
segments:
|
135
|
+
- 0
|
136
|
+
hash: 702120049542420905
|
137
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
63
143
|
requirements: []
|
64
|
-
|
65
|
-
|
66
|
-
|
144
|
+
rubyforge_project:
|
145
|
+
rubygems_version: 1.8.23
|
146
|
+
signing_key:
|
147
|
+
specification_version: 3
|
148
|
+
summary: Minimalistic IRC bot framework
|
149
|
+
test_files: []
|
data/CHANGES
DELETED
data/LICENSE
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
Copyright (c) 2008, Albert Yi
|
2
|
-
|
3
|
-
All rights reserved.
|
4
|
-
|
5
|
-
Redistribution and use in source and binary forms, with or without
|
6
|
-
modification, are permitted provided that the following conditions are met:
|
7
|
-
|
8
|
-
* Redistributions of source code must retain the above copyright notice,
|
9
|
-
this list of conditions and the following disclaimer.
|
10
|
-
|
11
|
-
* Redistributions in binary form must reproduce the above copyright notice,
|
12
|
-
this list of conditions and the following disclaimer in the
|
13
|
-
documentation and/or other materials provided with the
|
14
|
-
distribution.
|
15
|
-
|
16
|
-
* Neither the name of Albert Yi nor the
|
17
|
-
names of its contributors may be used to endorse or promote
|
18
|
-
products derived from this software without specific prior written
|
19
|
-
permission.
|
20
|
-
|
21
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
22
|
-
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
23
|
-
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
24
|
-
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
25
|
-
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
26
|
-
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
27
|
-
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
28
|
-
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
29
|
-
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
30
|
-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
31
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
= meimei
|
2
|
-
|
3
|
-
== DESCRIPTION
|
4
|
-
Meimei is a simple IRC bot framework. It is designed to be easily extensible. In the interest of simplicity it only implements a subset RFC 1459, mainly those dealing with PRIVMSGs.
|
5
|
-
|
6
|
-
See the documentation for Meimei::Client for help on creating new client instances.
|
7
|
-
|
8
|
-
=== Usage
|
9
|
-
|
10
|
-
require 'meimei'
|
11
|
-
client = Meimei::Client.new("meimei")
|
12
|
-
client.add_server("irc.synirc.net", 6667, "#meimei, #bonklers")
|
13
|
-
client.start()
|
14
|
-
|
15
|
-
=== Plugins
|
16
|
-
|
17
|
-
# In plugins/reload.rb
|
18
|
-
define_plugin("!reload") do |msg|
|
19
|
-
load_plugins()
|
20
|
-
reply("Plugins reloaded.")
|
21
|
-
end
|
22
|
-
|
23
|
-
# In plugins/clock.rb
|
24
|
-
define_plugin("@1h") do
|
25
|
-
say("localhost", "#meimei", "One hour has passed.")
|
26
|
-
end
|
27
|
-
|
28
|
-
=== Architecture
|
29
|
-
|
30
|
-
Meimei uses a single select loop to handle multiple TCP sockets. This eliminates the need to use threads and all the synchronicity issues that result. However, Meimei does not use any global or class variables, so it should be thread-safe.
|
data/lib/meimei/gemspec.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'meimei/specification'
|
3
|
-
require 'meimei/version'
|
4
|
-
require 'rake'
|
5
|
-
|
6
|
-
# The Gem Specification plus some extras for meimei.
|
7
|
-
module Meimei
|
8
|
-
SPEC = Meimei::Specification.new do |spec|
|
9
|
-
spec.name = "meimei"
|
10
|
-
spec.version = Meimei::VERSION
|
11
|
-
spec.rubyforge_project = "meimei"
|
12
|
-
spec.author = "Albert Yi"
|
13
|
-
spec.email = "r888888888@gmail.com"
|
14
|
-
spec.homepage = "http://meimei.rubyforge.org/"
|
15
|
-
|
16
|
-
spec.summary = "A simple IRC bot framework."
|
17
|
-
spec.description = <<-DESC
|
18
|
-
Meimei is a simple IRC bot framework. It is designed to be easily extensible. In the interest of simplicity it only implements a subset RFC 1459, mainly those dealing with PRIVMSGs.
|
19
|
-
DESC
|
20
|
-
|
21
|
-
spec.extra_rdoc_files = FileList["[A-Z]*"]
|
22
|
-
spec.has_rdoc = true
|
23
|
-
spec.rdoc_main = "README"
|
24
|
-
spec.rdoc_options = [ "--line-numbers" , "--inline-source" ]
|
25
|
-
|
26
|
-
spec.test_files = FileList["spec/**/*.rb", "test/**/*.rb"]
|
27
|
-
spec.files = spec.test_files + spec.extra_rdoc_files +
|
28
|
-
FileList["lib/**/*.rb", "resources/**/*"]
|
29
|
-
|
30
|
-
|
31
|
-
# add dependencies
|
32
|
-
# spec.add_dependency("somegem", ">= 0.4.2")
|
33
|
-
|
34
|
-
spec.platform = Gem::Platform::RUBY
|
35
|
-
|
36
|
-
spec.local_rdoc_dir = "doc/rdoc"
|
37
|
-
spec.remote_rdoc_dir = "rdoc"
|
38
|
-
spec.local_coverage_dir = "doc/coverage"
|
39
|
-
spec.remote_coverage_dir= "coverage"
|
40
|
-
|
41
|
-
spec.remote_site_dir = "/"
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
|
data/lib/meimei/specification.rb
DELETED
@@ -1,128 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rubygems/specification'
|
3
|
-
require 'rake'
|
4
|
-
|
5
|
-
module Meimei
|
6
|
-
# Add some additional items to Gem::Specification
|
7
|
-
# A Meimei::Specification adds additional pieces of information the
|
8
|
-
# typical gem specification
|
9
|
-
class Specification
|
10
|
-
|
11
|
-
RUBYFORGE_ROOT = "/var/www/gforge-projects/"
|
12
|
-
|
13
|
-
# user that accesses remote site
|
14
|
-
attr_accessor :remote_user
|
15
|
-
|
16
|
-
# remote host, default 'rubyforge.org'
|
17
|
-
attr_accessor :remote_host
|
18
|
-
|
19
|
-
# name the rdoc main
|
20
|
-
attr_accessor :rdoc_main
|
21
|
-
|
22
|
-
# local directory in development holding the generated rdoc
|
23
|
-
# default 'doc'
|
24
|
-
attr_accessor :local_rdoc_dir
|
25
|
-
|
26
|
-
# remote directory for storing rdoc, default 'doc'
|
27
|
-
attr_accessor :remote_rdoc_dir
|
28
|
-
|
29
|
-
# local directory for coverage report
|
30
|
-
attr_accessor :local_coverage_dir
|
31
|
-
|
32
|
-
# remote directory for storing coverage reports
|
33
|
-
# This defaults to 'coverage'
|
34
|
-
attr_accessor :remote_coverage_dir
|
35
|
-
|
36
|
-
# local directory for generated website, default +site/public+
|
37
|
-
attr_accessor :local_site_dir
|
38
|
-
|
39
|
-
# remote directory relative to +remote_root+ for the website.
|
40
|
-
# website.
|
41
|
-
attr_accessor :remote_site_dir
|
42
|
-
|
43
|
-
# is a .tgz to be created?, default 'true'
|
44
|
-
attr_accessor :need_tar
|
45
|
-
|
46
|
-
# is a .zip to be created, default 'true'
|
47
|
-
attr_accessor :need_zip
|
48
|
-
|
49
|
-
|
50
|
-
def initialize
|
51
|
-
@remote_user = "r888888888"
|
52
|
-
@remote_host = "rubyforge.org"
|
53
|
-
|
54
|
-
@rdoc_main = "README"
|
55
|
-
@local_rdoc_dir = "doc"
|
56
|
-
@remote_rdoc_dir = "doc"
|
57
|
-
@local_coverage_dir = "coverage"
|
58
|
-
@remote_coverage_dir = "coverage"
|
59
|
-
@local_site_dir = "site/public"
|
60
|
-
@remote_site_dir = "."
|
61
|
-
|
62
|
-
@need_tar = true
|
63
|
-
@need_zip = true
|
64
|
-
|
65
|
-
@spec = Gem::Specification.new
|
66
|
-
|
67
|
-
yield self if block_given?
|
68
|
-
|
69
|
-
# update rdoc options to take care of the rdoc_main if it is
|
70
|
-
# there, and add a default title if one is not given
|
71
|
-
if not @spec.rdoc_options.include?("--main") then
|
72
|
-
@spec.rdoc_options.concat(["--main", rdoc_main])
|
73
|
-
end
|
74
|
-
|
75
|
-
if not @spec.rdoc_options.include?("--title") then
|
76
|
-
@spec.rdoc_options.concat(["--title","'#{name} -- #{summary}'"])
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
# if this gets set then it overwrites what would be the
|
81
|
-
# rubyforge default. If rubyforge project is not set then use
|
82
|
-
# name. If rubyforge project and name are set, but they are
|
83
|
-
# different then assume that name is a subproject of the
|
84
|
-
# rubyforge project
|
85
|
-
def remote_root
|
86
|
-
if rubyforge_project.nil? or
|
87
|
-
rubyforge_project == name then
|
88
|
-
return RUBYFORGE_ROOT + "#{name}/"
|
89
|
-
else
|
90
|
-
return RUBYFORGE_ROOT + "#{rubyforge_project}/#{name}/"
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
# rdoc files is the same as what would be generated during gem
|
95
|
-
# installation. That is, everything in the require paths plus
|
96
|
-
# the rdoc_extra_files
|
97
|
-
#
|
98
|
-
def rdoc_files
|
99
|
-
flist = extra_rdoc_files.dup
|
100
|
-
@spec.require_paths.each do |rp|
|
101
|
-
flist << FileList["#{rp}/**/*.rb"]
|
102
|
-
end
|
103
|
-
flist.flatten.uniq
|
104
|
-
end
|
105
|
-
|
106
|
-
# calculate the remote directories
|
107
|
-
def remote_root_location
|
108
|
-
"#{remote_user}@#{remote_host}:#{remote_root}"
|
109
|
-
end
|
110
|
-
|
111
|
-
def remote_rdoc_location
|
112
|
-
remote_root_location + @remote_rdoc_dir
|
113
|
-
end
|
114
|
-
|
115
|
-
def remote_coverage_location
|
116
|
-
remote_root_loation + @remote_coverage_dir
|
117
|
-
end
|
118
|
-
|
119
|
-
def remote_site_location
|
120
|
-
remote_root_location + @remote_site_dir
|
121
|
-
end
|
122
|
-
|
123
|
-
# we delegate any other calls to spec
|
124
|
-
def method_missing(method_id,*params,&block)
|
125
|
-
@spec.send method_id, *params, &block
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
data/lib/meimei/version.rb
DELETED