telegram-bot 0.16.1 → 0.16.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +0 -4
  3. data/.github/workflows/ci.yml +9 -9
  4. data/.rubocop.yml +31 -12
  5. data/Appraisals +2 -0
  6. data/CHANGELOG.md +5 -0
  7. data/Gemfile +5 -3
  8. data/Rakefile +2 -0
  9. data/bin/console +6 -2
  10. data/bin/fetch-telegram-methods +5 -3
  11. data/bin/install_git_hooks +2 -1
  12. data/gemfiles/rails_51.gemfile +3 -3
  13. data/gemfiles/rails_52.gemfile +3 -3
  14. data/gemfiles/rails_60.gemfile +3 -3
  15. data/gemfiles/rails_61.gemfile +3 -3
  16. data/gemfiles/rails_70.gemfile +3 -3
  17. data/gemfiles/rails_71.gemfile +3 -3
  18. data/lib/tasks/telegram-bot.rake +6 -4
  19. data/lib/telegram/bot/async.rb +4 -2
  20. data/lib/telegram/bot/client/api_helper.rb +3 -1
  21. data/lib/telegram/bot/client/api_methods.txt +8 -1
  22. data/lib/telegram/bot/client/request_body_formatter.rb +2 -0
  23. data/lib/telegram/bot/client/typed_response.rb +2 -0
  24. data/lib/telegram/bot/client.rb +5 -3
  25. data/lib/telegram/bot/client_stub.rb +4 -2
  26. data/lib/telegram/bot/config_methods.rb +3 -1
  27. data/lib/telegram/bot/debug_client.rb +3 -1
  28. data/lib/telegram/bot/middleware.rb +3 -1
  29. data/lib/telegram/bot/railtie.rb +3 -1
  30. data/lib/telegram/bot/routes_helper.rb +2 -0
  31. data/lib/telegram/bot/rspec/callback_query_helpers.rb +3 -1
  32. data/lib/telegram/bot/rspec/client_matchers.rb +12 -10
  33. data/lib/telegram/bot/rspec/integration/poller.rb +2 -0
  34. data/lib/telegram/bot/rspec/integration/rack.rb +2 -0
  35. data/lib/telegram/bot/rspec/integration/rails.rb +2 -0
  36. data/lib/telegram/bot/rspec/integration/shared.rb +3 -1
  37. data/lib/telegram/bot/rspec/message_helpers.rb +2 -0
  38. data/lib/telegram/bot/rspec.rb +2 -0
  39. data/lib/telegram/bot/tasks.rb +4 -4
  40. data/lib/telegram/bot/updates_controller/callback_query_context.rb +2 -0
  41. data/lib/telegram/bot/updates_controller/commands.rb +4 -2
  42. data/lib/telegram/bot/updates_controller/instrumentation.rb +7 -5
  43. data/lib/telegram/bot/updates_controller/log_subscriber.rb +4 -2
  44. data/lib/telegram/bot/updates_controller/message_context.rb +7 -5
  45. data/lib/telegram/bot/updates_controller/reply_helpers.rb +4 -2
  46. data/lib/telegram/bot/updates_controller/rescue.rb +3 -1
  47. data/lib/telegram/bot/updates_controller/rspec_helpers.rb +2 -0
  48. data/lib/telegram/bot/updates_controller/session.rb +7 -4
  49. data/lib/telegram/bot/updates_controller/testing.rb +5 -2
  50. data/lib/telegram/bot/updates_controller/translation.rb +2 -0
  51. data/lib/telegram/bot/updates_controller/typed_update.rb +2 -0
  52. data/lib/telegram/bot/updates_controller.rb +49 -19
  53. data/lib/telegram/bot/updates_poller.rb +9 -9
  54. data/lib/telegram/bot/version.rb +3 -1
  55. data/lib/telegram/bot.rb +3 -9
  56. data/telegram-bot.gemspec +7 -1
  57. metadata +4 -3
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'telegram/bot/rspec/integration/shared'
2
4
  require 'rack/test'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'telegram/bot/rspec/integration/shared'
