socrates 0.1.25 → 0.1.26

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: e0c30291ba5c50a38506a90ad16a3f95c3def79c9f89b61ea5516a2aac2f4a04
4
- data.tar.gz: 505bc91dce949079bda12b3cf501ecedfa98d9feb29275c2e1b5d1b8e89eec18
3
+ metadata.gz: 1b89f3b7fa49fbdb11fc45c55072ac9569af934ef48a1df00f7c800cfd6b5b52
4
+ data.tar.gz: 10cba8ecd0e4a00e229d9fa5367cd8f81a57c23a67ad2bc9e733f5c8949672d9
5
5
  SHA512:
6
- metadata.gz: 13abb8fa29a5780db603f590bfa60fbe584b8e6137e5f42814452eb9b008f4d1c3a218e43d10b8641a3826c4cfc7249e28c74d219a0a0fa801395d25a565ce56
7
- data.tar.gz: 62f8c97970506a2d4bd4418fba74416adfee0ea4d568ace41377dd7721da19936f9b81d7be6e517ca729bbb30b9794c5ffcb028664ed80352c95ef859b10d3bb
6
+ metadata.gz: 8a433c69eb83c9dd8bd701ff2f77797cec8034aa0ff4919facbd45881c67cf2faebce030fbb730661d944505c048d19519fcd8d9b0d893afee7f19eb36cd8841
7
+ data.tar.gz: 40541d66d832555cac31a29245bcf980e80f86822ae5716a53b91882e80de4b70f75c1a6c0e42d0279b1e6140921abf838e2ec067bf86503c1b7de01d9f75342
data/.circleci/config.yml CHANGED
@@ -4,7 +4,7 @@ jobs:
4
4
  parallelism: 1
5
5
  working_directory: ~/socrates
6
6
  docker:
7
- - image: circleci/ruby:2.7.0
7
+ - image: circleci/ruby:3.0.0
8
8
  steps:
9
9
  - checkout
10
10
 
data/.gitignore CHANGED
@@ -7,7 +7,7 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
- /.rubocop-https---raw-githubusercontent-com-carbonfive-c5-conventions-master-rubocop-rubocop-yml
10
+ /.rubocop-https---*
11
11
  /socrates-*.gem
12
12
 
13
13
  # rspec failure tracking
data/.rubocop.yml CHANGED
@@ -1,8 +1,15 @@
1
+ require:
2
+ - rubocop-performance
3
+
1
4
  inherit_from:
2
- - https://raw.githubusercontent.com/carbonfive/c5-conventions/master/rubocop/rubocop.yml
5
+ - https://raw.githubusercontent.com/carbonfive/c5-conventions/main/rubocop/.rubocop-common.yml
6
+ - https://raw.githubusercontent.com/carbonfive/c5-conventions/main/rubocop/.rubocop-performance.yml
3
7
 
4
8
  AllCops:
5
- TargetRubyVersion: 2.4
9
+ TargetRubyVersion: 2.5 # this must match gemspec required_ruby_version
10
+
11
+ Naming/VariableNumber:
12
+ Enabled: false
6
13
 
7
- Naming/MethodParameterName:
14
+ Style/AccessorGrouping:
8
15
  Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.0
1
+ 3.0.0
@@ -4,9 +4,7 @@ module Socrates
4
4
  module Adapters
5
5
  module Adapter
6
6
  # Many of the methods in the Adapter module serve as an interface for Adapter implementations to
7
- # implement. We want to serve as an example, even if we don't provide implementations here. Therefor,
8
- # we're disabling this cop to avoid its warnings.
9
- # rubocop:disable Lint/UnusedMethodArgument
7
+ # implement. We want to serve as an example, even if we don't provide implementations here.
10
8
 
11
9
  def client_id_from(context: nil, user: nil)
12
10
  raise NotImplementedError
@@ -59,8 +57,6 @@ module Socrates
59
57
  def lookup_email(*)
60
58
  raise NotImplementedError
61
59
  end
62
-
63
- # rubocop:enable Lint/UnusedMethodArgument
64
60
  end
65
61
  end
66
62
  end
@@ -73,7 +73,7 @@ module Socrates
73
73
  return im if im.present?
74
74
 
75
75
  # Start a new conversation with this user.
76
- response = @real_time_client.web_client.im_open(user: user.id)
76
+ response = @real_time_client.web_client.conversations_open(users: user.id)
77
77
  response.channel.id
