rubydium 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8787fccb275711579c29e53c725847948c7b4ff6f1824284a91e5e037bd0768e
4
- data.tar.gz: 1650a9f2d7531bd6173a907ac000b3b00f74a1f52c5b6318d283b2ea328f1d9d
3
+ metadata.gz: c2e2772c99fcea22c7e44bf38e1f627f15e82c7e40f7d7098a0274899e1f6f96
4
+ data.tar.gz: acfaf6eab26a496487dc3ad068d94ee32fea757013e7b7f417488df5e1bc77f5
5
5
  SHA512:
6
- metadata.gz: 72c52fde7897f448aef03fc3601a677ee2278bb979544d633d3be9aef0c835afbe16ae554d8eb9c7581ef8020eb961e7d0dfc7ab1ddd9e8f573257529cfc324a
7
- data.tar.gz: 0e9480b09c9a489b10e34869478fa3f797641619b9843e93c78ca122a2ac279d60819cbfced0a4805e43b83b182aedb6e448338ffb4d3b334e30cb9b6ae359d2
6
+ metadata.gz: e5433732515339715ffce7a6a0a42c4fc16f305482605b2f7fe5021e76be5d95a32ecc70858d0f9685c874fa18e342b7eaa681e3ba658ae7d580041999e654da
7
+ data.tar.gz: 824cbea37e25519b5c3d1a1d1f845d1c4bd6c5eb52a29c9ecea6387302e4506055f6780492def00b594caf84ba81a1a1ed2ed6ef7c272fcd14c0fcd276cc12fe
@@ -10,6 +10,34 @@ module Rubydium
10
10
  end
11
11
 
12
12
  module ClassMethods
13
+ # Makes these actions work in inheritance as you would expect, i. e.:
14
+ #
15
+ # class ParentBot < Rubydium::Bot
16
+ # on_every_message :foo
17
+ # end
18
+ #
19
+ # class ChildBot < ParentBot
20
+ # on_every_message :bar
21
+ # end
22
+ #
23
+ # class AnotherChildBot < ParentBot
24
+ # on_every_message :baz
25
+ # end
26
+ #
27
+ # ParentBot.registered_on_every_message.map { _1[:action] } # => [:foo]
28
+ # ChildBot.registered_on_every_message.map { _1[:action] } # => [:foo, :bar]
29
+ # AnotherChildBot.registered_on_every_message.map { _1[:action] } # => [:foo, :baz]
30
+ def inherited(subclass)
31
+ %w[
32
+ @registered_on_mention
33
+ @registered_on_every_message
34
+ @registered_commands
35
+ ].each do |var_name|
36
+ current_value_copy = instance_variable_get(var_name).dup
37
+ subclass.instance_variable_set(var_name, current_value_copy)
38
+ end
39
+ end
40
+
13
41
  def on_mention(method_name=nil, ignore_forwarded: true, &block)
14
42
  @registered_on_mention ||= []
15
43
  action = (method_name || block)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rubydium
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.2"
5
5
  end
data/rubydium.gemspec CHANGED
@@ -32,4 +32,11 @@ Gem::Specification.new do |spec|
32
32
  # For more information and examples about making a new gem, checkout our
33
33
  # guide at: https://bundler.io/guides/creating_gem.html
34
34
  spec.metadata["rubygems_mfa_required"] = "true"
35
+
36
+ {
37
+ "telegram-bot-ruby" => ['~> 0.23.0'],
38
+ "async" => ['~> 2.3']
39
+ }.each do |name, versions|
40
+ spec.add_dependency(name, *versions)
41
+ end
35
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubydium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - bulgakke
@@ -9,7 +9,35 @@ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
11
  date: 2023-09-14 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: telegram-bot-ruby
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.23.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.23.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: async
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.3'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.3'
13
41
  description:
14
42
  email:
15
43
  - vvp835@yandex.ru