2
4
 
3
5
  RSpec.shared_context 'telegram/bot/integration/rails', type: :request do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_support/json'
2
4
  require 'telegram/bot'
3
5
  require 'telegram/bot/rspec/message_helpers'
@@ -10,5 +12,5 @@ RSpec.shared_context 'telegram/bot/integration/shared' do
10
12
 
11
13
  let(:bot) { Telegram.bot }
12
14
  let(:clear_session?) { described_class.respond_to?(:session_store) }
13
- before { described_class.session_store.try!(:clear) if clear_session? }
15
+ before { described_class.session_store&.clear if clear_session? }
14
16
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Shared helpers for testing message updates.
2
4
  RSpec.shared_context 'telegram/bot/message_helpers' do
3
5
  let(:default_message_options) { {from: from, chat: chat} }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module RSpec
@@ -7,7 +7,7 @@ module Telegram
7
7
 
8
8
  def set_webhook
9
9
  routes = Rails.application.routes.url_helpers
10
- cert_file = ENV['CERT']
10
+ cert_file = ENV.fetch('CERT', nil)
11
11
  cert = File.open(cert_file) if cert_file
12
12
  each_bot do |key, bot|
13
13
  route_name = RoutesHelper.route_name_for_bot(bot)
@@ -16,7 +16,7 @@ module Telegram
16
16
  bot.set_webhook(
17
17
  url: url,
18
18
  certificate: cert,
19
- ip_address: ENV['IP_ADDRESS'],
19
+ ip_address: ENV.fetch('IP_ADDRESS', nil),
20
20
  drop_pending_updates: drop_pending_updates,
21
21
  )
22
22
  end
@@ -50,13 +50,13 @@ module Telegram
50
50
  end
51
51
 
52
52
  def each_bot(&block)
53
- id = ENV['BOT'].try!(:to_sym)
53
+ id = ENV['BOT']&.to_sym
54
54
  bots = id ? {id => Client.by_id(id)} : Telegram.bots
55
55
  bots.each { |key, bot| bot.async(false) { block[key, bot] } }
56
56
  end
57
57
 
58
58
  def drop_pending_updates
59
- ENV['DROP_PENDING_UPDATES'].try!(:downcase) == 'true'
59
+ ENV['DROP_PENDING_UPDATES']&.downcase == 'true'
60
60
  end
61
61
  end
62
62
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  class UpdatesController
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  class UpdatesController
4
6
  # Support for parsing commands
5
7
  module Commands
6
- CMD_REGEX = %r{\A/([a-z\d_]{,31})(@(\S+))?(\s|$)}i
8
+ CMD_REGEX = %r{\A/([a-z\d_]{,31})(@(\S+))?(\s|$)}i.freeze
7
9
 
8
10
  class << self
9
11
  # Fetches command from text message. All subsequent words are returned
@@ -34,7 +36,7 @@ module Telegram
34
36
  def action_for_message
35
37
  cmd, args = Commands.command_from_text(payload['text'], bot_username)
36
38
  return unless cmd
37
- [[action_for_command(cmd), type: :command, command: cmd], args]
39
+ [[action_for_command(cmd), {type: :command, command: cmd}], args]
38
40
  end
39
41
 
40
42
  alias_method :action_for_channel_post, :action_for_message
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  class UpdatesController
@@ -23,8 +25,8 @@ module Telegram
23
25
  def process_action(*args)
24
26
  raw_payload = {
25
27
  controller: self.class.name,
26
- action: action_name,
27
- update: update,
28
+ action: action_name,
29
+ update: update,
28
30
  }
29
31
  Instrumentation.instrument(:start_processing, raw_payload.dup)
30
32
  Instrumentation.instrument(:process_action, raw_payload) do |payload|
@@ -61,14 +63,14 @@ module Telegram
61
63
  # end
62
64
  #
63
65
  # :api: plugin
64
- def cleanup_view_runtime #:nodoc:
66
+ def cleanup_view_runtime # :nodoc:
65
67
  yield
