grinch 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/lib/cinch.rb +7 -5
- data/lib/cinch/ban.rb +6 -2
- data/lib/cinch/bot.rb +21 -31
- data/lib/cinch/cached_list.rb +2 -0
- data/lib/cinch/callback.rb +2 -0
- data/lib/cinch/channel.rb +43 -44
- data/lib/cinch/channel_list.rb +2 -0
- data/lib/cinch/configuration.rb +8 -6
- data/lib/cinch/configuration/bot.rb +35 -33
- data/lib/cinch/configuration/dcc.rb +4 -2
- data/lib/cinch/configuration/plugins.rb +8 -6
- data/lib/cinch/configuration/sasl.rb +6 -4
- data/lib/cinch/configuration/ssl.rb +7 -5
- data/lib/cinch/configuration/timeouts.rb +4 -2
- data/lib/cinch/constants.rb +3 -1
- data/lib/cinch/dcc.rb +2 -0
- data/lib/cinch/dcc/dccable_object.rb +6 -8
- data/lib/cinch/dcc/incoming.rb +2 -0
- data/lib/cinch/dcc/incoming/send.rb +10 -8
- data/lib/cinch/dcc/outgoing.rb +2 -0
- data/lib/cinch/dcc/outgoing/send.rb +13 -14
- data/lib/cinch/exceptions.rb +2 -0
- data/lib/cinch/formatting.rb +32 -30
- data/lib/cinch/handler.rb +15 -13
- data/lib/cinch/handler_list.rb +13 -13
- data/lib/cinch/helpers.rb +16 -16
- data/lib/cinch/irc.rb +118 -142
- data/lib/cinch/isupport.rb +22 -20
- data/lib/cinch/log_filter.rb +3 -2
- data/lib/cinch/logger.rb +7 -2
- data/lib/cinch/logger/formatted_logger.rb +17 -13
- data/lib/cinch/logger/zcbot_logger.rb +4 -0
- data/lib/cinch/logger_list.rb +15 -14
- data/lib/cinch/mask.rb +11 -9
- data/lib/cinch/message.rb +6 -6
- data/lib/cinch/message_queue.rb +5 -4
- data/lib/cinch/mode_parser.rb +7 -5
- data/lib/cinch/network.rb +2 -0
- data/lib/cinch/open_ended_queue.rb +5 -5
- data/lib/cinch/pattern.rb +11 -8
- data/lib/cinch/plugin.rb +43 -49
- data/lib/cinch/plugin_list.rb +4 -4
- data/lib/cinch/rubyext/float.rb +3 -3
- data/lib/cinch/rubyext/module.rb +2 -0
- data/lib/cinch/rubyext/string.rb +8 -6
- data/lib/cinch/sasl.rb +2 -0
- data/lib/cinch/sasl/dh_blowfish.rb +5 -3
- data/lib/cinch/sasl/diffie_hellman.rb +6 -3
- data/lib/cinch/sasl/mechanism.rb +2 -0
- data/lib/cinch/sasl/plain.rb +2 -0
- data/lib/cinch/syncable.rb +10 -9
- data/lib/cinch/target.rb +15 -17
- data/lib/cinch/timer.rb +9 -7
- data/lib/cinch/user.rb +52 -48
- data/lib/cinch/user_list.rb +8 -11
- data/lib/cinch/utilities/deprecation.rb +5 -5
- data/lib/cinch/utilities/encoding.rb +9 -9
- data/lib/cinch/utilities/kernel.rb +4 -1
- data/lib/cinch/version.rb +3 -1
- metadata +4 -4
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Cinch
|
2
4
|
module Utilities
|
3
5
|
# @since 2.0.0
|
@@ -5,11 +7,9 @@ module Cinch
|
|
5
7
|
module Deprecation
|
6
8
|
def self.print_deprecation(version, method, instead = nil)
|
7
9
|
s = "Deprecation warning: Beginning with version #{version}, #{method} should not be used anymore."
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
$stderr.puts s
|
12
|
-
$stderr.puts caller
|
10
|
+
s << " Use #{instead} instead." unless instead.nil?
|
11
|
+
warn s
|
12
|
+
warn caller
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Cinch
|
2
4
|
module Utilities
|
3
5
|
# @since 2.0.0
|
@@ -13,24 +15,22 @@ module Cinch
|
|
13
15
|
#
|
14
16
|
# (from http://xchat.org/encoding/#hybrid)
|
15
17
|
string.force_encoding("UTF-8")
|
16
|
-
|
17
|
-
string.force_encoding("CP1252").encode!("UTF-8",
|
18
|
+
unless string.valid_encoding?
|
19
|
+
string.force_encoding("CP1252").encode!("UTF-8", invalid: :replace, undef: :replace)
|
18
20
|
end
|
19
21
|
else
|
20
|
-
string.force_encoding(encoding).encode!(
|
21
|
-
string = string.chars.select
|
22
|
+
string.force_encoding(encoding).encode!(invalid: :replace, undef: :replace)
|
23
|
+
string = string.chars.select(&:valid_encoding?).join
|
22
24
|
end
|
23
25
|
|
24
|
-
|
26
|
+
string
|
25
27
|
end
|
26
28
|
|
27
29
|
def self.encode_outgoing(string, encoding)
|
28
30
|
string = string.dup
|
29
|
-
if encoding == :irc
|
30
|
-
encoding = "UTF-8"
|
31
|
-
end
|
31
|
+
encoding = "UTF-8" if encoding == :irc
|
32
32
|
|
33
|
-
|
33
|
+
string.encode!(encoding, invalid: :replace, undef: :replace).force_encoding("ASCII-8BIT")
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Cinch
|
2
4
|
module Utilities
|
3
5
|
# @since 2.0.0
|
@@ -6,7 +8,8 @@ module Cinch
|
|
6
8
|
# @return [Object]
|
7
9
|
def self.string_to_const(s)
|
8
10
|
return s unless s.is_a?(::String)
|
9
|
-
|
11
|
+
|
12
|
+
s.split("::").inject(Kernel) { |base, name| base.const_get(name) }
|
10
13
|
end
|
11
14
|
end
|
12
15
|
end
|
data/lib/cinch/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grinch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Woodruff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A simple, friendly DSL for creating IRC bots
|
14
14
|
email:
|
@@ -126,14 +126,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
126
|
requirements:
|
127
127
|
- - ">="
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: '2.
|
129
|
+
version: '2.5'
|
130
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
131
|
requirements:
|
132
132
|
- - ">="
|
133
133
|
- !ruby/object:Gem::Version
|
134
134
|
version: '0'
|
135
135
|
requirements: []
|
136
|
-
rubygems_version: 3.
|
136
|
+
rubygems_version: 3.1.2
|
137
137
|
signing_key:
|
138
138
|
specification_version: 4
|
139
139
|
summary: An IRC Bot Building Framework
|