mock-twilio 1.5 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b621eb4f194a009b3327c4a27d75fd6fc058e2d97d0fa47832e776910de3b4b9
4
- data.tar.gz: 4657ed12e5856ba7c759d982e92451b23a72c808bbac6f25279e21d55fafbd0a
3
+ metadata.gz: a52bffd4c72fd567629419247ab70a105749bdc6ecb1949a90c6283d7a7f7605
4
+ data.tar.gz: 29b1ea83b4e2e031c9d667eb855291e0ff5c559efc4d8138cff9fd21628b1f2c
5
5
  SHA512:
6
- metadata.gz: 4a25a3b720bf598ff14a3c0de75f6c38666fb259003bb4d158fdd235d8d35788a837d0cce942f58fe1ad3030468a78372f22a1252a70b03888078b79f3ae2842
7
- data.tar.gz: 77b999af450204792c58d1a9301d84aa83a7514c0f7f517d720761f712e41035248ff9ce89e14dadb39102c585c2069b893e625c6b1bb697369b841335cf1f41
6
+ metadata.gz: bce53334c3db48402acd11ae664af553dd2bdbc6e14f961c7e581dbfa36280d1fa73c7809af595965d0eef3ffdbcedb75c797c057c0e91a57469ca523daad6dc
7
+ data.tar.gz: 12a531d4ec3ed53e3047bb2ff9b9fae4115246c30c9694e511298f979fda663191249a0190a949c434395573f7c7f5352a77aee845b00a7750acd1efa37140a6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## [1.5.1] - 2025-02-24
2
+ - Fix Scheduler performance
3
+
1
4
  ## [1.5.0] - 2024-12-06
2
5
  - Support AvailablePhoneNumbersLocal
3
6
 
@@ -5,6 +5,8 @@ module Mock
5
5
  module Decorators
6
6
  module Api2010
7
7
  class Calls
8
+ @@scheduler = Rufus::Scheduler.new
9
+
8
10
  class << self
9
11
  def decorate(body, request)
10
12
  body["date_updated"] = Time.current.rfc2822 if body["date_updated"]
@@ -26,8 +28,7 @@ module Mock
26
28
  def call_sid(body, request)
27
29
  prefix = "CA"
28
30
  sid = prefix + SecureRandom.hex(16)
29
- scheduler = Rufus::Scheduler.new
30
- scheduler.in '2s' do
31
+ @@scheduler.in '2s' do
31
32
  conference_uuid = request.data["Url"].split("conference_uuid=").last
32
33
  begin
33
34
  response = Mock::Twilio::Webhooks::CallStatusUpdates.trigger(sid, conference_uuid, 'unknown', 'ringing')
@@ -5,6 +5,8 @@ module Mock
5
5
  module Decorators
6
6
  module Api2010
7
7
  class Messages
8
+ @@scheduler = Rufus::Scheduler.new
9
+
8
10
  class << self
9
11
  def decorate(body, request)
10
12
  body["date_updated"] = Time.current.rfc2822 if body["date_updated"]
@@ -34,9 +36,8 @@ module Mock
34
36
  def message_sid(body, request)
35
37
  prefix = request.data["MediaUrl"] ? "MM" : "SM"
36
38
  sid = prefix + SecureRandom.hex(16)
37
- scheduler = Rufus::Scheduler.new
38
39
  callback_url = request.data["StatusCallback"] if request.data["StatusCallback"]
39
- scheduler.in '2s' do
40
+ @@scheduler.in '2s' do
40
41
  begin
41
42
  response = Mock::Twilio::Webhooks::Messages.trigger(sid, callback_url)
42
43
 
@@ -5,6 +5,8 @@ module Mock
5
5
  module Decorators
6
6
  module CustomerProfilesV1
7
7
  class CustomerProfileUpdate
8
+ @@scheduler = Rufus::Scheduler.new
9
+
8
10
  class << self
9
11
  def decorate(body, request)
10
12
  body["date_updated"] = Time.current.rfc2822 if body["date_updated"]
@@ -21,8 +23,7 @@ module Mock
21
23
  def parse_customer_profile_sid(body, request)
22
24
  uri = URI(request.url)
23
25
  customer_profile_sid = uri.path.split('/')[3].split('.').first
24
- scheduler = Rufus::Scheduler.new
25
- scheduler.in '2s' do
26
+ @@scheduler.in '2s' do
26
27
  begin
27
28
  response = Mock::Twilio::Webhooks::CustomerProfiles.trigger(customer_profile_sid, "in-review")
28
29
 
@@ -4,6 +4,8 @@ module Mock
4
4
  module Twilio
5
5
  module Schemas
6
6
  class BrandsRegistrationsA2p
7
+ @@scheduler = Rufus::Scheduler.new
8
+
7
9
  class << self
8
10
  def for(body, request)
9
11
  body["date_updated"] = Time.current.rfc2822 if body["date_updated"]
@@ -32,8 +34,7 @@ module Mock
32
34
  def brand_sid(body)
33
35
  prefix = "BN"
34
36
  sid = prefix + SecureRandom.hex(16)
35
- scheduler = Rufus::Scheduler.new
36
- scheduler.in '2s' do
37
+ @@scheduler.in '2s' do
37
38
  response = Mock::Twilio::Webhooks::Brands.trigger(sid, "unverified")
38
39
  response = if response.status == 200
39
40
  Mock::Twilio::Webhooks::Brands.trigger(sid, "verified")
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Mock
4
4
  module Twilio
5
- VERSION = "1.5"
5
+ VERSION = "1.5.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mock-twilio
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.5'
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - SchoolStatus Platform Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-06 00:00:00.000000000 Z
11
+ date: 2025-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  - !ruby/object:Gem::Version
163
163
  version: '0'
164
164
  requirements: []
165
- rubygems_version: 3.4.19
165
+ rubygems_version: 3.5.12
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: This repository contains Mock::Twilio::Client and Webhooks for Twilio's API.