stealth-twilio 1.4.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28f24f9143da55dcd8ffcb8dcedbe92110a1596876ea5b1b583168affaf4dfdf
4
- data.tar.gz: 1f79509e3720968a1d84ad8fc6b7409912117b4306b7a413a30aaecd6c0dbf23
3
+ metadata.gz: d84ff3dca6ea81ab39b215cdc8146be6f88ca60d4f82292fc61ef5b5fd9a7a59
4
+ data.tar.gz: 210fe1c559b74ba67aab9681e81079be78ab68d3134ba1f34eddbf5bb73539e9
5
5
  SHA512:
6
- metadata.gz: fd360ba0993484889a8a31ed05682c890e1222629133f129f975514a556c54b92d613451d3f2252a888336bea576d9d3ab5b620c52bbd105767337b14fe281be
7
- data.tar.gz: 6558cc5fb42451d05130e6c7d7084b199ff1643c1edf5b411d3a33af07b86bf1e576fc8d8d9376a8f49991f04c251f1798274efc0f0f042ebc7f3a2dd4d04f34
6
+ metadata.gz: b33e0f798a22aa0a6547830a75ad364c6bef109b37d3578ad9f67385dbefe333df54b5a774c42dfc905a5ae60c0532583a8be533b9f0ae2b3ba0ac7218b129bf
7
+ data.tar.gz: 645deba043a850d6d4b41c70291fd3de39b19ed5a1fefeea63a8367d5ca0b7c57f3cf0e46c11bc6999c7db6a5d58868b747d2e89597e8454d8a76168e88655a8
@@ -0,0 +1,13 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+
5
+ jobs:
6
+ release:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v3
10
+ - uses: ruby/setup-ruby@v1
11
+ with:
12
+ ruby-version: 2.7
13
+ bundler-cache: true
@@ -0,0 +1,29 @@
1
+ name: Release Gem
2
+ on:
3
+ # Triggers the workflow on push with a tag prefixed with v*
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ # Allows you to run this workflow manually from the Actions tab
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ release:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v3
16
+ - uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: 2.7
19
+ bundler-cache: true
20
+ - name: Publish gem
21
+ env:
22
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
23
+ run: |
24
+ mkdir -p $HOME/.gem
25
+ touch $HOME/.gem/credentials
26
+ chmod 0600 $HOME/.gem/credentials
27
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
28
+ gem build *.gemspec
29
+ gem push *.gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stealth-twilio (1.4.0)
4
+ stealth-twilio (1.6.0)
5
5
  stealth (>= 2.0.0.beta)
6
6
  twilio-ruby (~> 5.5)
7
7
 
@@ -17,22 +17,20 @@ GEM
17
17
  concurrent-ruby (1.1.9)
18
18
  connection_pool (2.2.5)
19
19
  diff-lcs (1.4.4)
20
- faraday (1.3.0)
21
- faraday-net_http (~> 1.0)
22
- multipart-post (>= 1.2, < 3)
23
- ruby2_keywords
24
- faraday-net_http (1.0.1)
20
+ faraday (2.7.1)
21
+ faraday-net_http (>= 2.0, < 3.1)
22
+ ruby2_keywords (>= 0.0.4)
23
+ faraday-net_http (3.0.2)
25
24
  i18n (1.10.0)
26
25
  concurrent-ruby (~> 1.0)
27
- jwt (2.3.0)
26
+ jwt (2.5.0)
28
27
  mini_portile2 (2.8.0)
29
28
  minitest (5.15.0)
30
29
  multi_json (1.15.0)
31
- multipart-post (2.1.1)
32
30
  mustermann (1.1.1)
33
31
  ruby2_keywords (~> 0.0.1)
34
32
  nio4r (2.5.8)
35
- nokogiri (1.13.3)
33
+ nokogiri (1.13.9)
36
34
  mini_portile2 (~> 2.8.0)
37
35
  racc (~> 1.4)
38
36
  puma (5.6.2)
@@ -78,8 +76,8 @@ GEM
78
76
  thor (~> 1.0)
79
77
  thor (1.2.1)
80
78
  tilt (2.0.10)
81
- twilio-ruby (5.65.0)
82
- faraday (>= 0.9, < 2.0)
79
+ twilio-ruby (5.73.3)
80
+ faraday (>= 0.9, < 3.0)
83
81
  jwt (>= 1.5, <= 2.5)
84
82
  nokogiri (>= 1.6, < 2.0)
85
83
  tzinfo (2.0.4)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.0
1
+ 1.6.0
@@ -34,7 +34,7 @@ module Stealth
34
34
  return true if reply.blank?
35
35
 
36
36
  begin
37
- response = twilio_client.messages.create(reply)
37
+ response = twilio_client.messages.create(**reply)
38
38
  rescue ::Twilio::REST::RestError => e
39
39
  case e.message
40
40
  when /21610/ # Attempt to send to unsubscribed recipient
@@ -8,7 +8,7 @@ module Stealth
8
8
 
9
9
  ALPHA_ORDINALS = ('A'..'Z').to_a.freeze
10
10
 
11
- attr_reader :recipient_id, :reply
11
+ attr_reader :recipient_id, :reply, :translated_reply
12
12
 
13
13
  def initialize(recipient_id: nil, reply: nil)
14
14
  @recipient_id = recipient_id
@@ -18,20 +18,20 @@ module Stealth
18
18
  def text
19
19
  check_text_length
20
20
 
21
- translated_reply = reply['text']
21
+ @translated_reply = reply['text']
22
22
 
23
23
  suggestions = generate_suggestions(suggestions: reply['suggestions'])
24
24
  buttons = generate_buttons(buttons: reply['buttons'])
25
25
 
26
26
  if suggestions.present?
27
- translated_reply = [
28
- translated_reply,
27
+ @translated_reply = [
28
+ @translated_reply,
29
29
  'Reply with:'
30
30
  ].join("\n\n")
31
31
 
32
32
  suggestions.each_with_index do |suggestion, i|
33
- translated_reply = [
34
- translated_reply,
33
+ @translated_reply = [
34
+ @translated_reply,
35
35
  "\"#{ALPHA_ORDINALS[i]}\" for #{suggestion}"
36
36
  ].join("\n")
37
37
  end
@@ -39,14 +39,14 @@ module Stealth
39
39
 
40
40
  if buttons.present?
41
41
  buttons.each do |button|
42
- translated_reply = [
43
- translated_reply,
42
+ @translated_reply = [
43
+ @translated_reply,
44
44
  button
45
45
  ].join("\n\n")
46
46
  end
47
47
  end
48
48
 
49
- format_response({ body: translated_reply })
49
+ format_response({ body: @translated_reply })
50
50
  end
51
51
 
52
52
  def image
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stealth-twilio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mauricio Gomes
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-05 00:00:00.000000000 Z
11
+ date: 2022-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: stealth
@@ -86,7 +86,8 @@ executables: []
86
86
  extensions: []
87
87
  extra_rdoc_files: []
88
88
  files:
89
- - ".circleci/config.yml"
89
+ - ".github/workflows/ci.yml"
90
+ - ".github/workflows/release.yml"
90
91
  - ".gitignore"
91
92
  - Gemfile
92
93
  - Gemfile.lock
@@ -107,7 +108,7 @@ homepage: https://github.com/hellostealth/stealth-twilio
107
108
  licenses:
108
109
  - MIT
109
110
  metadata: {}
110
- post_install_message:
111
+ post_install_message:
111
112
  rdoc_options: []
112
113
  require_paths:
113
114
  - lib
@@ -122,10 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
123
  - !ruby/object:Gem::Version
123
124
  version: '0'
124
125
  requirements: []
125
- rubygems_version: 3.2.32
126
- signing_key:
126
+ rubygems_version: 3.1.6
127
+ signing_key:
127
128
  specification_version: 4
128
129
  summary: Stealth Twilio SMS driver
129
- test_files:
130
- - spec/spec_helper.rb
131
- - spec/version_spec.rb
130
+ test_files: []
data/.circleci/config.yml DELETED
@@ -1,60 +0,0 @@
1
- # Ruby CircleCI 2.0 configuration file
2
- #
3
- # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
- #
5
- version: 2
6
- jobs:
7
- build:
8
- docker:
9
- # specify the version you desire here
10
- - image: circleci/ruby:2.4.1-node-browsers
11
- environment:
12
- STEALTH_ENV: test
13
-
14
- # Specify service dependencies here if necessary
15
- # CircleCI maintains a library of pre-built images
16
- # documented at https://circleci.com/docs/2.0/circleci-images/
17
- # - image: circleci/postgres:9.4
18
-
19
- working_directory: ~/repo
20
-
21
- steps:
22
- - checkout
23
-
24
- # Download and cache dependencies
25
- - restore_cache:
26
- keys:
27
- - v1-dependencies-{{ checksum "Gemfile.lock" }}
28
- # fallback to using the latest cache if no exact match is found
29
- - v1-dependencies-
30
-
31
- - run:
32
- name: install dependencies
33
- command: |
34
- bundle install --jobs=4 --retry=3 --path vendor/bundle
35
-
36
- - save_cache:
37
- paths:
38
- - ./vendor/bundle
39
- key: v1-dependencies-{{ checksum "Gemfile.lock" }}
40
-
41
- # run tests!
42
- - run:
43
- name: run tests
44
- command: |
45
- mkdir /tmp/test-results
46
- TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
47
-
48
- bundle exec rspec --format progress \
49
- --format RspecJunitFormatter \
50
- --out /tmp/test-results/rspec.xml \
51
- --format progress \
52
- -- \
53
- $TEST_FILES
54
-
55
- # collect reports
56
- - store_test_results:
57
- path: /tmp/test-results
58
- - store_artifacts:
59
- path: /tmp/test-results
60
- destination: test-results