stealth 2.0.0.beta2 → 2.0.0.beta3

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: acde4522ee0154ec5557379bfd1fa928e89771637e4c3dd99880adb624b7c2f7
4
- data.tar.gz: f30cc740eb9c40fb90c19cbe35a27cf12ce24209245813d338db25df61ca238a
3
+ metadata.gz: f7769a4954530dd2ea5b68d22a05488423d66e464f9ef5863eb26b58a9a8441e
4
+ data.tar.gz: 10b939107c4df107172d64fb14f2e4406ad50597841e2eb76ebe4f31f4eb9f73
5
5
  SHA512:
6
- metadata.gz: 63ad339fe8d1473ab1118eef9279cf66f1a895748fe61ca7671d49ca8de635fe27f9e4f200c1ae05523501f62e135eb4147d3609f9550c920311498a7abfa26c
7
- data.tar.gz: cbcc9083bb56acc3d30aedbcc6a853fb71cf5a57b0586e81b586c36d1f186c5bc39cf5acf6d03768c86c486c7a6ff987ca5e151248cf43c34b70b21778c285ef
6
+ metadata.gz: 7c4aa16fb304ac4a9b78c5ab470b19a93bf2ea085fb767bc73d3cb6f73a6ce25b065242d933fc7d6635c8411dd2e7e8b1e538912fe521a5c9b8a81ffc9225473
7
+ data.tar.gz: ad6ae7e02a9c8e2c1f10732ad368d6eafbab698c361d3003bd2a0e8faacf3c6188de100d2bbc09577ac61546b98c1c66f3faa2af03b0d73f1f18a4d9d41c2ab4
data/.circleci/config.yml CHANGED
@@ -108,9 +108,64 @@ jobs:
108
108
  path: /tmp/test-results
109
109
  destination: test-results
110
110
 
111
+ ruby_3_0:
112
+ docker:
113
+ - image: circleci/ruby:3.0-node-browsers
114
+ environment:
115
+ STEALTH_ENV: test
116
+
117
+ working_directory: ~/repo
118
+
119
+ steps:
120
+ - checkout
121
+
122
+ # Download and cache dependencies
123
+ - restore_cache:
124
+ keys:
125
+ - v1-dependencies-{{ checksum "Gemfile.lock" }}
126
+ # fallback to using the latest cache if no exact match is found
127
+ - v1-dependencies-
128
+ - run:
129
+ name: Configure Bundler
130
+ command: |
131
+ echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
132
+ source $BASH_ENV
133
+ gem install bundler
134
+ - run:
135
+ name: install dependencies
136
+ command: |
137
+ bundle install --jobs=4 --retry=3 --path vendor/bundle
138
+
139
+ - save_cache:
140
+ paths:
141
+ - ./vendor/bundle
142
+ key: v1-dependencies-{{ checksum "Gemfile.lock" }}
143
+
144
+ # run tests!
145
+ - run:
146
+ name: run tests
147
+ command: |
148
+ mkdir /tmp/test-results
149
+ TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
150
+
151
+ bundle exec rspec --format progress \
152
+ --format RspecJunitFormatter \
153
+ --out /tmp/test-results/rspec.xml \
154
+ --format progress \
155
+ -- \
156
+ $TEST_FILES
157
+
158
+ # collect reports
159
+ - store_test_results:
160
+ path: /tmp/test-results
161
+ - store_artifacts:
162
+ path: /tmp/test-results
163
+ destination: test-results
164
+
111
165
  workflows:
112
166
  version: 2
113
167
  build:
114
168
  jobs:
115
169
  - ruby_2_6
116
170
  - ruby_2_7
171
+ - ruby_3_0
data/CHANGELOG.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## Enhancements
4
4
 
5
+ * Added support for Ruby 3.0
5
6
  * [Controllers] Added support for Dev Jumping. This feature allows developers to jump around flows and states for bot's in development.
6
7
  * [NLP] Added base classes for `Stealth::Nlp::Result` and `Stealth::Nlp::Client` to be used by NLP drivers.
7
8
  * [Controllers] Scheduled replies no longer call `controller.route` when they run. Instead we `step_to` to the flow and state directly. This ensures the `route` is reserved for incoming messages.
@@ -13,7 +14,8 @@
13
14
  * [Logging] `primary_session`, `previous_session`, and `back_to_session` now explicitly logged
