twi 0.9.0 → 0.9.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: a7531d7fa92db501d0d81a5b9d8ad8108614c63d1260b465a2a0367ef716293c
4
- data.tar.gz: 496ac9be22cf2840ae6eeaa5897347ad0402039daad423030b446aae17a8c23e
3
+ metadata.gz: 927f6cdebf1bf8f582f0848935cfba95a7b5426bc84eb5a9c6588ebc0d592e82
4
+ data.tar.gz: a2f0bcaacd413d6b611d2656171749ec01d15f5876606c2b3f9f0a0d31aa2d01
5
5
  SHA512:
6
- metadata.gz: e2d906451f3d4c5e8fc2f1cb8fd26b998998bee953d89675594b822b2cad6f55b06b80770540a135d0381d0f537cd16c0f5faada49e0ead42c23cf54302a5460
7
- data.tar.gz: c1605aa3aca9c09af360e1ee871c3a9e29787498ad85ba3c38547bda3568f9237d9c6c7c4d45919c7875eb0b08bca0140677aa2145f654cb1e559fb6de34b23b
6
+ metadata.gz: 2e9ef2920c4815b451c0620a701aa718ecb5a5d1b339d343ec72f29f800fe42c495ee6040a328cb6a7741ea865b3762733f86abbc349cb70cb9e6f207b352295
7
+ data.tar.gz: 260f7cce6f28f7c38c79606aed311984da642c301d9ce0f48580229b859a7d2e8195916fb61a7af42b01ed9589d3674fb36fd07280db854f8b732e629a8f944e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.9.1] - 2026-09-14
4
+
5
+ - [Fix] Read an event's target outside Rails, where Array#second is not loaded by an app
6
+ - [Fix] Read a delivery's sender as ten digits, the way every other resource reads a number
7
+ - [Fix] Raise a mocked phone's arranged error, and forget it, as the message and call mocks do
8
+
3
9
  ## [0.9.0] - 2026-09-14
4
10
 
5
11
  - [New] Place a call with Twi.create_call, telling Twilio where to read its TwiML
@@ -2,8 +2,6 @@
2
2
  module Twi
3
3
  # The representation of a (classic) group conversation.
4
4
  class Conversation < Resource
5
- attr_reader :id, :status
6
-
7
5
  def create_with(participants:)
8
6
  params = create_params_for participants
9
7
  conversation = conversation_service.conversation_with_participants.create **params
data/lib/twi/delivery.rb CHANGED
@@ -12,8 +12,9 @@ module Twi
12
12
  # @return [String, nil] error code
13
13
  def code = @params['ErrorCode']
14
14
 
15
- # @return [String] phone number that delivered the message.
16
- def sender = @params['From']
15
+ # @return [String] phone number that delivered the message, as every other resource here
16
+ # reads one: ten digits, whatever prefix Twilio wrote it with.
17
+ def sender = remove_prefix_from @params['From']
17
18
 
18
19
  # @return [String] documentation URL for given error code.
19
20
  def self.url_for(code)
@@ -1,11 +1,14 @@
1
1
  module Twi
2
2
  class Mock::Phone < Phone
3
+ # Answers whatever the suite arranged, an error before anything else and once only, as the
4
+ # message and the call mocks do: an error left behind would refuse every later number.
3
5
  def create
4
- if Twi.mock.phone
6
+ if error = Twi.mock.phone_error
7
+ Twi.mock.phone_error = nil
8
+ raise Error, error
9
+ elsif Twi.mock.phone
5
10
  @id = Twi.mock.phone[:id]
6
11
  @number = Twi.mock.phone[:number]
7
- elsif Twi.mock.phone_error
8
- raise Error, Twi.mock.phone_error
9
12
  end
10
13
  end
11
14
  end
data/lib/twi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Twi
2
- VERSION = '0.9.0'
2
+ VERSION = '0.9.1'
3
3
  end
data/lib/twi.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'action_controller'
2
2
  require 'action_controller/metal/strong_parameters'
3
+ require 'active_support/core_ext/array/access'
3
4
  require 'active_support/core_ext/enumerable'
4
5
  require 'active_support/core_ext/object/blank'
5
6
  require 'json'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo