mw-irc 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mw-irc.rb +22 -0
- metadata +61 -0
data/lib/mw-irc.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
libdir = File.dirname(__FILE__)
|
2
|
+
require 'socket'
|
3
|
+
|
4
|
+
module MWIRC
|
5
|
+
class Bot
|
6
|
+
def initialize(opts={})
|
7
|
+
raise 'host and port must be specified' if opts[:port].nil? || opts[:host].nil?
|
8
|
+
@host = opts[:host]
|
9
|
+
@port = opts[:port]
|
10
|
+
end
|
11
|
+
|
12
|
+
def send(text)
|
13
|
+
raise 'no host or port were specified' if @host.nil? || @port.nil?
|
14
|
+
MWIRC::Bot.send(text, @host, @port)
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.send(text, host, port)
|
18
|
+
@sock = UDPSocket.open if @sock.nil?
|
19
|
+
@sock.send text, 0, host, port
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mw-irc
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Aaron Parecki
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-04-08 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: socket
|
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
|
+
description: A simple client for sending text to a MediaWiki RecentChanges IRC bot
|
31
|
+
email: aaron@parecki.com
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- lib/mw-irc.rb
|
37
|
+
homepage: https://github.com/aaronpk/mw-irc-ruby
|
38
|
+
licenses: []
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
requirements: []
|
56
|
+
rubyforge_project:
|
57
|
+
rubygems_version: 1.8.21
|
58
|
+
signing_key:
|
59
|
+
specification_version: 3
|
60
|
+
summary: A simple client for sending text to a MediaWiki RecentChanges IRC bot
|
61
|
+
test_files: []
|