bot_mob 0.1.7 → 0.1.8

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
  SHA1:
3
- metadata.gz: 0f23a925ed2a514610920c5b510a1f52b53d627a
4
- data.tar.gz: 66346f6ccb1320bab843e9ddc9fea72810b8c1d2
3
+ metadata.gz: 46ecaa6f92c8dfe8dd02af18cdabe5a23cbadc66
4
+ data.tar.gz: e1228884787f48e1937ce6d6647a7b0055caf44c
5
5
  SHA512:
6
- metadata.gz: f18b011e57325aacd46f08be27e0438de2d179d6137daa4daaca911d7f584de81fd728c2ee9672523337bde32212adc0daa06270a41c07c82e2606e8988b529d
7
- data.tar.gz: cb9c3d13c2acc7a3a1f9e69e4a1245c6f670f3b97672398439e41e1f0189cf6ef8328a683e62c82665725c4433fab896150512994f687684f3beb4dcb746e907
6
+ metadata.gz: fd4d141e4327eb958c38fcf250be695eb0741a566cff18f5cc2118549d7afcc72bc4148758e0863c34e27c949c6b8d517f023130a08393f3bc1bdcaf456c7445
7
+ data.tar.gz: 6bae5bb2d3c39698a391155680084827ba9512a2bbb2892debd6dcc80632ecaffa5973ebb0eb9a7a630b208ccf5bf09e0820e90d21e70e8e862b7836b4c92504
data/bot_mob.gemspec CHANGED
@@ -25,8 +25,8 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency 'crypt_keeper', '~> 0.21'
26
26
  spec.add_dependency 'slack-ruby-client', '~> 0.7'
27
27
  spec.add_dependency 'celluloid-io', '~> 0.17'
28
+ spec.add_dependency 'activerecord', '~> 4.2'
28
29
 
29
- spec.add_development_dependency 'activerecord', '~> 4.2'
30
30
  spec.add_development_dependency 'bundler', '~> 1.12'
31
31
  spec.add_development_dependency 'rake', '~> 10.0'
32
32
  spec.add_development_dependency 'rubocop', '~> 0.40'
@@ -13,7 +13,7 @@ module BotMob
13
13
  def process
14
14
  return unless ambassador.success?
15
15
 
16
- install = Install.create_with_ambassador(ambassador)
16
+ install = BotMob::Install.create_with_ambassador(ambassador)
17
17
  # check for install's success
18
18
  wire.publish(external_id: install.external_id)
19
19
  end
@@ -0,0 +1,13 @@
1
+ module BotMob
2
+ class Install < ActiveRecord::Base
3
+ crypt_keeper :token, encryptor: :postgres_pgp, key: ENV['BOTMOB_SECRET'], salt: ENV['BOTMOB_SALT']
4
+ self.table_name = "botmob_installs"
5
+
6
+ def self.create_with_ambassador(auth)
7
+ where(external_id: auth.external_id).first_or_initialize.tap do |i|
8
+ i.token = auth.token
9
+ i.save!
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module BotMob
2
- VERSION = '0.1.7'.freeze
2
+ VERSION = '0.1.8'.freeze
3
3
  end
data/lib/bot_mob.rb CHANGED
@@ -14,6 +14,7 @@ module BotMob
14
14
  autoload :Authority, 'bot_mob/authority'
15
15
  autoload :Bot, 'bot_mob/bot'
16
16
  autoload :InboundMessage, 'bot_mob/inbound_message'
17
+ autoload :Install, 'bot_mob/install'
17
18
  autoload :Wire, 'bot_mob/wire'
18
19
 
19
20
  module Ambassadors
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bot_mob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Werner
@@ -73,7 +73,7 @@ dependencies:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '4.2'
76
- type: :development
76
+ type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
@@ -187,6 +187,7 @@ files:
187
187
  - lib/bot_mob/authority.rb
188
188
  - lib/bot_mob/bot.rb
189
189
  - lib/bot_mob/inbound_message.rb
190
+ - lib/bot_mob/install.rb
190
191
  - lib/bot_mob/version.rb
191
192
  - lib/bot_mob/wire.rb
192
193
  homepage: https://github.com/mwerner/bot_mob