action_bot 0.1.20 → 0.1.21

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: ae9a8fba1d7abc68cb0e5846d527a5bfa4314f2db822199b8c28b5b7822a8e37
4
- data.tar.gz: 7515e24bee82141d2b2116382c8cab1b99b38371eec61bc565915548cee45047
3
+ metadata.gz: a4dd4aedf212a7767933f9cd317bdf9f866b7acbd2e6925e19f3f7b53e429caa
4
+ data.tar.gz: a93595bb31bf30c867c492417524dcc4203d3d45419b2b2f75663527876fa4a6
5
5
  SHA512:
6
- metadata.gz: a7cadcadd6c9b9384e8fb133ff6c71976d4490c03e153c211e982d1546307cea336963c3714b4bd9770d365b53f562d777551c5c687d198f7ce451e8b018b4e3
7
- data.tar.gz: eb3f29669a85823e0ff77ac13c0f4ebfabc245701bc5be08b9fd58f37b3825bba69c93e4de85f90ffa0a4f4ade8e57dd8801b14dfcf1b9434c93cd28428e738d
6
+ metadata.gz: a9759a5c2b72b6197da0eb94920ab09ea30bedcb857374527ddfab3728b2509779e915c4d19a21e6913ca670b6e1398e07f252b316e5c5995dfb04ca52284de7
7
+ data.tar.gz: 4f052bfc2df5bbe175d569ecb41f0814a2f13ae93786e2342ef4a1c7c300bce47647e4ad4c6e5b11d7e9829ff67e2b42b3f498233ce7ed5d747394210b80a5c7
@@ -3,17 +3,13 @@ module ActionBot
3
3
  include Configurable.with(:api, :bot)
4
4
 
5
5
  def on(condition, **kwargs)
6
- puts "#{Time.now}: Received:- #{kwargs}"
7
6
  return unless condition
8
- puts "Passed condition: #{condition}"
9
7
 
10
8
  params = kwargs.delete(:params) || {}
11
9
  controller, action = kwargs.first
12
10
  controller_object = "#{controller.to_s.camelize}Controller".constantize.new
13
- puts "controller: #{controller.to_s.camelize}Controller, action: #{action}"
14
11
  raise "No such method: #{action} for #{controller}" unless controller_object.respond_to?(action)
15
12
 
16
- puts "Receiving..."
17
13
  controller_object.params = ActionController::Parameters.new params
18
14
  controller_object.public_send(action)
19
15
  throw(:done)
@@ -16,7 +16,7 @@ module ActionBot
16
16
  end
17
17
 
18
18
  def t(*args)
19
- I18n.locale = load_chat.locale
19
+ I18n.locale = load_chat.locale if respond_to?(:load_chat)
20
20
  I18n.t(*args)
21
21
  end
22
22
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Barseek