mod_spox 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +31 -1
- data/LICENSE +674 -0
- data/README.rdoc +73 -0
- data/bin/mod_spox +28 -28
- data/data/mod_spox/extras/AOLSpeak.rb +2 -3
- data/data/mod_spox/extras/AutoKick.rb +10 -23
- data/data/mod_spox/extras/AutoMode.rb +12 -23
- data/data/mod_spox/extras/Bash.rb +55 -0
- data/data/mod_spox/extras/Bouncer.rb +85 -57
- data/data/mod_spox/extras/Bullshit.rb +1 -1
- data/data/mod_spox/extras/Bytes.rb +1 -2
- data/data/mod_spox/extras/Confess.rb +27 -29
- data/data/mod_spox/extras/DCC.rb +11 -20
- data/data/mod_spox/extras/DevWatch.rb +21 -23
- data/data/mod_spox/extras/DownForEveryoneOrJustMe.rb +47 -0
- data/data/mod_spox/extras/EightBall.rb +1 -1
- data/data/mod_spox/extras/FML.rb +35 -0
- data/data/mod_spox/extras/Headers.rb +31 -50
- data/data/mod_spox/extras/Karma.rb +81 -29
- data/data/mod_spox/extras/Logger.rb +2 -2
- data/data/mod_spox/extras/LolSpeak.rb +1 -2
- data/data/mod_spox/extras/PhpCli.rb +138 -8
- data/data/mod_spox/extras/PhpFuncLookup.rb +20 -23
- data/data/mod_spox/extras/Pinger.rb +1 -1
- data/data/mod_spox/extras/Quotes.rb +8 -10
- data/data/mod_spox/extras/RegexTracker.rb +2 -4
- data/data/mod_spox/extras/Roulette.rb +20 -27
- data/data/mod_spox/extras/RubyCli.rb +93 -0
- data/data/mod_spox/extras/Search.rb +17 -3
- data/data/mod_spox/extras/Seen.rb +150 -0
- data/data/mod_spox/extras/SlashdotHeadlineGenerator.rb +500 -0
- data/data/mod_spox/extras/Talk.rb +2 -4
- data/data/mod_spox/extras/Topten.rb +10 -12
- data/data/mod_spox/extras/TracTicket.rb +3 -5
- data/data/mod_spox/extras/Translate.rb +20 -22
- data/data/mod_spox/extras/Twitter.rb +118 -33
- data/data/mod_spox/extras/UrbanDictionary.rb +8 -17
- data/data/mod_spox/extras/Weather.rb +1 -2
- data/data/mod_spox/plugins/Authenticator.rb +93 -98
- data/data/mod_spox/plugins/Banner.rb +26 -56
- data/data/mod_spox/plugins/Helper.rb +5 -6
- data/data/mod_spox/plugins/Initializer.rb +4 -14
- data/data/mod_spox/plugins/Joiner.rb +1 -1
- data/data/mod_spox/plugins/Nicker.rb +13 -0
- data/data/mod_spox/plugins/Parter.rb +2 -2
- data/data/mod_spox/plugins/Permissions.rb +60 -0
- data/data/mod_spox/plugins/PluginLoader.rb +7 -12
- data/data/mod_spox/plugins/Ponger.rb +51 -0
- data/data/mod_spox/plugins/Quitter.rb +1 -2
- data/data/mod_spox/plugins/Servers.rb +57 -0
- data/data/mod_spox/plugins/Status.rb +3 -2
- data/data/mod_spox/plugins/Triggers.rb +9 -9
- data/lib/mod_spox/Bot.rb +109 -33
- data/lib/mod_spox/BotConfig.rb +2 -2
- data/lib/mod_spox/ConfigurationWizard.rb +12 -12
- data/lib/mod_spox/Database.rb +1 -4
- data/lib/mod_spox/Exceptions.rb +26 -0
- data/lib/mod_spox/Helpers.rb +29 -68
- data/lib/mod_spox/Loader.rb +23 -24
- data/lib/mod_spox/Logger.rb +19 -17
- data/lib/mod_spox/MessageFactory.rb +50 -24
- data/lib/mod_spox/Pipeline.rb +21 -7
- data/lib/mod_spox/Plugin.rb +27 -3
- data/lib/mod_spox/PluginManager.rb +28 -15
- data/lib/mod_spox/PriorityQueue.rb +69 -0
- data/lib/mod_spox/Socket.rb +93 -51
- data/lib/mod_spox/Sockets.rb +76 -63
- data/lib/mod_spox/Timer.rb +21 -141
- data/lib/mod_spox/Version.rb +14 -0
- data/lib/mod_spox/handlers/BadNick.rb +1 -1
- data/lib/mod_spox/handlers/Bounce.rb +5 -5
- data/lib/mod_spox/handlers/Created.rb +13 -5
- data/lib/mod_spox/handlers/Handler.rb +12 -3
- data/lib/mod_spox/handlers/Invite.rb +14 -8
- data/lib/mod_spox/handlers/Join.rb +24 -20
- data/lib/mod_spox/handlers/Kick.rb +22 -13
- data/lib/mod_spox/handlers/Mode.rb +42 -36
- data/lib/mod_spox/handlers/Motd.rb +4 -0
- data/lib/mod_spox/handlers/Names.rb +66 -39
- data/lib/mod_spox/handlers/Nick.rb +20 -14
- data/lib/mod_spox/handlers/Part.rb +25 -8
- data/lib/mod_spox/handlers/Ping.rb +11 -5
- data/lib/mod_spox/handlers/Pong.rb +9 -5
- data/lib/mod_spox/handlers/Privmsg.rb +25 -17
- data/lib/mod_spox/handlers/Quit.rb +13 -8
- data/lib/mod_spox/handlers/Topic.rb +4 -0
- data/lib/mod_spox/handlers/Welcome.rb +16 -24
- data/lib/mod_spox/handlers/Who.rb +64 -48
- data/lib/mod_spox/handlers/Whois.rb +92 -60
- data/lib/mod_spox/messages/incoming/Nick.rb +2 -2
- data/lib/mod_spox/messages/incoming/Privmsg.rb +1 -1
- data/lib/mod_spox/messages/incoming/Whois.rb +1 -0
- data/lib/mod_spox/messages/internal/EstablishConnection.rb +1 -1
- data/lib/mod_spox/messages/internal/PluginsReady.rb +10 -0
- data/lib/mod_spox/messages/internal/QueueSocket.rb +8 -0
- data/lib/mod_spox/messages/internal/Reconnect.rb +8 -0
- data/lib/mod_spox/messages/internal/UnqueueSocket.rb +8 -0
- data/lib/mod_spox/migrations/002_persistent_sigs.rb +14 -0
- data/lib/mod_spox/migrations/003_auth_restructure.rb +31 -0
- data/lib/mod_spox/migrations/004_mode_index_fix.rb +18 -0
- data/lib/mod_spox/migrations/005_nick_mode_nopark.rb +18 -0
- data/lib/mod_spox/models/Auth.rb +16 -46
- data/lib/mod_spox/models/AuthMask.rb +13 -0
- data/lib/mod_spox/models/Channel.rb +46 -27
- data/lib/mod_spox/models/Config.rb +10 -19
- data/lib/mod_spox/models/Group.rb +20 -8
- data/lib/mod_spox/models/Models.rb +1 -1
- data/lib/mod_spox/models/Nick.rb +105 -113
- data/lib/mod_spox/models/NickMode.rb +23 -9
- data/lib/mod_spox/models/Server.rb +12 -1
- data/lib/mod_spox/models/Setting.rb +12 -16
- data/lib/mod_spox/models/Signature.rb +28 -8
- data/tests/BotHolder.rb +24 -0
- data/tests/handlers/tc_BadNick.rb +21 -0
- data/tests/handlers/tc_Created.rb +24 -0
- data/tests/handlers/tc_Invite.rb +50 -0
- data/tests/handlers/tc_Join.rb +33 -0
- data/tests/handlers/tc_Kick.rb +32 -0
- data/tests/handlers/tc_Mode.rb +85 -0
- data/tests/handlers/tc_Names.rb +35 -0
- data/tests/handlers/tc_Nick.rb +55 -0
- data/tests/handlers/tc_Part.rb +44 -0
- data/tests/handlers/tc_Ping.rb +40 -0
- data/tests/handlers/tc_Pong.rb +28 -0
- data/tests/handlers/tc_Privmsg.rb +85 -0
- data/tests/handlers/tc_Quit.rb +40 -0
- data/tests/handlers/tc_Who.rb +50 -0
- data/tests/handlers/tc_Whois.rb +61 -0
- data/tests/models/tc_Auth.rb +34 -0
- data/tests/models/tc_Channel.rb +52 -0
- data/tests/models/tc_Config.rb +19 -0
- data/tests/models/tc_Nick.rb +142 -0
- data/tests/models/tc_NickMode.rb +40 -0
- data/tests/models/tc_Setting.rb +21 -0
- data/tests/models/tc_Signature.rb +14 -0
- data/tests/run_tests.rb +4 -0
- metadata +284 -212
- data/README +0 -36
- data/lib/mod_spox/Cache.rb +0 -57
- data/lib/mod_spox/Monitors.rb +0 -84
- data/lib/mod_spox/Pool.rb +0 -164
- data/lib/mod_spox/models/AuthGroup.rb +0 -16
- data/lib/mod_spox/models/ChannelMode.rb +0 -14
- data/lib/mod_spox/models/NickChannel.rb +0 -45
- data/lib/mod_spox/models/NickGroup.rb +0 -16
@@ -11,7 +11,7 @@ module ModSpox
|
|
11
11
|
# server:: Server to connect to
|
12
12
|
# port:: Port to connect to
|
13
13
|
# password:: password to connect
|
14
|
-
def initialize(server, port, password=nil)
|
14
|
+
def initialize(server=nil, port=nil, password=nil)
|
15
15
|
@server = server
|
16
16
|
@port = port
|
17
17
|
@password = password
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Migrations
|
3
|
+
class PersistentSigs < Sequel::Migration
|
4
|
+
|
5
|
+
def up
|
6
|
+
Database.db.add_column :signatures, :enabled, :boolean, :null => false, :default => true
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
Database.db.drop_column :signatures, :enabled
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Migrations
|
3
|
+
class AuthRestructureModeFix < Sequel::Migration
|
4
|
+
|
5
|
+
def up
|
6
|
+
Database.db.drop_column :auths, :mask
|
7
|
+
Database.db.create_table(:auth_masks) do
|
8
|
+
primary_key :id, :null => false
|
9
|
+
varchar :mask, :null => false, :unique => true
|
10
|
+
end
|
11
|
+
Database.db.create_table(:auth_masks_groups) do
|
12
|
+
foreign_key :auth_mask_id, :table => :auth_masks, :null => false
|
13
|
+
foreign_key :group_id, :null => false
|
14
|
+
primary_key [:auth_mask_id, :group_id]
|
15
|
+
end
|
16
|
+
Database.db.create_table(:auth_masks_nicks) do
|
17
|
+
foreign_key :auth_mask_id, :table => :auth_masks, :null => false
|
18
|
+
foreign_key :nick_id, :null => false
|
19
|
+
primary_key [:nick_id, :auth_mask_id]
|
20
|
+
end
|
21
|
+
Database.db.drop_table :nick_groups
|
22
|
+
end
|
23
|
+
|
24
|
+
def down
|
25
|
+
Database.db.drop_table(:auth_masks_group)
|
26
|
+
Database.db.drop_table(:auth_masks_nicks)
|
27
|
+
Database.db.drop_table(:auth_masks)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Migrations
|
3
|
+
class ModeIndexFix < Sequel::Migration
|
4
|
+
|
5
|
+
def up
|
6
|
+
Database.db.drop_index :nick_modes, [:nick_id, :channel_id]
|
7
|
+
Database.db.add_index :nick_modes, [:nick_id, :channel_id], :unique => true
|
8
|
+
Database.db.drop_column :nick_modes, :mode
|
9
|
+
Database.db.add_column :nick_modes, :mode, :varchar, :null => true, :default => ''
|
10
|
+
end
|
11
|
+
|
12
|
+
def down
|
13
|
+
Database.db.drop_index :nick_modes, [:nick_id, :channel_id]
|
14
|
+
Database.db.add_index :nick_modes, [:nick_id, :channel_id]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Migrations
|
3
|
+
class NickModeNoPark < Sequel::Migration
|
4
|
+
|
5
|
+
def up
|
6
|
+
Database.db.drop_column :channels, :parked
|
7
|
+
Database.db.add_column :nicks, :mode, :varchar, :null => true, :default => ''
|
8
|
+
Database.db.drop_table :channel_modes
|
9
|
+
Database.db.add_column :channels, :mode, :varchar, :null => true, :default => ''
|
10
|
+
end
|
11
|
+
|
12
|
+
def down
|
13
|
+
Database.db.drop_column :nicks, :mode
|
14
|
+
Database.add_column :nicks, :parked, :bool, :null => false, :default => true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/mod_spox/models/Auth.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
require 'digest/sha1'
|
2
|
+
require 'mod_spox/models/Group'
|
3
|
+
require 'mod_spox/models/Nick'
|
2
4
|
module ModSpox
|
3
5
|
module Models
|
4
|
-
|
5
6
|
# Attributes provided by model:
|
6
7
|
# password:: Password to autenticate against
|
7
8
|
# services:: Authentication by nickserv
|
@@ -9,16 +10,12 @@ module ModSpox
|
|
9
10
|
# authed:: Nick has authenticated
|
10
11
|
class Auth < Sequel::Model
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
many_to_many :groups, :join_table => :auth_groups, :class => 'ModSpox::Models::Group'
|
14
|
+
many_to_one :nick, :class => 'ModSpox::Models::Nick'
|
15
|
+
|
14
16
|
# Clear relations before destroying
|
15
|
-
def
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
# Nick associated with this Auth
|
20
|
-
def nick
|
21
|
-
Nick[nick_id]
|
17
|
+
def before_destroy
|
18
|
+
remove_all_groups
|
22
19
|
end
|
23
20
|
|
24
21
|
# Is nick identified with services
|
@@ -31,42 +28,20 @@ module ModSpox
|
|
31
28
|
end
|
32
29
|
end
|
33
30
|
|
34
|
-
def authenticated(bool=true)
|
35
|
-
update_values :authed => bool
|
36
|
-
end
|
37
|
-
|
38
|
-
# Groups this auth is a member of
|
39
|
-
def groups
|
40
|
-
# we grab IDs, then the object. Otherwise we get sync problems
|
41
|
-
group_id = []
|
42
|
-
AuthGroup.filter(:auth_id => pk).each do |ag|
|
43
|
-
group_id << ag.group_id
|
44
|
-
end
|
45
|
-
group = []
|
46
|
-
group_id.each{|id| group << Group[id]}
|
47
|
-
return group
|
48
|
-
end
|
49
|
-
|
50
|
-
# Add group to this auth's list
|
51
|
-
def group=(group)
|
52
|
-
AuthGroup.find_or_create(:auth_id => pk, :group_id => group.pk)
|
53
|
-
end
|
54
|
-
|
55
|
-
# Remove given group from auth
|
56
|
-
def remove_group(group)
|
57
|
-
AuthGroup.filter(:auth_id => pk, :group_id => group.pk).each{|g|g.destroy}
|
58
|
-
end
|
59
|
-
|
60
31
|
# Set services (nickserv) identification
|
61
32
|
def services_identified=(val)
|
62
|
-
|
33
|
+
if(val && services)
|
34
|
+
update(:authed => true)
|
35
|
+
else
|
36
|
+
update(:authed => false)
|
37
|
+
end
|
63
38
|
end
|
64
39
|
|
65
40
|
# pass:: password to compare
|
66
41
|
# Check and authenticate against password
|
67
42
|
def check_password(pass)
|
68
43
|
if(Digest::SHA1.hexdigest(pass) == password)
|
69
|
-
|
44
|
+
update(:authed => true)
|
70
45
|
return true
|
71
46
|
else
|
72
47
|
return false
|
@@ -74,19 +49,14 @@ module ModSpox
|
|
74
49
|
end
|
75
50
|
|
76
51
|
def password=(pass)
|
77
|
-
|
78
|
-
|
79
|
-
else
|
80
|
-
update_values :password => nil
|
81
|
-
end
|
52
|
+
pass = pass.nil? ? nil : Digest::SHA1.hexdigest(pass)
|
53
|
+
super(pass)
|
82
54
|
end
|
83
55
|
|
84
56
|
# source:: source to apply mask to
|
85
57
|
# Check and authenticate by mask against source
|
86
58
|
def check_mask(source)
|
87
|
-
if
|
88
|
-
update_with_params :authed => true
|
89
|
-
end
|
59
|
+
authed = true if source =~ /^#{mask}$/
|
90
60
|
end
|
91
61
|
|
92
62
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'mod_spox/models/Nick'
|
2
|
+
require 'mod_spox/models/Group'
|
3
|
+
module ModSpox
|
4
|
+
module Models
|
5
|
+
|
6
|
+
class AuthMask < Sequel::Model
|
7
|
+
|
8
|
+
many_to_many :nicks, :join_table => :auth_masks_nicks, :class => 'ModSpox::Models::Nick'
|
9
|
+
many_to_many :groups, :join_table => :auth_masks_groups, :class => 'ModSpox::Models::Group'
|
10
|
+
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'mod_spox/models/Nick'
|
2
|
+
require 'mod_spox/models/NickMode'
|
3
|
+
|
1
4
|
module ModSpox
|
2
5
|
module Models
|
3
6
|
|
@@ -10,10 +13,24 @@ module ModSpox
|
|
10
13
|
# parked:: Bot is currently in this channel
|
11
14
|
class Channel < Sequel::Model
|
12
15
|
|
13
|
-
|
16
|
+
many_to_many :nicks, :join_table => :nick_channels, :class => 'ModSpox::Models::Nick'
|
17
|
+
one_to_many :nick_modes, :class => 'ModSpox::Models::NickMode'
|
14
18
|
|
19
|
+
# chan_name:: string
|
20
|
+
# set channel name after downcase
|
15
21
|
def name=(chan_name)
|
16
|
-
|
22
|
+
chan_name.downcase!
|
23
|
+
super(chan_name)
|
24
|
+
end
|
25
|
+
|
26
|
+
def Channel.find_or_create(args)
|
27
|
+
args[:name].downcase! if args[:name]
|
28
|
+
super(args)
|
29
|
+
end
|
30
|
+
|
31
|
+
def Channel.filter(args)
|
32
|
+
args[:name].downcase! if args[:name]
|
33
|
+
super(args)
|
17
34
|
end
|
18
35
|
|
19
36
|
def Channel.locate(string, create = true)
|
@@ -25,43 +42,45 @@ module ModSpox
|
|
25
42
|
return chan
|
26
43
|
end
|
27
44
|
|
28
|
-
#
|
29
|
-
|
30
|
-
|
45
|
+
# m:: single character mode
|
46
|
+
# returns if mode is currently set for
|
47
|
+
# channel
|
48
|
+
def set?(m)
|
49
|
+
return mode.nil? ? false : !mode.index(m).nil?
|
31
50
|
end
|
32
51
|
|
33
|
-
#
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
39
|
-
return all_nicks
|
52
|
+
# m:: single character mode
|
53
|
+
# set a mode for the channel
|
54
|
+
# TODO: add some type checks
|
55
|
+
def set_mode(m)
|
56
|
+
update(:mode => "#{values[:mode]}#{m}") if values[:mode].nil? || values[:mode].index(m).nil?
|
40
57
|
end
|
41
58
|
|
42
|
-
#
|
43
|
-
|
44
|
-
|
59
|
+
# m:: single character mode
|
60
|
+
# unset a mode for the channel
|
61
|
+
def unset_mode(m)
|
62
|
+
update(:mode => values[:mode].gsub(m, ''))
|
45
63
|
end
|
46
64
|
|
47
|
-
|
48
|
-
|
49
|
-
NickChannel.filter(:channel_id => pk, :nick_id => nick.pk).first.destroy
|
50
|
-
if(NickChannel.filter(:channel_id => pk).count < 1)
|
51
|
-
update_values :parked => false
|
52
|
-
end
|
65
|
+
def clear_modes
|
66
|
+
update(:mode => '')
|
53
67
|
end
|
54
68
|
|
55
69
|
# Removes all nicks from this channel
|
56
70
|
def clear_nicks
|
57
|
-
|
58
|
-
update_values :parked => false
|
71
|
+
remove_all_nicks
|
59
72
|
end
|
60
73
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
74
|
+
def add_nick(n)
|
75
|
+
unless(nicks_dataset.filter(:nick_id => n.pk).count > 0)
|
76
|
+
super(n)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def remove_nick(n)
|
81
|
+
if(nicks_dataset.filter(:nick_id => n.pk).count > 0)
|
82
|
+
super(n)
|
83
|
+
end
|
65
84
|
end
|
66
85
|
|
67
86
|
end
|
@@ -7,32 +7,23 @@ module ModSpox
|
|
7
7
|
# It is important to note this model is for storing configuration
|
8
8
|
# values only. It will only store strings, not complex objects. If
|
9
9
|
# you need to store an object, use the Setting model.
|
10
|
+
# TODO: find and remove any [] usage
|
10
11
|
class Config < Sequel::Model
|
11
12
|
|
12
13
|
def name=(config_name)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
def value=(val)
|
17
|
-
values[:value] = val
|
14
|
+
config_name.downcase!
|
15
|
+
super(config_name)
|
18
16
|
end
|
19
17
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
key = key.to_s if key.is_a?(Symbol)
|
24
|
-
match = Config.filter(:name => key).first
|
25
|
-
return match ? match.value : nil
|
18
|
+
def Config.val(sym)
|
19
|
+
s = Config.filter(:name => "#{sym}").first
|
20
|
+
return s ? s.value : nil
|
26
21
|
end
|
27
22
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
key = key.to_s if key.is_a?(Symbol)
|
33
|
-
model = Config.find_or_create(:name => key)
|
34
|
-
model.update_with_params(:value => val)
|
35
|
-
model.save
|
23
|
+
def Config.set(sym, value)
|
24
|
+
s = Config.find_or_create(:name => "#{sym}")
|
25
|
+
s.value = value
|
26
|
+
s.save
|
36
27
|
end
|
37
28
|
end
|
38
29
|
end
|
@@ -1,18 +1,30 @@
|
|
1
|
+
require 'mod_spox/models/Auth'
|
2
|
+
require 'mod_spox/models/Signature'
|
3
|
+
|
1
4
|
module ModSpox
|
2
5
|
module Models
|
6
|
+
|
3
7
|
class Group < Sequel::Model
|
4
8
|
|
5
|
-
|
6
|
-
|
9
|
+
many_to_many :auth_masks, :join_table => :auth_masks_groups, :class => 'ModSpox::Models::AuthMask'
|
10
|
+
many_to_many :auths, :join_table => :auth_groups, :class => 'ModSpox::Models::Auth'
|
11
|
+
one_to_many :signature, :class => 'ModSpox::Models::Signature'
|
12
|
+
|
13
|
+
def Group.filter(args={})
|
14
|
+
args[:name].downcase! if args.has_key?(:name)
|
15
|
+
super(args)
|
16
|
+
end
|
17
|
+
|
18
|
+
def Group.find_or_create(args={})
|
19
|
+
args[:name].downcase! if args.has_key?(:name)
|
20
|
+
super(args)
|
7
21
|
end
|
8
22
|
|
9
|
-
def
|
10
|
-
|
11
|
-
|
12
|
-
auth << ag.auth
|
13
|
-
end
|
14
|
-
return auth
|
23
|
+
def name=(group_name)
|
24
|
+
group_name.downcase!
|
25
|
+
super(group_name)
|
15
26
|
end
|
27
|
+
|
16
28
|
end
|
17
29
|
end
|
18
30
|
end
|