botkit 0.0.5 → 0.0.6

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
- SHA1:
3
- metadata.gz: 795ad114beff6d289f8729b704aa0163873bda2f
4
- data.tar.gz: a9113f03cb380b02d6e396f88270528fdf2fae1c
2
+ SHA256:
3
+ metadata.gz: b12004b0814f182efafd158a86f5fef3abbaa00f77e3c62d38fda84c9dd7f6a5
4
+ data.tar.gz: 8c66a5e8c98ab503dd8dfb436fc7d23b525856773ae7c546d9d509472e34f3c6
5
5
  SHA512:
6
- metadata.gz: 507feb6318363e512386acf69ee66deb1748bec48a4b5cbdc91b917c0c1b8f54af5a9fbebc8daa5f0c20aaaf14d62928f01d26e9630d027ec79cef7c4d5b7601
7
- data.tar.gz: 8c429fe82829f4af5260f74e157b014b9400f378d02ae4947a25a5ac440aae0416a30a1280f540c78d4668f4d7ebf45107131ff2bf517e143ba0b5cee726f0e0
6
+ metadata.gz: a8a1cd699b405cc96a6394be63e673ed6665425c5830672913cc5f6b6da981b1ab3d9c35a98d2578d5bfc4aee154b26a65b385c941c9a0673fd711c3523530e9
7
+ data.tar.gz: 0c2b8e81090040681b7282a31d184610f3e38c12c7c1fb8e0ff06a0ef27c13ed70aa8b79171aff3924ef5dff35b50e18542b3ddbb6f6c981dad86c1d3e458c19
data/.rubocop.yml CHANGED
@@ -1,116 +1,9 @@
1
- AllCops:
2
- TargetRubyVersion: 2.4
3
-
4
- Style/Alias:
5
- EnforcedStyle: prefer_alias_method
6
-
7
- Style/FrozenStringLiteralComment:
8
- EnforcedStyle: always
9
-
10
- Style/ClassCheck:
11
- EnforcedStyle: kind_of?
12
-
13
- Metrics/LineLength:
14
- Max: 80
15
-
16
- Style/BlockDelimiters:
17
- Enabled: false
18
-
19
- Style/RegexpLiteral:
20
- Enabled: false
21
-
22
- Metrics/AbcSize:
23
- Enabled: false
24
-
25
- Style/PerlBackrefs:
26
- Enabled: false
27
-
28
- ClassLength:
29
- Enabled: false
30
-
31
- CyclomaticComplexity:
32
- Enabled: false
33
-
34
- Documentation:
35
- Enabled: false
36
-
37
- Encoding:
38
- Enabled: false
39
-
40
- FileName:
41
- Enabled: false
42
-
43
- IfUnlessModifier:
44
- Enabled: false
45
-
46
- MethodLength:
47
- Enabled: false
1
+ ---
2
+ inherit_gem:
3
+ rubocop-fnando: .rubocop.yml
48
4
 
49
- ModuleFunction:
50
- Enabled: false
51
-
52
- OneLineConditional:
53
- Enabled: false
54
-
55
- ParameterLists:
56
- Enabled: false
57
-
58
- Proc:
59
- Enabled: false
60
-
61
- SingleLineBlockParams:
62
- Enabled: false
63
-
64
- VariableInterpolation:
65
- Enabled: false
66
-
67
- Style/TrailingCommaInLiteral:
68
- Enabled: false
69
-
70
- WhileUntilModifier:
71
- Enabled: false
72
-
73
- PredicateName:
74
- NamePrefixBlacklist:
75
- - is_
76
-
77
- StringLiterals:
78
- EnforcedStyle: double_quotes
79
-
80
- DotPosition:
81
- EnforcedStyle: leading
82
-
83
- SpaceBeforeBlockBraces:
84
- EnforcedStyle: space
85
-
86
- SpaceInsideBlockBraces:
87
- EnforcedStyle: no_space
88
-
89
- DoubleNegation:
90
- Enabled: false
91
-
92
- SpaceInsideBlockBraces:
93
- SpaceBeforeBlockParameters: false
5
+ AllCops:
6
+ TargetRubyVersion: 3.0
94
7
 
95
- SpaceInsideHashLiteralBraces:
8
+ Metrics/ParameterLists:
96
9
  Enabled: false
97
-
98
- PercentLiteralDelimiters:
99
- PreferredDelimiters:
100
- '%': '{}'
101
- '%i': '{}'
102
- '%q': '{}'
103
- '%Q': '{}'
104
- '%r': '{}'
105
- '%s': '{}'
106
- '%w': '{}'
107
- '%W': '{}'
108
- '%x': '{}'
109
-
110
- Style/CollectionMethods:
111
- PreferredMethods:
112
- collect: 'map'
113
- collect!: 'map!'
114
- inject: 'reduce'
115
- detect: 'find'
116
- find_all: 'select'
data/CODE_OF_CONDUCT.md CHANGED
@@ -5,30 +5,30 @@
5
5
  In the interest of fostering an open and welcoming environment, we as
