mock-bandwidth 1.1.0 → 1.2

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: 2b742dbbaa7cd5d4e98837e9e22fcc9d77d79d9ae229d5eec50a95e2c7dab60e
4
- data.tar.gz: 8069867b44a7efdaa02443c36faf107217d7ec248c7602a464bf848a3038d5ea
3
+ metadata.gz: 3a2c79331cf4faedbdfb5a9957263bf5de0bbfa3047b43f054287779a53ec8f2
4
+ data.tar.gz: 2675c8896daa01ebbd7300bab1368d25c6402b89a42f027d4ba3d34fce967ee3
5
5
  SHA512:
6
- metadata.gz: 9a42e5f65b56c7b78b29f2d45ba22bf2e6057739dddb0f7ba10b3f2be962896d1107cb53f61d58dff9ed80a9c25bf74d6c4bae1d7520d35a8634b1f2204a1ab5
7
- data.tar.gz: cb3960362fb2f7d31760720a15354a488f985a4a5a8a1d305541388550cee7246e928eccb660e6c87b567e173338824c8d9ddefc3dfa2f4b43ea52af72d0a8e5
6
+ metadata.gz: b8884d19225d349a52d1596bc230ad7e06bd3dc6ef657e50557e26a6eedb607d8bb1c666d3e619cdb80c30fd6c86f01be2f7bc706314d63f94795f332be9e0ec
7
+ data.tar.gz: bfaeffc9ab690ae2c8adfeb3bc5d0f05d47fe71f37cdc2ca0ca2efc6a5c038f23642af82777764a6714273f3b2cfaba18ba7d9bb5e21bee88ed7523362e1646b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.2] - 2025-06-03
2
+ - Add disable_webhooks configuration
3
+ - Fix webhooks ErrorHandler
4
+
5
+ ## [1.1.1] - 2025-02-03
6
+ - Downgrade active-support to 5.2 for better compatibility
7
+
1
8
  ## [1.1.0] - 2025-01-29
2
9
  - Add webhooks messages status updates support
3
10
 
data/README.md CHANGED
@@ -51,6 +51,8 @@ end
51
51
 
52
52
  Mock::Bandwidth.configure do |config|
53
53
  config.webhook_message_status_url = "http://my-server.com/webhooks/bandwidth/messages_updates"
54
+ # optional
55
+ # config.disable_webhooks = true
54
56
  end
55
57
  ```
56
58
 
@@ -4,11 +4,15 @@ module Mock
4
4
  module Bandwidth
5
5
  module Util
6
6
  class Configuration
7
- attr_accessor :webhook_message_status_url
7
+ attr_accessor :webhook_message_status_url, :disable_webhooks
8
8
 
9
9
  def webhook_message_status_url=(value)
10
10
  @webhook_message_status_url = value
11
11
  end
12
+
13
+ def disable_webhooks=(value)
14
+ @disable_webhooks = value
15
+ end
12
16
  end
13
17
  end
14
18
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Mock
4
4
  module Bandwidth
5
- VERSION = "1.1.0"
5
+ VERSION = "1.2"
6
6
  end
7
7
  end
@@ -5,6 +5,8 @@ module Mock
5
5
  module Webhooks
6
6
  class Messages < Base
7
7
  def self.trigger(id, body)
8
+ return if Mock::Bandwidth.disable_webhooks
9
+
8
10
  # Wait simulation from twilio
9
11
  sleep DELAY.sample
10
12
 
@@ -41,7 +43,7 @@ module Mock
41
43
  when 200..204
42
44
  response
43
45
  when 400..600
44
- raise Webhooks::RestError, Mock::Twilio::ErrorHandler.new(response).raise
46
+ raise Webhooks::RestError, Mock::Bandwidth::ErrorHandler.new(response).raise
45
47
  end
46
48
  end
47
49
  end
@@ -18,7 +18,7 @@ module Mock
18
18
  module Bandwidth
19
19
  extend SingleForwardable
20
20
 
21
- def_delegators :configuration, :webhook_message_status_url
21
+ def_delegators :configuration, :webhook_message_status_url, :disable_webhooks
22
22
 
23
23
  def self.configure(&block)
24
24
  yield configuration
@@ -28,6 +28,6 @@ module Mock
28
28
  @configuration ||= Util::Configuration.new
29
29
  end
30
30
 
31
- private_class_method :configuration
31
+ public_class_method :configuration
32
32
  end
33
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mock-bandwidth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: '1.2'
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: 2025-01-29 00:00:00.000000000 Z
11
+ date: 2025-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: 6.0.0
67
+ version: '5.2'
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: 6.0.0
74
+ version: '5.2'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: httparty
77
77
  requirement: !ruby/object:Gem::Requirement