66
68
  end
67
69
 
68
70
  # Every time after an action is processed, this method is invoked
69
71
  # with the payload, so you can add more information.
70
72
  # :api: plugin
71
- def append_info_to_payload(_payload) #:nodoc:
73
+ def append_info_to_payload(_payload) # :nodoc:
72
74
  end
73
75
 
74
76
  module ClassMethods
@@ -76,7 +78,7 @@ module Telegram
76
78
  # controller process action. This method should return an array
77
79
  # with the messages to be added.
78
80
  # :api: plugin
79
- def log_process_action(_payload) #:nodoc:
81
+ def log_process_action(_payload) # :nodoc:
80
82
  []
81
83
  end
82
84
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_support/log_subscriber'
2
4
 
3
5
  module Telegram
@@ -8,7 +10,7 @@ module Telegram
8
10
  info do
9
11
  payload = event.payload
10
12
  "Processing by #{payload[:controller]}##{payload[:action]}\n" \
11
- " Update: #{payload[:update].to_json}"
13
+ " Update: #{payload[:update].to_json}"
12
14
  end
13
15
  end
14
16
 
@@ -17,7 +19,7 @@ module Telegram
17
19
  payload = event.payload
18
20
  additions = UpdatesController.log_process_action(payload)
19
21
  message = "Completed in #{event.duration.round}ms"
20
- message << " (#{additions.join(' | ')})" if additions.present?
22
+ message += " (#{additions.join(' | ')})" if additions.present?
21
23
  message
22
24
  end
23
25
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  class UpdatesController
@@ -48,12 +50,12 @@ module Telegram
48
50
  # it has higher priority than contextual action.
49
51
  def action_for_message
50
52
  val = message_context_session.delete(:context)
51
- context = val && val.to_s
52
- super || context && begin
53
- args = payload['text'].try!(:split) || []
53
+ context = val&.to_s
54
+ super || (context && begin
55
+ args = payload['text']&.split || []
54
56
  action = action_for_message_context(context)
55
- [[action, type: :message_context, context: context], args]
56
- end
57
+ [[action, {type: :message_context, context: context}], args]
58
+ end)
57
59
  end
58
60
 
59
61
  # Save context for the next request.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  class UpdatesController
@@ -59,9 +61,9 @@ module Telegram
59
61
  # Edit message from callback query.
60
62
  def edit_message(type, params = {})
61
63
  params =
62
- if message_id = payload['inline_message_id'] # rubocop:disable AssignmentInCondition
64
+ if message_id = payload['inline_message_id'] # rubocop:disable Lint/AssignmentInCondition
63
65
  params.merge(inline_message_id: message_id)
64
- elsif message = payload['message'] # rubocop:disable AssignmentInCondition
66
+ elsif message = payload['message'] # rubocop:disable Lint/AssignmentInCondition
65
67
  params.merge(chat_id: message['chat']['id'], message_id: message['message_id'])
66
68
  else
67
69
  raise 'Can not edit message without `inline_message_id` or `message`'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_support/rescuable'
2
4
 
3
5
  module Telegram
@@ -11,7 +13,7 @@ module Telegram
11
13
 
12
14
  def process_action(*)
13
15
  super
14
- rescue Exception => exception # rubocop:disable RescueException
16
+ rescue Exception => exception # rubocop:disable Lint/RescueException
15
17
  rescue_with_handler(exception) || raise
16
18
  end
17
19
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'telegram/bot/updates_controller/testing'
2
4
  require 'telegram/bot/rspec/message_helpers'
3
5
  require 'telegram/bot/rspec/callback_query_helpers'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rack/session/abstract/id'
2
4
  require 'active_support/cache'
3
5
 
@@ -27,7 +29,8 @@ module Telegram
27
29
  protected
28
30
 
29
31
  def session
30
- @_session ||= self.class.build_session(session_key)
32
+ @_session ||= # rubocop:disable Naming/MemoizedInstanceVariableName
33
+ self.class.build_session(session_key)
31
34
  end
