openra-irc_bot 0.1.0
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 +7 -0
- data/.gitignore +31 -0
- data/Gemfile +3 -0
- data/LICENSE +21 -0
- data/README.md +25 -0
- data/Rakefile +1 -0
- data/VERSION +1 -0
- data/config/dictionaries/point_one.yml +14 -0
- data/lib/openra/irc_bot/dictionary.rb +15 -0
- data/lib/openra/irc_bot/plugins/point_one.rb +25 -0
- data/lib/openra/irc_bot/plugins.rb +1 -0
- data/lib/openra/irc_bot/version.rb +5 -0
- data/lib/openra/irc_bot.rb +29 -0
- data/lib/openra-irc_bot.rb +1 -0
- data/openra-irc_bot.gemspec +23 -0
- metadata +128 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 55a6487c9b20a65529656aa0bc1adceec41ee6bad07e17303f4facc68e01ad1b
|
4
|
+
data.tar.gz: 29bfc9fc1dd67faf99f99571c4dc07e6f999765038961debc13b63d300696d22
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d589a5706586ef19f2ba4bb676a92d7b8dfbe2f0408f8f77058581a35362ab6a81b10a1ed5f3a45a028c222a3b40e0c5568938041e2c52fad2c3b93824db4683
|
7
|
+
data.tar.gz: c312c09d411e7c216458d7dc6e03f41ad468423de4e044f89ca8f953b7220c5b340b468eb29c55f14d0734436fbf86b5c09bf26c367a5a58fde938e2127f9932
|
data/.gitignore
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
11
|
+
/tmp/
|
12
|
+
|
13
|
+
## Documentation cache and generated files:
|
14
|
+
/.yardoc/
|
15
|
+
/_yardoc/
|
16
|
+
/doc/
|
17
|
+
/rdoc/
|
18
|
+
|
19
|
+
## Environment normalization:
|
20
|
+
/.bundle/
|
21
|
+
/vendor/bundle
|
22
|
+
/lib/bundler/man/
|
23
|
+
|
24
|
+
# for a library or gem, you might want to ignore these files since the code is
|
25
|
+
# intended to run in multiple environments; otherwise, check them in:
|
26
|
+
Gemfile.lock
|
27
|
+
.ruby-version
|
28
|
+
.ruby-gemset
|
29
|
+
|
30
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
31
|
+
.rvmrc
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2018 OpenRA Community
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# OpenRA IRC Bot
|
2
|
+
|
3
|
+
IRC bot for OpenRA, supported commands:
|
4
|
+
|
5
|
+
* `!.1` => Generate a random excuse - `Openra::IRCBot::Plugins::PointOne`
|
6
|
+
|
7
|
+
Example usage:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
require 'openra-irc_bot'
|
11
|
+
|
12
|
+
bot = Openra::IRCBot.new do
|
13
|
+
configure do |config|
|
14
|
+
config.nick = 'oratest-bot'
|
15
|
+
# config.password = 'mypass'
|
16
|
+
config.server = 'irc.freenode.org'
|
17
|
+
config.channels = ['#oratest']
|
18
|
+
config.plugins.plugins = [
|
19
|
+
Openra::IRCBot::Plugins::PointOne
|
20
|
+
]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
bot.start
|
25
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Openra
|
2
|
+
class IRCBot < Cinch::Bot
|
3
|
+
module Plugins
|
4
|
+
class PointOne
|
5
|
+
include Cinch::Plugin
|
6
|
+
|
7
|
+
match '.1'
|
8
|
+
|
9
|
+
def execute(m)
|
10
|
+
m.reply "Gotta go, my #{nouns.sample} is #{verbs.sample}"
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def nouns
|
16
|
+
@nouns ||= Openra::IRCBot.dict('point_one.nouns')
|
17
|
+
end
|
18
|
+
|
19
|
+
def verbs
|
20
|
+
@verbs ||= Openra::IRCBot.dict('point_one.verbs')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'openra/irc_bot/plugins/point_one'
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'i18n'
|
2
|
+
require 'cinch'
|
3
|
+
require 'openra/irc_bot/dictionary'
|
4
|
+
require 'openra/irc_bot/plugins'
|
5
|
+
|
6
|
+
module Openra
|
7
|
+
class IRCBot < Cinch::Bot
|
8
|
+
def self.load!
|
9
|
+
return false if defined?(@loaded)
|
10
|
+
|
11
|
+
Dictionary.add_path(
|
12
|
+
File.expand_path('config/dictionaries')
|
13
|
+
)
|
14
|
+
|
15
|
+
@loaded = true
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.dict(key, **options)
|
19
|
+
Dictionary.(key, **options)
|
20
|
+
end
|
21
|
+
|
22
|
+
def initialize(*)
|
23
|
+
self.class.load!
|
24
|
+
|
25
|
+
super
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'openra/irc_bot'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = 'openra-irc_bot'
|
5
|
+
spec.version = File.read('VERSION').strip.freeze
|
6
|
+
spec.authors = ['OpenRA Community']
|
7
|
+
spec.email = ['openra.community@gmail.com']
|
8
|
+
spec.summary = 'Openra IRC Bot'
|
9
|
+
spec.homepage = 'https://github.com/openra-community/openra-irc_bot'
|
10
|
+
spec.license = 'MIT'
|
11
|
+
|
12
|
+
spec.files = `git ls-files -z`.split("\x0") - ['bin/console']
|
13
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
14
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
15
|
+
spec.require_paths = ['lib']
|
16
|
+
|
17
|
+
spec.add_dependency 'bundler'
|
18
|
+
spec.add_dependency 'i18n'
|
19
|
+
spec.add_dependency 'cinch'
|
20
|
+
|
21
|
+
spec.add_development_dependency 'rake'
|
22
|
+
spec.add_development_dependency 'pry'
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: openra-irc_bot
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- OpenRA Community
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-10-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
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: i18n
|
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: cinch
|
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: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description:
|
84
|
+
email:
|
85
|
+
- openra.community@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- Gemfile
|
92
|
+
- LICENSE
|
93
|
+
- README.md
|
94
|
+
- Rakefile
|
95
|
+
- VERSION
|
96
|
+
- config/dictionaries/point_one.yml
|
97
|
+
- lib/openra-irc_bot.rb
|
98
|
+
- lib/openra/irc_bot.rb
|
99
|
+
- lib/openra/irc_bot/dictionary.rb
|
100
|
+
- lib/openra/irc_bot/plugins.rb
|
101
|
+
- lib/openra/irc_bot/plugins/point_one.rb
|
102
|
+
- lib/openra/irc_bot/version.rb
|
103
|
+
- openra-irc_bot.gemspec
|
104
|
+
homepage: https://github.com/openra-community/openra-irc_bot
|
105
|
+
licenses:
|
106
|
+
- MIT
|
107
|
+
metadata: {}
|
108
|
+
post_install_message:
|
109
|
+
rdoc_options: []
|
110
|
+
require_paths:
|
111
|
+
- lib
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
requirements: []
|
123
|
+
rubyforge_project:
|
124
|
+
rubygems_version: 2.7.3
|
125
|
+
signing_key:
|
126
|
+
specification_version: 4
|
127
|
+
summary: Openra IRC Bot
|
128
|
+
test_files: []
|