chat_sdk-twilio 0.7.0 → 0.8.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 +4 -4
- data/lib/chat_sdk/twilio/format_converter.rb +20 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6ff6c4ce7d8c44bd0b6f77ca2c53c7cf85baf1268d3fa34604366294a9a2dbae
|
|
4
|
+
data.tar.gz: db50794cf99b08704523fbc4beb5a738c33ba2066bb0968551d2c20383f31bff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d9d9d6c5b8917df76f121451023698a01528e44fb181e30ff62ac70933e3032a3355dfe7e87e479a7491af196a86294d83df451c79a4f5df9c969e23f6eb775
|
|
7
|
+
data.tar.gz: fe4ac529e7287687f4063c3aa81b4d8be0e5feb4a4aa00dff5eddb93c6038990551479a9c7a27873b432be5fc69cd382cab975d2138151268237990fccc2b227
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ChatSDK
|
|
4
|
+
module Twilio
|
|
5
|
+
class FormatConverter < ChatSDK::Format::Converter
|
|
6
|
+
# Twilio SMS → Markdown (pass-through, SMS is plain text)
|
|
7
|
+
def to_markdown(platform_text)
|
|
8
|
+
platform_text.to_s
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Markdown → Twilio SMS (strip all formatting to plain text)
|
|
12
|
+
def from_markdown(markdown)
|
|
13
|
+
text = markdown.to_s
|
|
14
|
+
return "" if text.empty?
|
|
15
|
+
|
|
16
|
+
strip_markdown(text)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: chat_sdk-twilio
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Quentin Rousseau
|
|
@@ -49,6 +49,7 @@ files:
|
|
|
49
49
|
- lib/chat_sdk/twilio/adapter.rb
|
|
50
50
|
- lib/chat_sdk/twilio/api_client.rb
|
|
51
51
|
- lib/chat_sdk/twilio/event_parser.rb
|
|
52
|
+
- lib/chat_sdk/twilio/format_converter.rb
|
|
52
53
|
- lib/chat_sdk/twilio/signature.rb
|
|
53
54
|
homepage: https://github.com/rootlyhq/chat-sdk
|
|
54
55
|
licenses:
|