14
15
  * [Sessions] The session is no longer set on update or stepping witht destination flow and state match the existing session.
15
16
  * [Scheduled Replies] The `service_message.target_id` is now set for scheduled replies. NOTE: scheduled replies that are already enqueued will NOT have this set.
16
- * [Server] Updated to Puma 4.3
17
+ * [Server] Updated to Puma 5.5
18
+ * [Server] Updated to Sidekiq 6.3
17
19
  * [Server] Updated to Sinatra 2.1
18
20
  * [Sessions] Added `to_s` for sessions to pretty print the slug. Useful when debugging.
19
21
  * `send_reples` now supports two additional options for replies:
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stealth (2.0.0.beta2)
4
+ stealth (2.0.0.beta3)
5
5
  activesupport (~> 6.0)
6
6
  multi_json (~> 1.12)
7
- puma (>= 4.2, < 5.0)
7
+ puma (>= 4.2, < 6.0)
8
8
  sidekiq (~> 6.0)
9
9
  sinatra (~> 2.0)
10
10
  thor (~> 1.0)
@@ -12,32 +12,32 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (6.1.0)
15
+ activesupport (6.1.4.1)
16
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
17
  i18n (>= 1.6, < 2)
18
18
  minitest (>= 5.1)
19
19
  tzinfo (~> 2.0)
20
20
  zeitwerk (~> 2.3)
21
- concurrent-ruby (1.1.7)
22
- connection_pool (2.2.3)
21
+ concurrent-ruby (1.1.9)
22
+ connection_pool (2.2.5)
23
23
  diff-lcs (1.3)
24
- i18n (1.8.5)
24
+ i18n (1.8.11)
25
25
  concurrent-ruby (~> 1.0)
26
- minitest (5.14.2)
26
+ minitest (5.14.4)
27
27
  mock_redis (0.23.0)
28
28
  multi_json (1.15.0)
29
29
  mustermann (1.1.1)
30
30
  ruby2_keywords (~> 0.0.1)
31
- nio4r (2.5.4)
31
+ nio4r (2.5.8)
32
32
  oj (3.10.6)
33
- puma (4.3.7)
33
+ puma (5.5.2)
34
34
  nio4r (~> 2.0)
35
35
  rack (2.2.3)
36
36
  rack-protection (2.1.0)
37
37
  rack
38
38
  rack-test (1.1.0)
39
39
  rack (>= 1.0, < 3)
40
- redis (4.2.5)
40
+ redis (4.5.1)
41
41
  rspec (3.9.0)
42
42
  rspec-core (~> 3.9.0)
43
43
  rspec-expectations (~> 3.9.0)
@@ -53,8 +53,8 @@ GEM
53
53
  rspec-support (3.9.2)
54
54
  rspec_junit_formatter (0.4.1)
55
55
  rspec-core (>= 2, < 4, != 2.12.0)
56
- ruby2_keywords (0.0.2)
57
- sidekiq (6.1.2)
56
+ ruby2_keywords (0.0.5)
57
+ sidekiq (6.3.1)
58
58
  connection_pool (>= 2.2.2)
59
59
  rack (~> 2.0)
60
60
  redis (>= 4.2.0)
@@ -63,11 +63,11 @@ GEM
63
63
  rack (~> 2.2)
64
64
  rack-protection (= 2.1.0)
65
65
  tilt (~> 2.0)
66
- thor (1.0.1)
66
+ thor (1.1.0)
67
67
  tilt (2.0.10)
68
- tzinfo (2.0.3)
68
+ tzinfo (2.0.4)
69
69
  concurrent-ruby (~> 1.0)
70
- zeitwerk (2.4.2)
70
+ zeitwerk (2.5.1)
71
71
 
72
72
  PLATFORMS
73
73
  ruby
@@ -81,4 +81,4 @@ DEPENDENCIES
81
81
  stealth!
82
82
 
83
83
  BUNDLED WITH