6
6
  contributors and maintainers pledge to making participation in our project and
7
7
  our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
8
+ size, disability, ethnicity, gender identity and expression, level of
9
+ experience, nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
11
 
12
12
  ## Our Standards
13
13
 
14
14
  Examples of behavior that contributes to creating a positive environment
15
15
  include:
16
16
 
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
17
+ - Using welcoming and inclusive language
18
+ - Being respectful of differing viewpoints and experiences
19
+ - Gracefully accepting constructive criticism
20
+ - Focusing on what is best for the community
21
+ - Showing empathy towards other community members
22
22
 
23
23
  Examples of unacceptable behavior by participants include:
24
24
 
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
25
+ - The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ - Trolling, insulting/derogatory comments, and personal or political attacks
28
+ - Public or private harassment
29
+ - Publishing others' private information, such as a physical or electronic
30
30
  address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
31
+ - Other conduct which could reasonably be considered inappropriate in a
32
32
  professional setting
33
33
 
34
34
  ## Our Responsibilities
@@ -37,11 +37,11 @@ Project maintainers are responsible for clarifying the standards of acceptable
37
37
  behavior and are expected to take appropriate and fair corrective action in
38
38
  response to any instances of unacceptable behavior.
39
39
 
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
40
+ Project maintainers have the right and responsibility to remove, edit, or reject
41
+ comments, commits, code, wiki edits, issues, and other contributions that are
42
+ not aligned to this Code of Conduct, or to ban temporarily or permanently any
43
+ contributor for other behaviors that they deem inappropriate, threatening,
44
+ offensive, or harmful.
45
45
 
46
46
  ## Scope
47
47
 
@@ -58,8 +58,9 @@ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
58
  reported by contacting the project team at fnando.vieira@gmail.com. All
59
59
  complaints will be reviewed and investigated and will result in a response that
60
60
  is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
61
+ obligated to maintain confidentiality with regard to the reporter of an
62
+ incident. Further details of specific enforcement policies may be posted
63
+ separately.
63
64
 
64
65
  Project maintainers who do not follow or enforce the Code of Conduct in good
65
66
  faith may face temporary or permanent repercussions as determined by other
@@ -67,8 +68,8 @@ members of the project's leadership.
67
68
 
68
69
  ## Attribution
69
70
 
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
71
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
72
+ version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
72
73
 
73
74
  [homepage]: http://contributor-covenant.org
74
75
  [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "https://rubygems.org"
2
4
 
3
5
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
data/Gemfile.lock CHANGED
@@ -1,36 +1,66 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- botkit (0.0.5)
4
+ botkit (0.0.6)
5
5
  aitch
6
- signal
6
+ voltage
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- aitch (1.0.2)
12
- nokogiri (>= 1.6.0)
13
- docile (1.1.5)
14
- json (2.1.0)
15
- metaclass (0.0.4)
16
- mini_portile2 (2.3.0)
17
- minitest (5.10.3)
18
- minitest-utils (0.4.0)
11
+ aitch (1.2.1)
12
+ nokogiri
13
+ ast (2.4.2)
14
+ docile (1.4.0)
15
+ json (2.6.3)
16
+ mini_portile2 (2.8.1)
17
+ minitest (5.16.3)
18
+ minitest-utils (0.4.8)
19
19
  minitest
20
- mocha (1.3.0)
21
- metaclass (~> 0.0.1)
22
- nokogiri (1.8.1)
23
- mini_portile2 (~> 2.3.0)
24
- rake (12.2.1)
25
- signal (1.1.0)
26
- simplecov (0.15.1)
27
- docile (~> 1.1.0)
28
- json (>= 1.8, < 3)
29
- simplecov-html (~> 0.10.0)
30
- simplecov-html (0.10.2)
20
+ mocha (2.0.2)
21
+ ruby2_keywords (>= 0.0.5)
22
+ nokogiri (1.13.10)
23
+ mini_portile2 (~> 2.8.0)
24
+ racc (~> 1.4)
25
+ parallel (1.22.1)
26
+ parser (3.1.3.0)
27
+ ast (~> 2.4.1)
28
+ racc (1.6.2)
29
+ rainbow (3.1.1)
30
+ rake (13.0.6)
31
+ regexp_parser (2.6.1)
32
+ rexml (3.2.5)
33
+ rubocop (1.41.1)
34
+ json (~> 2.3)
35
+ parallel (~> 1.10)
36
+ parser (>= 3.1.2.1)
37
+ rainbow (>= 2.2.2, < 4.0)
38
+ regexp_parser (>= 1.8, < 3.0)
39
+ rexml (>= 3.2.5, < 4.0)
40
+ rubocop-ast (>= 1.23.0, < 2.0)
41
+ ruby-progressbar (~> 1.7)
42
+ unicode-display_width (>= 1.4.0, < 3.0)
43
+ rubocop-ast (1.24.1)
44
+ parser (>= 3.1.1.0)
45
+ rubocop-fnando (0.0.17)
46
+ rubocop
47
+ rubocop-performance
48
+ rubocop-performance (1.15.2)
49
+ rubocop (>= 1.7.0, < 2.0)
50
+ rubocop-ast (>= 0.4.0)
51
+ ruby-progressbar (1.11.0)
52
+ ruby2_keywords (0.0.5)
53
+ simplecov (0.22.0)
54
+ docile (~> 1.1)
55
+ simplecov-html (~> 0.11)
56
+ simplecov_json_formatter (~> 0.1)
57
+ simplecov-html (0.12.3)
58
+ simplecov_json_formatter (0.1.4)
59
+ unicode-display_width (2.3.0)
60
+ voltage (0.1.0)
31
61
 
32
62
  PLATFORMS
33
- ruby
63
+ arm64-darwin-22
34
64
 
35
65
  DEPENDENCIES
36
66
  botkit!
@@ -38,7 +68,8 @@ DEPENDENCIES
38
68
  minitest-utils
39
69
  mocha
40
70
  rake
71
+ rubocop-fnando
41
72
  simplecov
42
73
 
43
74
  BUNDLED WITH
44
- 1.16.0
75
+ 2.4.1
data/README.md CHANGED
@@ -24,18 +24,30 @@ To be written.
24
24
 
25
25
  ## Development
26
26
 
27
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
27
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run
28
+ `rake test` to run the tests. You can also run `bin/console` for an interactive
29
+ prompt that will allow you to experiment.
28
30
 
29
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To
32
+ release a new version, update the version number in `version.rb`, and then run
33
+ `bundle exec rake release`, which will create a git tag for the version, push
34
+ git commits and tags, and push the `.gem` file to
35
+ [rubygems.org](https://rubygems.org).
30
36
 
31
37
  ## Contributing
32
38
 
33
- Bug reports and pull requests are welcome on GitHub at https://github.com/fnando/botkit. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
39
+ Bug reports and pull requests are welcome on GitHub at
40
+ <https://github.com/fnando/botkit>. This project is intended to be a safe,
41
+ welcoming space for collaboration, and contributors are expected to adhere to
42
+ the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
34
43
 
35
44
  ## License
36
45
 
37
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
46
+ The gem is available as open source under the terms of the
47
+ [MIT License](https://opensource.org/licenses/MIT).
38
48
 
39
49
  ## Code of Conduct
40
50
 
41
- Everyone interacting in the Botkit project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/fnando/botkit/blob/master/CODE_OF_CONDUCT.md).
51
+ Everyone interacting in the Botkit project’s codebases, issue trackers, chat
52
+ rooms and mailing lists is expected to follow the
53
+ [code of conduct](https://github.com/fnando/botkit/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "bundler/gem_tasks"
4
4
  require "rake/testtask"
5
+ require "rubocop/rake_task"
5
6
 
6
7
  Rake::TestTask.new(:test) do |t|
7
8
  t.libs << "test"
@@ -9,4 +10,6 @@ Rake::TestTask.new(:test) do |t|
9
10
  t.test_files = FileList["test/**/*_test.rb"]
10
11
  end
11
12
 
12
- task default: :test
13
+ RuboCop::RakeTask.new
14
+
15
+ task default: %i[test rubocop]
data/botkit.gemspec CHANGED
@@ -6,7 +6,9 @@ Gem::Specification.new do |spec|
6
6
  spec.name = "botkit"
7
7
  spec.version = Botkit::VERSION
8
8
  spec.authors = ["Nando Vieira"]
9
- spec.email = ["fnando.vieira@gmail.com"]
9
+ spec.email = ["me@fnando.com"]
10
+ spec.metadata = {"rubygems_mfa_required" => "true"}
11
+ spec.required_ruby_version = ">= 3.0.0"
10
12
 
11
13
  spec.summary = "A simple chatbot framework"
12
14
  spec.description = spec.summary
@@ -21,11 +23,12 @@ Gem::Specification.new do |spec|
21
23
  spec.require_paths = ["lib"]
22
24
 
23
25
  spec.add_dependency "aitch"
24
- spec.add_dependency "signal"
26
+ spec.add_dependency "voltage"
25
27
 
26
28
  spec.add_development_dependency "bundler"
27
29
  spec.add_development_dependency "minitest-utils"
28
30
  spec.add_development_dependency "mocha"
29
31
  spec.add_development_dependency "rake"
32
+ spec.add_development_dependency "rubocop-fnando"
30
33
  spec.add_development_dependency "simplecov"
31
34
  end
data/lib/botkit/bot.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Botkit
4
4
  class Bot
5
- include Signal
5
+ include Voltage
6
6
 
7
7
  # When setting `bot.halt = true`, the bot will be halted
8
8
  # after the current loop.
@@ -37,7 +37,8 @@ module Botkit
37
37
 
38
38
  def parse_message(input)
39
39
  input = input.to_s
40
- _, command, text = *input.match(%r{\A/([^ @]+)(?:@.*?bot)?(?:\s+(.*?))?\z}i)
40
+ _, command, text =
41
+ *input.match(%r{\A/([^ @]+)(?:@.*?bot)?(?:\s+(.*?))?\z}i)
41
42
 
42
43
  {
43
44
  command: command,
@@ -4,7 +4,14 @@ module Botkit
4
4
  class Message
5
5
  attr_reader :text, :command, :raw, :options, :channel_id, :id
6
6
 
7
- def initialize(text:, raw: {}, channel_id: nil, command: nil, options: {}, id: nil)
7
+ def initialize(
8
+ text:,
9
+ raw: {},
10
+ channel_id: nil,
11
+ command: nil,
12
+ options: {},
13
+ id: nil
14
+ )
8
15
  @text = text
9
16
  @command = command
10
17
  @raw = raw
data/lib/botkit/runner.rb CHANGED
@@ -12,15 +12,17 @@ module Botkit
12
12
  def call
13
13
  loop do
14
14
  tick
15
+
15
16
  break if bot.halt?
17
+
16
18
  sleep(polling)
17
19
  end
18
20
  end
19
21
 
20
22
  private def tick
21
23
  bot.call
22
- rescue StandardError => exception
23
- bot.report_exception(exception)
24
+ rescue StandardError => error
25
+ bot.report_exception(error)
24
26
  end
25
27
  end
26
28
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Botkit
4
- VERSION = "0.0.5"
4
+ VERSION = "0.0.6"
5
5
  end
data/lib/botkit.rb CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  module Botkit
4
4
  require "aitch"
5
- require "signal"
5
+ require "voltage"
6
6
 
7
- require "botkit/version"
8
- require "botkit/runner"
9
- require "botkit/message"
10
- require "botkit/bot"
7
+ require_relative "botkit/version"
8
+ require_relative "botkit/runner"
9
+ require_relative "botkit/message"
10
+ require_relative "botkit/bot"
11
11
 
12
12
  def self.run(bot, **kwargs)
13
13
  Runner.new(bot, **kwargs).call
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: botkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-19 00:00:00.000000000 Z
11
+ date: 2022-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aitch
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: signal
28
+ name: voltage
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-fnando
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: simplecov
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -110,14 +124,13 @@ dependencies:
110
124
  version: '0'
111
125
  description: A simple chatbot framework
112
126
  email:
113
- - fnando.vieira@gmail.com
127
+ - me@fnando.com
114
128
  executables: []
115
129
  extensions: []
116
130
  extra_rdoc_files: []
117
131
  files:
118
132
  - ".gitignore"
119
133
  - ".rubocop.yml"
120
- - ".travis.yml"
121
134
  - CODE_OF_CONDUCT.md
122
135
  - Gemfile
123
136
  - Gemfile.lock
@@ -135,8 +148,9 @@ files:
135
148
  homepage: https://rubygems.org/gems/botkit
136
149
  licenses:
137
150
  - MIT
138
- metadata: {}
139
- post_install_message:
151
+ metadata:
152
+ rubygems_mfa_required: 'true'
153
+ post_install_message:
140
154
  rdoc_options: []
141
155
  require_paths:
142
156
  - lib
@@ -144,16 +158,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
144
158
  requirements:
145
159
  - - ">="
146
160
  - !ruby/object:Gem::Version
147
- version: '0'
161
+ version: 3.0.0
148
162
  required_rubygems_version: !ruby/object:Gem::Requirement
149
163
  requirements:
150
164
  - - ">="
151
165
  - !ruby/object:Gem::Version
152
166
  version: '0'
153
167
  requirements: []
154
- rubyforge_project:
155
- rubygems_version: 2.6.13
156
- signing_key:
168
+ rubygems_version: 3.4.1
169
+ signing_key:
157
170
  specification_version: 4
158
171
  summary: A simple chatbot framework
159
172
  test_files: []
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.2
5
- before_install: gem install bundler -v 1.16.0.pre.3