78
78
  end
79
79
  end
@@ -4,7 +4,7 @@ require "socrates/core/dispatcher"
4
4
  module Socrates
5
5
  module Bots
6
6
  class CLI
7
- def initialize(adapter: nil, state_factory:)
7
+ def initialize(state_factory:, adapter: nil)
8
8
  @adapter = adapter || Adapters::Console.new
9
9
  @dispatcher = Core::Dispatcher.new(adapter: @adapter, state_factory: state_factory)
10
10
  end
@@ -9,7 +9,7 @@ module Socrates
9
9
  def initialize(state_factory:)
10
10
  ::Slack.configure do |config|
11
11
  config.token = ENV["SLACK_API_TOKEN"]
12
- config.logger = Logger.new(STDOUT)
12
+ config.logger = Logger.new($stdout)
13
13
  config.logger.level = Logger::INFO
14
14
 
15
15
  raise "Missing ENV['SLACK_API_TOKEN']!" unless config.token
@@ -3,7 +3,7 @@ module Socrates
3
3
  class Slack
4
4
  class Ping
5
5
  def initialize
6
- logger = Logger.new(STDOUT)
6
+ logger = Logger.new($stdout)
7
7
  # The ping is going to run every minute, so don't be too chatty
8
8
  logger.level = Logger::WARN
9
9
 
@@ -25,8 +25,8 @@ module Socrates
25
25
  @error_message = "Sorry, something went wrong. We'll have to start over..."
26
26
  @expired_timeout = 30.minutes
27
27
  @logger = Socrates::Logger.default
28
- @error_handler = proc { |_message, _error| }
29
- @warn_handler = proc { |_message| }
28
+ @error_handler = proc { |_message, _error| } # rubocop:disable Lint/EmptyBlock
29
+ @warn_handler = proc { |_message| } # rubocop:disable Lint/EmptyBlock
30
30
  end
31
31
  end
32
32
  end
@@ -11,7 +11,7 @@ module Socrates
11
11
  module State
12
12
  attr_reader :data, :adapter, :session, :user
13
13
 
14
- def initialize(data: StateData.new, adapter:, session:)
14
+ def initialize(adapter:, session:, data: StateData.new)
15
15
  @data = data
16
16
  @adapter = adapter
17
17
  @session = session
@@ -4,7 +4,7 @@ module Socrates
4
4
  class Logger < ::Logger
5
5
  def self.default
6
6
  @default ||= begin
7
- logger = new(STDOUT)
7
+ logger = new($stdout)
8
8
  logger.level = Logger::WARN
9
9
  logger
10
10
  end
@@ -12,7 +12,7 @@ module Socrates
12
12
  end
13
13
 
14
14
  def has_key?(key)
15
- @redis.exists(key)
15
+ @redis.exists?(key)
16
16
  end
17
17
 
18
18
  def clear(key)
@@ -32,8 +32,6 @@ module Socrates
32
32
  client_id
33
33
  end
34
34
 
35
- # rubocop:disable Lint/UnusedMethodArgument
36
-
37
35
  def has_key?(key)
38
36
  raise NotImplementedError
39
37
  end
@@ -53,8 +51,6 @@ module Socrates
53
51
  def clear_all
54
52
  raise NotImplementedError
55
53
  end
56
-
57
- # rubocop:enable Lint/UnusedMethodArgument
58
54
  end
59
55
  end
60
56
  end
@@ -1,3 +1,3 @@
1
1
  module Socrates
2
- VERSION = "0.1.25"
2
+ VERSION = "0.1.26"
3
3
  end
data/socrates.gemspec CHANGED
@@ -22,19 +22,19 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ["lib"]
24
24
 
25
- spec.required_ruby_version = ">= 2.4.0"
25
+ spec.required_ruby_version = ">= 2.5.0"
26
26
 
27
- spec.add_development_dependency "bundler", "~> 2.1.2"
27
+ spec.add_development_dependency "bundler", "~> 2.2"
28
28
  spec.add_development_dependency "rake", "~> 13.0"
29
- spec.add_development_dependency "rspec", "~> 3.8"
30
- spec.add_development_dependency "rubocop", "= 0.77.0"
31
- spec.add_development_dependency "rubocop-performance", "= 1.5.1"
29
+ spec.add_development_dependency "rspec", "~> 3.10"
30
+ spec.add_development_dependency "rubocop", "= 1.11.0"
31
+ spec.add_development_dependency "rubocop-performance", "= 1.10.1"
32
32
  spec.add_development_dependency "simplecov", "~> 0.16"