84
- 2.1.4
84
+ 2.2.32
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2017-2020 Mauricio Gomes, Mav Automation Ventures Inc.
1
+ Copyright (c) 2017-2020 Mauricio Gomes
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
data/README.md CHANGED
@@ -52,4 +52,4 @@ Stealth is versioned using [Semantic Versioning](https://semver.org), but it's m
52
52
 
53
53
  ## License
54
54
 
55
- "Stealth" and the Stealth logo are Copyright (c) 2020 Mauricio Gomes and Mav Automation Ventures Inc.
55
+ "Stealth" and the Stealth logo are Copyright (c) 2020 Mauricio Gomes
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0.beta2
1
+ 2.0.0.beta3
@@ -238,7 +238,8 @@ module Stealth
238
238
  else
239
239
  Stealth::Logger.l(
240
240
  topic: :err,
241
- message: "User #{current_session_id} unhandled exception due to invalid session_id."
241
+ message: "User #{current_session_id} unhandled exception due to an " \
242
+ "invalid session_id. [#{msg}]"
242
243
  )
243
244
  end
244
245
 
@@ -44,6 +44,11 @@ module Stealth
44
44
  headers: get_helpers_from_request(request)
45
45
  )
46
46
 
47
+ headers 'Access-Control-Allow-Origin' => '*',
48
+ 'Access-Control-Allow-Methods' => ['OPTIONS', 'GET', 'POST']
49
+ # content_type 'audio/mp3'
50
+ content_type 'application/octet-stream'
51
+
47
52
  dispatcher.coordinate
48
53
  end
49
54
 
@@ -115,7 +115,13 @@ describe "Stealth::Controller::CatchAll" do
115
115
  end
116
116
 
117
117
  it "should log the error message" do
118
- expect(Stealth::Logger).to receive(:l).with(topic: 'catch_all', message: "[Level 1] for user #{facebook_message.sender_id} OpenStruct\noops\n/stealth/lib/stealth/controller/controller.rb\n/stealth/lib/stealth/controller/catch_all.rb")
118
+ err_klass = if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.0.0')
119
+ "RuntimeError"
120
+ else
121
+ "OpenStruct"
122
+ end
123
+
124
+ expect(Stealth::Logger).to receive(:l).with(topic: 'catch_all', message: "[Level 1] for user #{facebook_message.sender_id} #{err_klass}\noops\n/stealth/lib/stealth/controller/controller.rb\n/stealth/lib/stealth/controller/catch_all.rb")
119
125
  expect(Stealth::Logger).to receive(:l).with(topic: 'catch_all', message: "CatchAll triggered for user #{facebook_message.sender_id} from within CatchAll; ignoring.")
120
126
  controller.run_catch_all(err: e)
121
127
  end
@@ -659,7 +659,7 @@ describe "Stealth::Controller replies" do
659
659
  it "should log the unhandled exception if the controller does not have a handle_invalid_session_id method" do
660
660
  expect(Stealth::Logger).to receive(:l).with(
661
661
  topic: :err,
662
- message: "User #{facebook_message.sender_id} unhandled exception due to invalid session_id."
662
+ message: "User #{facebook_message.sender_id} unhandled exception due to an invalid session_id. [boom]"
663
663
  )
664
664
  expect(controller).to receive(:do_nothing)
665
665
  controller.say_offer
data/stealth.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.email = 'mauricio@edge14.com'
14
14
 
15
15
  s.add_dependency 'sinatra', '~> 2.0'
16
- s.add_dependency 'puma', '>= 4.2', '< 5.0'
16
+ s.add_dependency 'puma', '>= 4.2', '< 6.0'
17
17
  s.add_dependency 'thor', '~> 1.0'
18
18
  s.add_dependency 'multi_json', '~> 1.12'
19
19
  s.add_dependency 'sidekiq', '~> 6.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stealth
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta2
4
+ version: 2.0.0.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mauricio Gomes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-12-09 00:00:00.000000000 Z
12
+ date: 2021-12-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
@@ -34,7 +34,7 @@ dependencies:
34
34
  version: '4.2'
35
35
  - - "<"
36
36
  - !ruby/object:Gem::Version
37
- version: '5.0'
37
+ version: '6.0'
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: '4.2'
45
45
  - - "<"
46
46
  - !ruby/object:Gem::Version
47
- version: '5.0'
47
+ version: '6.0'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: thor
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -327,7 +327,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
327
327
  - !ruby/object:Gem::Version
328
328
  version: 1.3.1
329
329
  requirements: []
330
- rubygems_version: 3.1.2
330
+ rubygems_version: 3.2.32
331
331
  signing_key:
332
332
  specification_version: 4
333
333
  summary: Ruby framework for conversational bots