32
35
 
33
36
  def session_key
@@ -41,7 +44,7 @@ module Telegram
41
44
  class SessionHash < Rack::Session::Abstract::SessionHash
42
45
  attr_reader :id
43
46
 
44
- def initialize(store, id)
47
+ def initialize(store, id) # rubocop:disable Lint/MissingSuper
45
48
  @store = store
46
49
  @id = id
47
50
  end
@@ -65,13 +68,13 @@ module Telegram
65
68
 
66
69
  def commit
67
70
  return unless loaded?
68
- data = to_hash.delete_if { |_, v| v.nil? }
71
+ data = to_hash.compact
69
72
  @store.write(id, data)
70
73
  end
71
74
  end
72
75
 
73
76
  class NullSessionHash < Session::SessionHash
74
- def initialize
77
+ def initialize # rubocop:disable Lint/MissingSuper
75
78
  @data = {}
76
79
  @loaded = true
77
80
  @exists = true
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  class UpdatesController
@@ -16,7 +18,7 @@ module Telegram
16
18
  # everything will be rewriten with #initialize.
17
19
  #
18
20
  # With `full` set to `true` it'll clear all cached instance variables.
19
- def recycle!(full = false)
21
+ def recycle!(full = false) # rubocop:disable Style/OptionalBooleanParameter
20
22
  return unless full
21
23
  (instance_variables - IVARS_TO_KEEP).each do |ivar|
22
24
  remove_instance_variable(ivar)
@@ -27,7 +29,8 @@ module Telegram
27
29
 
28
30
  # Stubs session.
29
31
  def session
30
- @_session ||= Session::NullSessionHash.new
32
+ @_session ||= # rubocop:disable Naming/MemoizedInstanceVariableName
33
+ Session::NullSessionHash.new
31
34
  end
32
35
  end
33
36
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  class UpdatesController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  class UpdatesController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'abstract_controller'
2
4
  require 'active_support/core_ext/string/inflections'
3
5
  require 'active_support/callbacks'
@@ -47,7 +49,7 @@ module Telegram
47
49
  # ControllerClass.new(bot, from: telegram_user, chat: telegram_chat).
48
50
  # process(:help, *args)
49
51
  #
50
- class UpdatesController < AbstractController::Base # rubocop:disable ClassLength
52
+ class UpdatesController < AbstractController::Base # rubocop:disable Metrics/ClassLength
51
53
  abstract!
52
54
 