33
33
  spec.add_development_dependency "timecop", "~> 0.9"
34
34
 
35
35
  spec.add_dependency "activesupport", ">= 5.2"
36
- spec.add_dependency "async-websocket", ">= 0.8", "< 0.14"
36
+ spec.add_dependency "async-websocket", "~> 0.8.0"
37
37
  spec.add_dependency "hashie", ">= 3.6"
38
- spec.add_dependency "redis", ">= 4.1"
39
- spec.add_dependency "slack-ruby-client", ">= 0.14.4"
38
+ spec.add_dependency "redis", ">= 4.2.5"
39
+ spec.add_dependency "slack-ruby-client", ">= 0.15.1"
40
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socrates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.25
4
+ version: 0.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Nelson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-02 00:00:00.000000000 Z
11
+ date: 2021-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.1.2
19
+ version: '2.2'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.1.2
26
+ version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,42 +44,42 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.8'
47
+ version: '3.10'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.8'
54
+ version: '3.10'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rubocop
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.77.0
61
+ version: 1.11.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 0.77.0
68
+ version: 1.11.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rubocop-performance
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 1.5.1
75
+ version: 1.10.1
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 1.5.1
82
+ version: 1.10.1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: simplecov
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -126,22 +126,16 @@ dependencies:
126
126
  name: async-websocket
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0.8'
132
- - - "<"
129
+ - - "~>"
133
130
  - !ruby/object:Gem::Version
134
- version: '0.14'
131
+ version: 0.8.0
135
132
  type: :runtime
136
133
  prerelease: false
137
134
  version_requirements: !ruby/object:Gem::Requirement
138
135
  requirements:
139
- - - ">="
140
- - !ruby/object:Gem::Version
141
- version: '0.8'
142
- - - "<"
136
+ - - "~>"
143
137
  - !ruby/object:Gem::Version
144
- version: '0.14'
138
+ version: 0.8.0
145
139
  - !ruby/object:Gem::Dependency
146
140
  name: hashie
147
141
  requirement: !ruby/object:Gem::Requirement
@@ -162,29 +156,29 @@ dependencies:
162
156
  requirements:
163
157
  - - ">="
164
158
  - !ruby/object:Gem::Version
165
- version: '4.1'
159
+ version: 4.2.5
166
160
  type: :runtime
167
161
  prerelease: false
168
162
  version_requirements: !ruby/object:Gem::Requirement
169
163
  requirements:
170
164
  - - ">="
171
165
  - !ruby/object:Gem::Version
172
- version: '4.1'
166
+ version: 4.2.5
173
167
  - !ruby/object:Gem::Dependency
174
168
  name: slack-ruby-client
175
169
  requirement: !ruby/object:Gem::Requirement
176
170
  requirements:
177
171
  - - ">="
178
172
  - !ruby/object:Gem::Version
179
- version: 0.14.4
173
+ version: 0.15.1
180
174
  type: :runtime
181
175
  prerelease: false
182
176
  version_requirements: !ruby/object:Gem::Requirement
183
177
  requirements:
184
178
  - - ">="
185
179
  - !ruby/object:Gem::Version
186
- version: 0.14.4
187
- description:
180
+ version: 0.15.1
181
+ description:
188
182
  email:
189
183
  - christian@carbonfive.com
190
184
  executables:
@@ -231,7 +225,7 @@ licenses:
231
225
  - MIT
232
226
  metadata:
233
227
  source_code_uri: https://github.com/carbonfive/socrates
234
- post_install_message:
228
+ post_install_message:
235
229
  rdoc_options: []
236
230
  require_paths:
237
231
  - lib
@@ -239,15 +233,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
239
233
  requirements:
240
234
  - - ">="
241
235
  - !ruby/object:Gem::Version
242
- version: 2.4.0
236
+ version: 2.5.0
243
237
  required_rubygems_version: !ruby/object:Gem::Requirement
244
238
  requirements:
245
239
  - - ">="
246
240
  - !ruby/object:Gem::Version
247
241
  version: '0'
248
242
  requirements: []
249
- rubygems_version: 3.1.2
250
- signing_key:
243
+ rubygems_version: 3.2.3
244
+ signing_key:
251
245
  specification_version: 4
252
246
  summary: A micro-framework for building stateful conversational bots.
253
247
  test_files: []