grinch 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -2
  3. data/lib/cinch.rb +7 -5
  4. data/lib/cinch/ban.rb +6 -2
  5. data/lib/cinch/bot.rb +21 -31
  6. data/lib/cinch/cached_list.rb +2 -0
  7. data/lib/cinch/callback.rb +2 -0
  8. data/lib/cinch/channel.rb +43 -44
  9. data/lib/cinch/channel_list.rb +2 -0
  10. data/lib/cinch/configuration.rb +8 -6
  11. data/lib/cinch/configuration/bot.rb +35 -33
  12. data/lib/cinch/configuration/dcc.rb +4 -2
  13. data/lib/cinch/configuration/plugins.rb +8 -6
  14. data/lib/cinch/configuration/sasl.rb +6 -4
  15. data/lib/cinch/configuration/ssl.rb +7 -5
  16. data/lib/cinch/configuration/timeouts.rb +4 -2
  17. data/lib/cinch/constants.rb +3 -1
  18. data/lib/cinch/dcc.rb +2 -0
  19. data/lib/cinch/dcc/dccable_object.rb +6 -8
  20. data/lib/cinch/dcc/incoming.rb +2 -0
  21. data/lib/cinch/dcc/incoming/send.rb +10 -8
  22. data/lib/cinch/dcc/outgoing.rb +2 -0
  23. data/lib/cinch/dcc/outgoing/send.rb +13 -14
  24. data/lib/cinch/exceptions.rb +2 -0
  25. data/lib/cinch/formatting.rb +32 -30
  26. data/lib/cinch/handler.rb +15 -13
  27. data/lib/cinch/handler_list.rb +13 -13
  28. data/lib/cinch/helpers.rb +16 -16
  29. data/lib/cinch/irc.rb +118 -142
  30. data/lib/cinch/isupport.rb +22 -20
  31. data/lib/cinch/log_filter.rb +3 -2
  32. data/lib/cinch/logger.rb +7 -2
  33. data/lib/cinch/logger/formatted_logger.rb +17 -13
  34. data/lib/cinch/logger/zcbot_logger.rb +4 -0
  35. data/lib/cinch/logger_list.rb +15 -14
  36. data/lib/cinch/mask.rb +11 -9
  37. data/lib/cinch/message.rb +6 -6
  38. data/lib/cinch/message_queue.rb +5 -4
  39. data/lib/cinch/mode_parser.rb +7 -5
  40. data/lib/cinch/network.rb +2 -0
  41. data/lib/cinch/open_ended_queue.rb +5 -5
  42. data/lib/cinch/pattern.rb +11 -8
  43. data/lib/cinch/plugin.rb +43 -49
  44. data/lib/cinch/plugin_list.rb +4 -4
  45. data/lib/cinch/rubyext/float.rb +3 -3
  46. data/lib/cinch/rubyext/module.rb +2 -0
  47. data/lib/cinch/rubyext/string.rb +8 -6
  48. data/lib/cinch/sasl.rb +2 -0
  49. data/lib/cinch/sasl/dh_blowfish.rb +5 -3
  50. data/lib/cinch/sasl/diffie_hellman.rb +6 -3
  51. data/lib/cinch/sasl/mechanism.rb +2 -0
  52. data/lib/cinch/sasl/plain.rb +2 -0
  53. data/lib/cinch/syncable.rb +10 -9
  54. data/lib/cinch/target.rb +15 -17
  55. data/lib/cinch/timer.rb +9 -7
  56. data/lib/cinch/user.rb +52 -48
  57. data/lib/cinch/user_list.rb +8 -11
  58. data/lib/cinch/utilities/deprecation.rb +5 -5
  59. data/lib/cinch/utilities/encoding.rb +9 -9
  60. data/lib/cinch/utilities/kernel.rb +4 -1
  61. data/lib/cinch/version.rb +3 -1
  62. 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
- if instead != nil
9
- s << " Use #{instead} instead."
10
- end
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
- if !string.valid_encoding?
17
- string.force_encoding("CP1252").encode!("UTF-8", {:invalid => :replace, :undef => :replace})
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!({:invalid => :replace, :undef => :replace})
21
- string = string.chars.select { |c| c.valid_encoding? }.join
22
+ string.force_encoding(encoding).encode!(invalid: :replace, undef: :replace)
23
+ string = string.chars.select(&:valid_encoding?).join
22
24
  end
23
25
 
24
- return string
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
- return string.encode!(encoding, {:invalid => :replace, :undef => :replace}).force_encoding("ASCII-8BIT")
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
- s.split("::").inject(Kernel) {|base, name| base.const_get(name) }
11
+
12
+ s.split("::").inject(Kernel) { |base, name| base.const_get(name) }
10
13
  end
11
14
  end
12
15
  end
@@ -1,4 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Cinch
2
4
  # Version of the library
3
- VERSION = '2.3.1'
5
+ VERSION = "1.1.0"
4
6
  end
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.1
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: 2019-04-29 00:00:00.000000000 Z
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.4'
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.0.3
136
+ rubygems_version: 3.1.2
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: An IRC Bot Building Framework