socrates 0.1.21 → 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: 0503a47c1d80b9e475aad24753057be5005b8d262b71ba8c7e2f6ad1c21bdbaa
4
- data.tar.gz: cdc9a4f69e52277557ea5501ffb555db1478c932182da7335ef0cb5ce0842260
3
+ metadata.gz: 1b89f3b7fa49fbdb11fc45c55072ac9569af934ef48a1df00f7c800cfd6b5b52
4
+ data.tar.gz: 10cba8ecd0e4a00e229d9fa5367cd8f81a57c23a67ad2bc9e733f5c8949672d9
5
5
  SHA512:
6
- metadata.gz: b10e4449d1f88e9e0ce11f71ba97c2796d811edb670502056b049257a03a84d0c8ff07ed70f3ba8432867c831587c49d10627a36a4fed2406f5b8143382c5e5d
7
- data.tar.gz: d6558e640848fb481c6defeed68313b2f8116f72cb23911c9f5112af008b3abffe1881919bba759b62e7c946c7c4c960e8023860f27e2ece35c6769a2a25ca5d
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.6.1
7
+ - image: circleci/ruby:3.0.0
8
8
  steps:
9
9
  - checkout
10
10
 
@@ -15,7 +15,10 @@ jobs:
15
15
  - gem-cache
16
16
 
17
17
  # Bundle install dependencies and remove any unused gems
18
- - run: bundle install --path vendor/bundle --jobs=4 && bundle clean --force
18
+ - run:
19
+ command: |
20
+ gem install bundler
21
+ bundle install --path vendor/bundle --jobs=4 && bundle clean --force
19
22
 
20
23
  # Store bundle cache
21
24
  - save_cache:
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,5 +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
7
+
8
+ AllCops:
9
+ TargetRubyVersion: 2.5 # this must match gemspec required_ruby_version
10
+
11
+ Naming/VariableNumber:
12
+ Enabled: false
3
13
 
4
- Naming/UncommunicativeMethodParamName:
14
+ Style/AccessorGrouping:
5
15
  Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.1
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
@@ -12,7 +12,7 @@ module StringHelpers
12
12
  # Lifted from Rails' text helpers.
13
13
  def self.pluralize(count, singular, plural_arg = nil, plural: plural_arg)
14
14
  word =
15
- if count == 1 || count =~ /^1(\.0+)?$/
15
+ if count == 1 || count.to_s =~ /^1(\.0+)?$/
16
16
  singular
17
17
  else
18
18
  plural || singular.pluralize
@@ -1,3 +1,3 @@
1
1
  module Socrates
2
- VERSION = "0.1.21"
2
+ VERSION = "0.1.26"
3
3
  end
data/socrates.gemspec CHANGED
@@ -12,6 +12,7 @@ Gem::Specification.new do |spec|
12
12
 
13
13
  spec.summary = "A micro-framework for building stateful conversational bots."
14
14
  spec.homepage = "https://github.com/carbonfive/socrates"
15
+ spec.metadata = { "source_code_uri" => "https://github.com/carbonfive/socrates" }
15
16
 
16
17
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
18
  f.match(%r{^(test|spec|features)/})
@@ -21,18 +22,19 @@ Gem::Specification.new do |spec|
21
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
23
  spec.require_paths = ["lib"]
23
24
 
24
- spec.required_ruby_version = ">= 2.4.0"
25
+ spec.required_ruby_version = ">= 2.5.0"
25
26
 
26
- spec.add_development_dependency "bundler", "~> 1.17"
27
- spec.add_development_dependency "rake", "~> 12.3"
28
- spec.add_development_dependency "rspec", "~> 3.8"
29
- spec.add_development_dependency "rubocop", "= 0.65.0"
27
+ spec.add_development_dependency "bundler", "~> 2.2"
28
+ spec.add_development_dependency "rake", "~> 13.0"
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"
30
32
  spec.add_development_dependency "simplecov", "~> 0.16"
31
33
  spec.add_development_dependency "timecop", "~> 0.9"
32
34
 
33
35
  spec.add_dependency "activesupport", ">= 5.2"
34
- spec.add_dependency "async-websocket", ">= 0.7"
36
+ spec.add_dependency "async-websocket", "~> 0.8.0"
35
37
  spec.add_dependency "hashie", ">= 3.6"
36
- spec.add_dependency "redis", ">= 4.1"
37
- spec.add_dependency "slack-ruby-client", ">= 0.14.1"
38
+ spec.add_dependency "redis", ">= 4.2.5"
39
+ spec.add_dependency "slack-ruby-client", ">= 0.15.1"
38
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.21
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: 2019-02-28 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,56 +16,70 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.17'
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: '1.17'
26
+ version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '12.3'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '12.3'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
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.65.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.65.0
68
+ version: 1.11.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop-performance
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: 1.10.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: 1.10.1
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: simplecov
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -112,16 +126,16 @@ dependencies:
112
126
  name: async-websocket
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
- - - ">="
129
+ - - "~>"
116
130
  - !ruby/object:Gem::Version
117
- version: '0.7'
131
+ version: 0.8.0
118
132
  type: :runtime
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
- - - ">="
136
+ - - "~>"
123
137
  - !ruby/object:Gem::Version
124
- version: '0.7'
138
+ version: 0.8.0
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: hashie
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -142,29 +156,29 @@ dependencies:
142
156
  requirements:
143
157
  - - ">="
144
158
  - !ruby/object:Gem::Version
145
- version: '4.1'
159
+ version: 4.2.5
146
160
  type: :runtime
147
161
  prerelease: false
148
162
  version_requirements: !ruby/object:Gem::Requirement
149
163
  requirements:
150
164
  - - ">="
151
165
  - !ruby/object:Gem::Version
152
- version: '4.1'
166
+ version: 4.2.5
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: slack-ruby-client
155
169
  requirement: !ruby/object:Gem::Requirement
156
170
  requirements:
157
171
  - - ">="
158
172
  - !ruby/object:Gem::Version
159
- version: 0.14.1
173
+ version: 0.15.1
160
174
  type: :runtime
161
175
  prerelease: false
162
176
  version_requirements: !ruby/object:Gem::Requirement
163
177
  requirements:
164
178
  - - ">="
165
179
  - !ruby/object:Gem::Version
166
- version: 0.14.1
167
- description:
180
+ version: 0.15.1
181
+ description:
168
182
  email:
169
183
  - christian@carbonfive.com
170
184
  executables:
@@ -209,8 +223,9 @@ files:
209
223
  homepage: https://github.com/carbonfive/socrates
210
224
  licenses:
211
225
  - MIT
212
- metadata: {}
213
- post_install_message:
226
+ metadata:
227
+ source_code_uri: https://github.com/carbonfive/socrates
228
+ post_install_message:
214
229
  rdoc_options: []
215
230
  require_paths:
216
231
  - lib
@@ -218,15 +233,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
218
233
  requirements:
219
234
  - - ">="
220
235
  - !ruby/object:Gem::Version
221
- version: 2.4.0
236
+ version: 2.5.0
222
237
  required_rubygems_version: !ruby/object:Gem::Requirement
223
238
  requirements:
224
239
  - - ">="
225
240
  - !ruby/object:Gem::Version
226
241
  version: '0'
227
242
  requirements: []
228
- rubygems_version: 3.0.1
229
- signing_key:
243
+ rubygems_version: 3.2.3
244
+ signing_key:
230
245
  specification_version: 4
231
246
  summary: A micro-framework for building stateful conversational bots.
232
247
  test_files: []