cinch-rename 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.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Victor Bergöö
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ # cinch-rename
2
+
3
+ A plugin for renaming Cinch IRC-bots.
4
+
5
+ ## Usage
6
+
7
+ require 'cinch'
8
+ require 'cinch/plugins/rename'
9
+
10
+ bot = Cinch::Bot.new do
11
+ configure do |c|
12
+ c.server = "irc.freenode.org"
13
+ c.channels = ["#apanigatan"]
14
+ c.plugins.plugins = [Cinch::Plugins::Rename]
15
+ c.plugins.options = {
16
+ Cinch::Plugins::Rename => {
17
+ "admin" => [
18
+ "SomeUser",
19
+ ]
20
+ }
21
+ }
22
+ end
23
+ end
24
+
25
+ bot.start
26
+
27
+ ## Options
28
+
29
+ admin is an optional config variable that takes a list of user nicks that can change the bots name.
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,23 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "cinch-rename"
3
+ s.version = File.new("VERSION", 'r').read.chomp
4
+ s.authors = ["Victor Bergoo"]
5
+ s.summary = "A plugin to rename a Cinch IRC-bot"
6
+ s.description = "A plugin to easily rename a cinch IRC-bot so that either everyone or an admin can do it."
7
+ s.email = "victor.bergoo@gmail.com"
8
+ s.extra_rdoc_files = [
9
+ "LICENSE",
10
+ "README.md"
11
+ ]
12
+ s.files = [
13
+ "LICENSE",
14
+ "README.md",
15
+ "VERSION",
16
+ "cinch-rename.gemspec",
17
+ "lib/cinch/plugins/rename.rb"
18
+ ]
19
+ s.homepage = "http://github.com/netfeed/cinch-rename"
20
+ s.require_paths = ["lib"]
21
+
22
+ s.add_runtime_dependency(%q<cinch>, [">= 2.0.1"])
23
+ end
@@ -0,0 +1,27 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright (c) 2013 Victor Bergoo
3
+ # This program is made available under the terms of the MIT License.
4
+
5
+ require 'cinch'
6
+
7
+ module Cinch
8
+ module Plugins
9
+ class Rename
10
+ include Cinch::Plugin
11
+
12
+ match /rename\s+([a-zA-Z0-9]+)/
13
+
14
+ def execute m, nick
15
+ if config.key? "admin" and not config["admin"].include? m.user.nick
16
+ return
17
+ end
18
+
19
+ return if @bot.nick == nick
20
+
21
+ @bot.nick = nick
22
+ end
23
+ end
24
+ end
25
+ end
26
+
27
+
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cinch-rename
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Victor Bergoo
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-04-01 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: cinch
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 2.0.1
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: 2.0.1
30
+ description: A plugin to easily rename a cinch IRC-bot so that either everyone or
31
+ an admin can do it.
32
+ email: victor.bergoo@gmail.com
33
+ executables: []
34
+ extensions: []
35
+ extra_rdoc_files:
36
+ - LICENSE
37
+ - README.md
38
+ files:
39
+ - LICENSE
40
+ - README.md
41
+ - VERSION
42
+ - cinch-rename.gemspec
43
+ - lib/cinch/plugins/rename.rb
44
+ homepage: http://github.com/netfeed/cinch-rename
45
+ licenses: []
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubyforge_project:
64
+ rubygems_version: 1.8.23
65
+ signing_key:
66
+ specification_version: 3
67
+ summary: A plugin to rename a Cinch IRC-bot
68
+ test_files: []