telesignature 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/telesignature/mock_service/fake_server.rb +1 -1
- data/lib/telesignature/mock_service/railtie.rb +12 -3
- data/lib/telesignature/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d38082c98e11a5bc577b8e9696f3601a66e644c
|
4
|
+
data.tar.gz: a6ac534087b37099fc8524caa157ee406d04a2ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77a5fc46d68da31e656695227c08c2925e85ce05670eab3649b341eeddab72848960cb510d9c1c8805808b496c5d7df295e24a76a26e3a2e590afd0358df4826
|
7
|
+
data.tar.gz: c4b8d96b0cde65ff925e5af9023202fcd0faaf6c3dee872fb3195e727425280799a1d25283b11a7dc3da9cbd77c97bf47bfb3dc0e9750b6b321b89e64b56cf02
|
data/Gemfile.lock
CHANGED
@@ -47,7 +47,7 @@ class StdHelpers
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
Mimic.mimic port: 11989, host: 'localhost', fork: false do
|
50
|
+
Mimic.mimic port: (ENV['TELESIGN_PORT'].to_i || 11989), host: (ENV['TELESIGN_URL'] || 'localhost'), fork: false do
|
51
51
|
# 'https://rest.telesign.com/v1/verify/sms'
|
52
52
|
# params['phone_number']
|
53
53
|
# params['language']
|
@@ -2,11 +2,20 @@ module Telesignature
|
|
2
2
|
module MockService
|
3
3
|
class Railtie < ::Rails::Railtie
|
4
4
|
initializer 'telesignature_railtie.configure_rails_initialization' do
|
5
|
+
|
5
6
|
if ENV['TELESIGN_STUBBED']
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
port = (ENV['TELESIGN_PORT'].to_i || 11989)
|
8
|
+
if `lsof -i :#{port}`.blank? # no process running on 11988
|
9
|
+
Process.detach(pid = Process.fork do
|
10
|
+
require 'telesignature/mock_service/fake_server'
|
11
|
+
end)
|
12
|
+
else
|
13
|
+
Rails.logger.warn "TELESIGN STUB MODE FAILED TO START\nProcess already listening on #{port}"
|
14
|
+
end
|
9
15
|
end
|
16
|
+
|
17
|
+
at_exit { pid && `kill #{pid}` }
|
18
|
+
|
10
19
|
end
|
11
20
|
end
|
12
21
|
end
|