53
55
  %w[
@@ -69,12 +71,12 @@ module Telegram
69
71
  include AbstractController::Callbacks
70
72
  # Redefine callbacks with default terminator.
71
73
  if ActiveSupport::VERSION::MAJOR >= 5
72
- define_callbacks :process_action,
73
- skip_after_callbacks_if_terminated: true
74
+ define_callbacks :process_action,
75
+ skip_after_callbacks_if_terminated: true
74
76
  else
75
- define_callbacks :process_action,
76
- terminator: ->(_, result) { result == false },
77
- skip_after_callbacks_if_terminated: true
77
+ define_callbacks :process_action,
78
+ terminator: ->(_, result) { result == false },
79
+ skip_after_callbacks_if_terminated: true
78
80
  end
79
81
 
80
82
  include Commands
@@ -87,11 +89,17 @@ module Telegram
87
89
 
88
90
  extend Session::ConfigMethods
89
91
 
90
- PAYLOAD_TYPES = %w[
92
+ PAYLOAD_TYPES = Set.new(%w[
91
93
  message
92
94
  edited_message
93
95
  channel_post
94
96
  edited_channel_post
97
+ business_connection
98
+ business_message
99
+ edited_business_message
100
+ deleted_business_messages
101
+ message_reaction
102
+ message_reaction_count
95
103
  inline_query
96
104
  chosen_inline_result
97
105
  callback_query
@@ -102,7 +110,9 @@ module Telegram
102
110
  my_chat_member
103
111
  chat_member
104
112
  chat_join_request
105
- ].freeze
113
+ chat_boost
114
+ removed_chat_boost
115
+ ].freeze)
106
116
 
107
117
  class << self
108
118
  # Initialize controller and process update.
@@ -111,9 +121,28 @@ module Telegram
111
121
  end
112
122
 
113
123
  def payload_from_update(update)
114
- update && PAYLOAD_TYPES.find do |type|
115
- item = update[type]
116
- return [item, type] if item
124
+ case update
125
+ when nil then nil
126
+ when Hash
127
+ # faster lookup for the case when telegram-bot-types is not used
128
+ update.find do |type, item|
129
+ return [item, type] if PAYLOAD_TYPES.include?(type)
130
+ end
131
+ else
132
+ payload_from_typed_update(update)
133
+ end
134
+ end
135
+
136
+ private
137
+
138
+ def payload_from_typed_update(update)
139
+ PAYLOAD_TYPES.find do |type|
140
+ begin
141
+ item = update[type]
142
+ return [item, type] if item
143
+ rescue Exception # rubocop:disable Lint/RescueException
144
+ # dry-rb raises exception if field is not defined in schema
145
+ end
117
146
  end
118
147
  end
119
148
  end
@@ -126,14 +155,14 @@ module Telegram
126
155
  # that update is nil.
127
156
  # ActionDispatch::Request object is passed in `webhook_request` when bot running
128
157
  # in webhook mode.
129
- def initialize(bot = nil, update = nil, webhook_request = nil)
158
+ def initialize(bot = nil, update = nil, webhook_request = nil) # rubocop:disable Lint/MissingSuper
130
159
  if update.is_a?(Hash) && (update.key?(:from) || update.key?(:chat))
131
160
  options = update
132
161
  update = nil
133
162
  end
134
163
  @_bot = bot
135
164
  @_update = update
136
- @_chat, @_from = options && options.values_at(:chat, :from)
165
+ @_chat, @_from = options&.values_at(:chat, :from)
137
166
  @_payload, @_payload_type = self.class.payload_from_update(update)
138
167
  @_webhook_request = webhook_request
139
168
  end
@@ -142,13 +171,13 @@ module Telegram
142
171
  # when there is no such field in payload.
143
172
  #
144
173
  # Can be overriden with `chat` option for #initialize.
145
- def chat
146
- @_chat ||=
174
+ def chat # rubocop:disable Metrics/PerceivedComplexity
175
+ @_chat ||= # rubocop:disable Naming/MemoizedInstanceVariableName
147
176
  if payload
148
177
  if payload.is_a?(Hash)
149
- payload['chat'] || payload['message'] && payload['message']['chat']
178
+ payload['chat'] || (payload['message'] && payload['message']['chat'])
150
179
  else
151
- payload.try(:chat) || payload.try(:message).try!(:chat)
180
+ payload.try(:chat) || payload.try(:message)&.chat
152
181
  end
153
182
  end
154
183
  end
@@ -156,7 +185,8 @@ module Telegram
156
185
  # Accessor to `'from'` field of payload. Can be overriden with `from` option
157
186
  # for #initialize.
158
187
  def from
159
- @_from ||= payload.is_a?(Hash) ? payload['from'] : payload.try(:from)
188
+ @_from ||= # rubocop:disable Naming/MemoizedInstanceVariableName
189
+ payload.is_a?(Hash) ? payload['from'] : payload.try(:from)
160
190
  end
161
191
 
162
192
  # Processes current update.
@@ -221,7 +251,7 @@ module Telegram
221
251
  # Silently ignore unsupported messages to not fail when user crafts
222
252
  # an update with usupported command, callback query context, etc.
223
253
  def action_missing(action, *_args)
224
- logger.debug { "The action '#{action}' is not defined in #{self.class.name}" } if logger
254
+ logger&.debug { "The action '#{action}' is not defined in #{self.class.name}" }
225
255
  nil
226
256
  end
227
257
 
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  # Supposed to be used in development environments only.
4
6
  class UpdatesPoller
5
7
  class << self
6
- @@instances = {} # rubocop:disable ClassVars
8
+ @@instances = {} # rubocop:disable Style/ClassVars
7
9
 
8
10
  def instances
9
11
  @@instances
@@ -36,7 +38,7 @@ module Telegram
36
38
  end
37
39
 
38
40
  def log(&block)
39
- logger.info(&block) if logger
41
+ logger&.info(&block)
40
42
  end
41
43
 
42
44
  def start
@@ -56,7 +58,7 @@ module Telegram
56
58
  def run
57
59
  while running
58
60
  updates = fetch_updates
59
- process_updates(updates) if updates && updates.any?
61
+ process_updates(updates) if updates&.any?
60
62
  end
61
63
  end
62
64
 
@@ -82,8 +84,8 @@ module Telegram
82
84
  process_update(update)
83
85
  end
84
86
  end
85
- rescue StandardError => e
86
- logger.error { ([e.message] + e.backtrace).join("\n") } if logger
87
+ rescue StandardError => exception
88
+ logger&.error { ([exception.message] + exception.backtrace).join("\n") }
87
89
  end
88
90
 
89
91
  # Override this method to setup custom error collector.
@@ -102,10 +104,8 @@ module Telegram
102
104
  end
103
105
 
104
106
  if defined?(Rails.application) && Rails.application.respond_to?(:reloader)
105
- def reloading_code
106
- Rails.application.reloader.wrap do
107
- yield
108
- end
107
+ def reloading_code(&block)
108
+ Rails.application.reloader.wrap(&block)
109
109
  end
110
110
  else
111
111
  def reloading_code
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
- VERSION = '0.16.1'.freeze
5
+ VERSION = '0.16.2'
4
6
 
5
7
  def self.gem_version
6
8
  Gem::Version.new VERSION
data/lib/telegram/bot.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'telegram/bot/config_methods'
2
4
 
3
5
  module Telegram
@@ -12,15 +14,6 @@ module Telegram
12
14
  # Raised for valid telegram response with 404 status code.
13
15
  class NotFound < Error; end
14
16
 
15
- module_function
16
-
17
- def deprecation_0_16
18
- @deprecation ||= begin
19
- require 'active_support/deprecation'
20
- ActiveSupport::Deprecation.new('0.16', 'Telegram::Bot')
21
- end
22
- end
23
-
24
17
  autoload :Async, 'telegram/bot/async'
25
18
  autoload :Client, 'telegram/bot/client'
26
19
  autoload :ClientStub, 'telegram/bot/client_stub'
@@ -30,6 +23,7 @@ module Telegram
30
23
  autoload :Tasks, 'telegram/bot/tasks'
31
24
  autoload :UpdatesController, 'telegram/bot/updates_controller'
32
25
  autoload :UpdatesPoller, 'telegram/bot/updates_poller'
26
+ autoload :VERSION, 'telegram/bot/version'
33
27
  end
34
28
  end
35
29
 
data/telegram-bot.gemspec CHANGED
@@ -1,4 +1,6 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'telegram/bot/version'
4
6
 
@@ -12,6 +14,10 @@ Gem::Specification.new do |spec|
12
14
  spec.homepage = 'https://github.com/telegram-bot-rb/telegram-bot'
13
15
  spec.license = 'MIT'
14
16
 
17
+ spec.metadata = {
18
+ 'rubygems_mfa_required' => 'true',
19
+ }
20
+
15
21
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
16
22
  spec.bindir = 'exe'
17
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegram-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.1
4
+ version: 0.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Melentiev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-30 00:00:00.000000000 Z
11
+ date: 2024-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -163,7 +163,8 @@ files:
163
163
  homepage: https://github.com/telegram-bot-rb/telegram-bot
164
164
  licenses:
165
165
  - MIT
166
- metadata: {}
166
+ metadata:
167
+ rubygems_mfa_required: 'true'
167
168
  post_install_message:
168
169
  rdoc_options: []
169
170
  require_paths: