silent_bob 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.gitlab-ci.yml +15 -0
- data/.rspec +3 -0
- data/.rubocop.yml +82 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +79 -0
- data/README.md +59 -0
- data/Rakefile +6 -0
- data/bin/console +7 -0
- data/bin/setup +8 -0
- data/lib/silent_bob.rb +22 -0
- data/lib/silent_bob/client.rb +30 -0
- data/lib/silent_bob/configuration.rb +37 -0
- data/lib/silent_bob/configuration_keeper.rb +13 -0
- data/lib/silent_bob/delivery.rb +43 -0
- data/lib/silent_bob/email_sender.rb +51 -0
- data/lib/silent_bob/health_check.rb +29 -0
- data/lib/silent_bob/sms_sender.rb +47 -0
- data/lib/silent_bob/version.rb +3 -0
- data/silent_bob.gemspec +31 -0
- metadata +146 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f354e5012fca522e0cd4020aec9d2dd0a5bddb32543d25456f855d80e22795b2
|
4
|
+
data.tar.gz: 262b628c2a3e53b24e5cb9173db28757c150ac42faeb199e00420df1fa87ad41
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 60242b3925ede51a4e951d7e62b3710edeb19c2cc2a5c8f3466eca2b5b7e7d5c6b470ed8a29b47fcc431287bcdbfb668388b92a117a8e5b3ea384789f7886ed7
|
7
|
+
data.tar.gz: 635cc7f574329818d06277d80e737e9954b8699beceac82287afa13b914bc8be001a95e45a86989b6005df1d5cf30b17f14e0a5ad9db84b510a0d138939f01f4
|
data/.gitignore
ADDED
data/.gitlab-ci.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
stages:
|
2
|
+
- deploy
|
3
|
+
|
4
|
+
publish_gem:
|
5
|
+
stage: deploy
|
6
|
+
image: ruby:2.6.4
|
7
|
+
script:
|
8
|
+
- 'mkdir ~/.gem'
|
9
|
+
- 'echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials'
|
10
|
+
- 'chmod 0600 ~/.gem/credentials'
|
11
|
+
- 'gem build silent_bob'
|
12
|
+
- 'gem push "silent_bob-$(git describe --tags).gem"'
|
13
|
+
allow_failure: true
|
14
|
+
only:
|
15
|
+
- tags
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
- rubocop-rspec
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
TargetRubyVersion: 2.6
|
7
|
+
Exclude:
|
8
|
+
- 'bin/**/*' # Auto-generated
|
9
|
+
|
10
|
+
Metrics/ParameterLists:
|
11
|
+
Max: 7
|
12
|
+
|
13
|
+
RSpec/MultipleMemoizedHelpers:
|
14
|
+
Max: 15
|
15
|
+
|
16
|
+
Layout/LineLength:
|
17
|
+
Max: 100
|
18
|
+
|
19
|
+
Style/Documentation:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Style/ClassAndModuleChildren:
|
23
|
+
EnforcedStyle: nested
|
24
|
+
|
25
|
+
Style/FrozenStringLiteralComment:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
Style/AutoResourceCleanup:
|
29
|
+
Enabled: true
|
30
|
+
|
31
|
+
Style/CollectionMethods:
|
32
|
+
Enabled: true
|
33
|
+
|
34
|
+
Style/MethodCalledOnDoEndBlock:
|
35
|
+
Enabled: true
|
36
|
+
|
37
|
+
Style/OptionHash:
|
38
|
+
Enabled: true
|
39
|
+
|
40
|
+
Metrics/BlockLength:
|
41
|
+
Exclude:
|
42
|
+
- 'spec/**/*.rb'
|
43
|
+
|
44
|
+
Style/BlockDelimiters:
|
45
|
+
Exclude:
|
46
|
+
- 'spec/**/*.rb'
|
47
|
+
|
48
|
+
Bundler/OrderedGems:
|
49
|
+
Enabled: false
|
50
|
+
|
51
|
+
RSpec/NestedGroups:
|
52
|
+
Max: 8
|
53
|
+
|
54
|
+
RSpec/NamedSubject:
|
55
|
+
Enabled: false
|
56
|
+
|
57
|
+
RSpec/MultipleExpectations:
|
58
|
+
Max: 3
|
59
|
+
|
60
|
+
RSpec/LetSetup:
|
61
|
+
Enabled: false
|
62
|
+
|
63
|
+
RSpec/ExampleLength:
|
64
|
+
Max: 10
|
65
|
+
|
66
|
+
Rails/FilePath:
|
67
|
+
EnforcedStyle: arguments
|
68
|
+
|
69
|
+
Lint/RaiseException:
|
70
|
+
Enabled: true
|
71
|
+
|
72
|
+
Lint/StructNewOverride:
|
73
|
+
Enabled: true
|
74
|
+
|
75
|
+
Style/HashEachMethods:
|
76
|
+
Enabled: true
|
77
|
+
|
78
|
+
Style/HashTransformKeys:
|
79
|
+
Enabled: true
|
80
|
+
|
81
|
+
Style/HashTransformValues:
|
82
|
+
Enabled: true
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
silent_bob (0.1.7)
|
5
|
+
http (~> 4.3)
|
6
|
+
mail (~> 2.5)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activesupport (6.0.3.4)
|
12
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
|
+
i18n (>= 0.7, < 2)
|
14
|
+
minitest (~> 5.1)
|
15
|
+
tzinfo (~> 1.1)
|
16
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
17
|
+
addressable (2.7.0)
|
18
|
+
public_suffix (>= 2.0.2, < 5.0)
|
19
|
+
concurrent-ruby (1.1.7)
|
20
|
+
diff-lcs (1.4.4)
|
21
|
+
domain_name (0.5.20190701)
|
22
|
+
unf (>= 0.0.5, < 1.0.0)
|
23
|
+
factory_bot (5.2.0)
|
24
|
+
activesupport (>= 4.2.0)
|
25
|
+
ffi (1.13.1-x64-mingw32)
|
26
|
+
ffi-compiler (1.0.1)
|
27
|
+
ffi (>= 1.0.0)
|
28
|
+
rake
|
29
|
+
http (4.4.1)
|
30
|
+
addressable (~> 2.3)
|
31
|
+
http-cookie (~> 1.0)
|
32
|
+
http-form_data (~> 2.2)
|
33
|
+
http-parser (~> 1.2.0)
|
34
|
+
http-cookie (1.0.3)
|
35
|
+
domain_name (~> 0.5)
|
36
|
+
http-form_data (2.3.0)
|
37
|
+
http-parser (1.2.2)
|
38
|
+
ffi-compiler
|
39
|
+
i18n (1.8.5)
|
40
|
+
concurrent-ruby (~> 1.0)
|
41
|
+
mail (2.7.1)
|
42
|
+
mini_mime (>= 0.1.1)
|
43
|
+
mini_mime (1.0.2)
|
44
|
+
minitest (5.14.2)
|
45
|
+
public_suffix (4.0.6)
|
46
|
+
rake (10.5.0)
|
47
|
+
rspec (3.10.0)
|
48
|
+
rspec-core (~> 3.10.0)
|
49
|
+
rspec-expectations (~> 3.10.0)
|
50
|
+
rspec-mocks (~> 3.10.0)
|
51
|
+
rspec-core (3.10.0)
|
52
|
+
rspec-support (~> 3.10.0)
|
53
|
+
rspec-expectations (3.10.0)
|
54
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
55
|
+
rspec-support (~> 3.10.0)
|
56
|
+
rspec-mocks (3.10.0)
|
57
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
58
|
+
rspec-support (~> 3.10.0)
|
59
|
+
rspec-support (3.10.0)
|
60
|
+
thread_safe (0.3.6)
|
61
|
+
tzinfo (1.2.8)
|
62
|
+
thread_safe (~> 0.1)
|
63
|
+
unf (0.1.4)
|
64
|
+
unf_ext
|
65
|
+
unf_ext (0.0.7.7-x64-mingw32)
|
66
|
+
zeitwerk (2.4.2)
|
67
|
+
|
68
|
+
PLATFORMS
|
69
|
+
x64-mingw32
|
70
|
+
|
71
|
+
DEPENDENCIES
|
72
|
+
bundler (~> 1.17)
|
73
|
+
factory_bot (~> 5.1)
|
74
|
+
rake (~> 10.0)
|
75
|
+
rspec (~> 3.0)
|
76
|
+
silent_bob!
|
77
|
+
|
78
|
+
BUNDLED WITH
|
79
|
+
1.17.3
|
data/README.md
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# SilentBob
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/silent_bob`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'silent_bob'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install silent_bob
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
1: Initialize default config
|
26
|
+
```ruby
|
27
|
+
config = SilentBob::Configuration.new(url: 'http://127.0.0.1:4000', user_name: 'test',
|
28
|
+
password: 'cheburek')
|
29
|
+
SilentBob::ConfigurationKeeper.default_config = config
|
30
|
+
```
|
31
|
+
2: Send email or sms (needed params listed at `initialize` method)
|
32
|
+
```ruby
|
33
|
+
SilentBob::SmsSender.new(to: '78881214455', body: 'sms-text').call
|
34
|
+
```
|
35
|
+
|
36
|
+
## You can always use a custom config when needed.
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
# in this case sms won't be sent instead message will be sent to Slack
|
40
|
+
config = SilentBob::Configuration.new(url: 'http://127.0.0.1:4000', user_name: 'test',
|
41
|
+
password: 'cheburek', slack_replacement: true)
|
42
|
+
SilentBob::SmsSender.new(to: '78881214455', body: 'sms-text', configuration: config).call
|
43
|
+
```
|
44
|
+
|
45
|
+
## ActionMailer delivery
|
46
|
+
|
47
|
+
To connect `SilentBob` to `ActionMailer`
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
ActionMailer::Base.add_delivery_method :revo_jay, SilentBob::Delivery
|
51
|
+
```
|
52
|
+
|
53
|
+
In this case `SilentBob::ConfigurationKeeper.default_config` **must be initialized**
|
54
|
+
|
55
|
+
## Development
|
56
|
+
|
57
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
58
|
+
|
59
|
+
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).
|
data/Rakefile
ADDED
data/bin/console
ADDED
data/bin/setup
ADDED
data/lib/silent_bob.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'silent_bob/version'
|
2
|
+
require 'openssl'
|
3
|
+
require 'http'
|
4
|
+
require 'singleton'
|
5
|
+
require 'base64'
|
6
|
+
require 'silent_bob/configuration'
|
7
|
+
require 'silent_bob/configuration_keeper'
|
8
|
+
require 'silent_bob/delivery'
|
9
|
+
require 'silent_bob/client'
|
10
|
+
require 'silent_bob/email_sender'
|
11
|
+
require 'silent_bob/sms_sender'
|
12
|
+
require 'silent_bob/health_check'
|
13
|
+
|
14
|
+
module SilentBob
|
15
|
+
class Error < StandardError; end
|
16
|
+
|
17
|
+
class ConfigurationNotFound < StandardError; end
|
18
|
+
|
19
|
+
class WrongPhoneNumber < StandardError; end
|
20
|
+
|
21
|
+
Result = Struct.new(:success?, :response, keyword_init: true)
|
22
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module SilentBob
|
2
|
+
class Client
|
3
|
+
attr_reader :configuration, :params
|
4
|
+
|
5
|
+
# Takes configuration and message params(hash)
|
6
|
+
# * <tt>configuration:</tt> `SilentBob::Configuration` object
|
7
|
+
# * <tt>params:</tt> Params represented by `Hash` that would be passed as json params
|
8
|
+
def initialize(configuration:, params:)
|
9
|
+
@configuration = configuration.to_h
|
10
|
+
@params = params
|
11
|
+
end
|
12
|
+
|
13
|
+
def call
|
14
|
+
response = make_request
|
15
|
+
|
16
|
+
Result.new(success?: response.status.success?, response: response.body.to_s)
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def make_request
|
22
|
+
HTTP.basic_auth(configuration[:basic_auth])
|
23
|
+
.post(messages_url, json: params, ssl_context: configuration[:ssl_context])
|
24
|
+
end
|
25
|
+
|
26
|
+
def messages_url
|
27
|
+
"#{configuration[:url]}/messages"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module SilentBob
|
2
|
+
class Configuration
|
3
|
+
CONFIG_OPTIONS = %i[url user_name password slack_replacement ssl_context].freeze
|
4
|
+
|
5
|
+
attr_accessor(*CONFIG_OPTIONS)
|
6
|
+
|
7
|
+
# Takes configuration params to work with SilentBob app
|
8
|
+
# * <tt>url:</tt> Base SilentBob url
|
9
|
+
# * <tt>user_name:</tt> User name for basic auth
|
10
|
+
# * <tt>password:</tt> Password for basic auth
|
11
|
+
# * <tt>slack_replacement:</tt> Flag that tells SmsSender to send message by slack or sms
|
12
|
+
# * <tt>ssl_context:</tt> `OpenSSL::SSL::SSLContext` object
|
13
|
+
def initialize(url:, user_name:, password:, slack_replacement: false, ssl_context: nil)
|
14
|
+
@url = url
|
15
|
+
@user_name = user_name
|
16
|
+
@password = password
|
17
|
+
@slack_replacement = slack_replacement
|
18
|
+
@ssl_context = ssl_context || ssl_no_context
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_h
|
22
|
+
{
|
23
|
+
url: url, slack: slack_replacement,
|
24
|
+
basic_auth: { user: user_name, pass: password },
|
25
|
+
ssl_context: ssl_context
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def ssl_no_context
|
32
|
+
ctx = OpenSSL::SSL::SSLContext.new
|
33
|
+
ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
34
|
+
ctx
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module SilentBob
|
2
|
+
class Delivery
|
3
|
+
def initialize(_) end
|
4
|
+
|
5
|
+
def deliver!(mail)
|
6
|
+
raise ConfigurationNotFound unless ConfigurationKeeper.default_config
|
7
|
+
|
8
|
+
@mail = mail
|
9
|
+
Mail::CheckDeliveryParams.check(mail)
|
10
|
+
|
11
|
+
EmailSender.new(email_params).call
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
attr_reader :mail
|
17
|
+
|
18
|
+
def email_params
|
19
|
+
{
|
20
|
+
to: mail.to.first,
|
21
|
+
subject: mail.subject,
|
22
|
+
from: mail.from.first,
|
23
|
+
body: decoded_mail_body,
|
24
|
+
attachments: convert_attachments,
|
25
|
+
configuration: ConfigurationKeeper.default_config
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
def decoded_mail_body
|
30
|
+
return mail.html_part.decoded if mail.multipart?
|
31
|
+
|
32
|
+
(mail.mime_type =~ %r{^text/html$}i) && mail.body.decoded
|
33
|
+
rescue StandardError
|
34
|
+
nil
|
35
|
+
end
|
36
|
+
|
37
|
+
def convert_attachments
|
38
|
+
mail.attachments&.map do |attachment|
|
39
|
+
{ name: attachment.filename, body: attachment.body }
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module SilentBob
|
2
|
+
class EmailSender
|
3
|
+
MESSAGE_TYPE = 'email'.freeze
|
4
|
+
|
5
|
+
attr_reader :configuration, :subject, :to, :body, :attachments, :from
|
6
|
+
|
7
|
+
# Pass initialization params
|
8
|
+
# * <tt>configuration:</tt> `SilentBob::Configuration` object
|
9
|
+
# * <tt>to:</tt> Recipients email address
|
10
|
+
# * <tt>body:</tt> Email body in html format
|
11
|
+
# * <tt>subject:</tt> Email subject
|
12
|
+
# * <tt>attachments:</tt> Email attachments
|
13
|
+
# * <tt>from:</tt> Author's email address
|
14
|
+
def initialize(subject:, to:, body:, attachments: [], from: nil,
|
15
|
+
configuration: ConfigurationKeeper.default_config)
|
16
|
+
@configuration = configuration
|
17
|
+
@subject = subject
|
18
|
+
@to = to
|
19
|
+
@body = body
|
20
|
+
@attachments = attachments
|
21
|
+
@from = from
|
22
|
+
end
|
23
|
+
|
24
|
+
def call
|
25
|
+
raise ConfigurationNotFound unless configuration
|
26
|
+
|
27
|
+
Client.new(configuration: configuration, params: email_params).call
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def email_params
|
33
|
+
{
|
34
|
+
message_type: MESSAGE_TYPE,
|
35
|
+
message: {
|
36
|
+
subject: subject,
|
37
|
+
to: to,
|
38
|
+
body: body,
|
39
|
+
attachments: handle_attachments(attachments),
|
40
|
+
from: from
|
41
|
+
}.compact
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
def handle_attachments(attachments)
|
46
|
+
attachments&.map do |attachment|
|
47
|
+
{ name: attachment[:name], body: Base64.encode64(attachment[:body]) }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module SilentBob
|
2
|
+
class HealthCheck
|
3
|
+
attr_reader :configuration
|
4
|
+
|
5
|
+
# Takes configuration
|
6
|
+
# * <tt>configuration:</tt> `SilentBob::Configuration` object
|
7
|
+
def initialize(configuration: ConfigurationKeeper.default_config)
|
8
|
+
@configuration = configuration
|
9
|
+
end
|
10
|
+
|
11
|
+
def call
|
12
|
+
raise ConfigurationNotFound unless configuration
|
13
|
+
|
14
|
+
config = configuration.to_h
|
15
|
+
|
16
|
+
response = HTTP
|
17
|
+
.basic_auth(config[:basic_auth])
|
18
|
+
.get(health_check_url(config), ssl_context: config[:ssl_context])
|
19
|
+
|
20
|
+
Result.new(success?: response.status.success?, response: response.body.to_s)
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def health_check_url(config)
|
26
|
+
"#{config[:url]}/health_check"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module SilentBob
|
2
|
+
class SmsSender
|
3
|
+
SMS_MESSAGE_TYPE = 'sms'.freeze
|
4
|
+
SLACK_MESSAGE_TYPE = 'slack'.freeze
|
5
|
+
|
6
|
+
attr_reader :configuration, :to, :body
|
7
|
+
|
8
|
+
# Pass initialization params
|
9
|
+
# * <tt>configuration:</tt> `SilentBob::Configuration` object
|
10
|
+
# * <tt>to:</tt> Mobile phone number (11 digits)
|
11
|
+
# * <tt>body:</tt> Sms message text
|
12
|
+
# === Examples
|
13
|
+
# SilentBob::SmsSender.new(configuration: config, to: '79991231212', body: 'text')
|
14
|
+
def initialize(to:, body:, configuration: ConfigurationKeeper.default_config)
|
15
|
+
@configuration = configuration
|
16
|
+
@to = to
|
17
|
+
@body = body
|
18
|
+
end
|
19
|
+
|
20
|
+
def call
|
21
|
+
raise ConfigurationNotFound unless configuration
|
22
|
+
raise WrongPhoneNumber if wrong_phone?
|
23
|
+
|
24
|
+
Client.new(configuration: configuration, params: sms_params).call
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def sms_params
|
30
|
+
{
|
31
|
+
message_type: message_type,
|
32
|
+
message: {
|
33
|
+
to: to,
|
34
|
+
body: body
|
35
|
+
}
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
def message_type
|
40
|
+
configuration.to_h[:slack] ? SLACK_MESSAGE_TYPE : SMS_MESSAGE_TYPE
|
41
|
+
end
|
42
|
+
|
43
|
+
def wrong_phone?
|
44
|
+
to.length != 11
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/silent_bob.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'silent_bob/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'silent_bob'
|
7
|
+
spec.version = SilentBob::VERSION
|
8
|
+
spec.authors = ['Andrey Lobanov']
|
9
|
+
spec.email = ['soundtechproject@gmail.com']
|
10
|
+
|
11
|
+
spec.summary = 'Gem that provides ability to send messages through SilentBob service'
|
12
|
+
spec.description = ''
|
13
|
+
spec.homepage = 'https://mokka.ru'
|
14
|
+
|
15
|
+
# Specify which files should be added to the gem when it is released.
|
16
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
17
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
18
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
|
+
end
|
20
|
+
spec.bindir = 'exe'
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ['lib']
|
23
|
+
|
24
|
+
spec.add_runtime_dependency 'http', '~> 4.3'
|
25
|
+
spec.add_runtime_dependency 'mail', '~> 2.5'
|
26
|
+
|
27
|
+
spec.add_development_dependency 'bundler', '~> 1.17'
|
28
|
+
spec.add_development_dependency 'factory_bot', '~> 5.1'
|
29
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
30
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: silent_bob
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.7
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andrey Lobanov
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-12-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: http
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.3'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mail
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.5'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.5'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.17'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.17'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: factory_bot
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '5.1'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '5.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '10.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '10.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
description: ''
|
98
|
+
email:
|
99
|
+
- soundtechproject@gmail.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- ".gitignore"
|
105
|
+
- ".gitlab-ci.yml"
|
106
|
+
- ".rspec"
|
107
|
+
- ".rubocop.yml"
|
108
|
+
- Gemfile
|
109
|
+
- Gemfile.lock
|
110
|
+
- README.md
|
111
|
+
- Rakefile
|
112
|
+
- bin/console
|
113
|
+
- bin/setup
|
114
|
+
- lib/silent_bob.rb
|
115
|
+
- lib/silent_bob/client.rb
|
116
|
+
- lib/silent_bob/configuration.rb
|
117
|
+
- lib/silent_bob/configuration_keeper.rb
|
118
|
+
- lib/silent_bob/delivery.rb
|
119
|
+
- lib/silent_bob/email_sender.rb
|
120
|
+
- lib/silent_bob/health_check.rb
|
121
|
+
- lib/silent_bob/sms_sender.rb
|
122
|
+
- lib/silent_bob/version.rb
|
123
|
+
- silent_bob.gemspec
|
124
|
+
homepage: https://mokka.ru
|
125
|
+
licenses: []
|
126
|
+
metadata: {}
|
127
|
+
post_install_message:
|
128
|
+
rdoc_options: []
|
129
|
+
require_paths:
|
130
|
+
- lib
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
requirements: []
|
142
|
+
rubygems_version: 3.0.3
|
143
|
+
signing_key:
|
144
|
+
specification_version: 4
|
145
|
+
summary: Gem that provides ability to send messages through SilentBob service
|
146
|
+
test_files: []
|