hey-you 1.0.1 → 1.3.2

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: aa6f17fe4c0da43b871befcc3b590393cc49ffd96fdd4191ac330a39a3663d1f
4
- data.tar.gz: 25e6a567dc7dcfbef8d1f90ad3fd2d6c5aa7e0e837ce674dc4319e6cef18df03
3
+ metadata.gz: 6fc4f5a3d663c2e8496f01efec20e020f02b03088d4a83c182cf1a673deb2886
4
+ data.tar.gz: d442018540664c329f346ebaabd4c558d4da11b39763a703b990dd09d6e8a1dd
5
5
  SHA512:
6
- metadata.gz: 9107c177d8ca761a216db6ea8b667fd29ec7f75829cca42b5610ba8c7e567a53f495c4b2c9fc9e708958a7036e1fed3931ca18a6e41d511094f41df4190e60c2
7
- data.tar.gz: 5c980f03a8528570b355ba4e7e425d27259768bc36ab679aeff93bb2a95e31e56975e0b8bf3b0c78cbfc24dfb63e96a293af505bcc0ba37dfcce5b8a65383e04
6
+ metadata.gz: 7cfad0eac54d8256b0347bffeff673e938e265c16ca4adf724390588e77046449bc62cab904171fb8baf114d47e5255cef60fa0d19b6a79f5d7fbcdf6085c113
7
+ data.tar.gz: 64b3e74fb8269048f2fc3dccd3fd49824c4d905ba0dec1376d1c8a7ab659d4af91805a7699c9d4f05e398e6e4aba212fb6bae774d38c30abc4e679b8b47b7f25
@@ -1,10 +1,9 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.3.3
5
- - 2.4.2
6
- - 2.5.3
7
- - 2.6.1
4
+ - 2.5.0
5
+ - 2.6.0
6
+ - 2.7.0
8
7
  before_install: gem install bundler
9
8
  scripts:
10
9
  - bundle exec rspec
@@ -0,0 +1,19 @@
1
+ # Changelog for hey-you gem
2
+ ## 1.3.0
3
+ - Feature: `body_part` in email builder.
4
+
5
+ ### 1.2.3
6
+ - Improvement: fix ruby 2.7 warnings
7
+ - Fix: fix `NoMethodError` in `sender.rb` when channel must be ignored by `if`
8
+
9
+ ### 1.2.2
10
+ - Improvement: `if` condition for receiver (if condition `false` - sending will be skipped).
11
+ - Improvement: `force` option - send message independent on `if` condition.
12
+
13
+
14
+ ### 1.2.1
15
+ - Improvement: Builder will not make channel builder if it skipped by only option
16
+
17
+ ### 1.2.0
18
+ - Feature: data source extensions (check readme for more information).
19
+ __Attention__: You should rewrite your configuration for use yaml data source!
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # HeyYou [Alpha]
1
+ # HeyYou
2
2
  [![Build Status](https://travis-ci.com/QNester/hey-you.svg?branch=master)](https://travis-ci.com/QNester/hey-you#)
3
3
  [![Gem Version](https://badge.fury.io/rb/hey-you.svg)](https://badge.fury.io/rb/hey-you)
4
4
 
@@ -20,7 +20,7 @@ him easy.
20
20
 
21
21
 
22
22
  ## Requirements
23
- * Ruby 2.3.0 min (rspec works with ruby 2.3.3, 2.4.2, 2.5.3)
23
+ * Ruby 2.5.0 min (rspec works with ruby 2.5.0, 2.6.0, 2.7.0)
24
24
  * FCM - Gem send push notification using [fcm gem](https://github.com/spacialdb/fcm).
25
25
  You need *fcm server key* to successful configure push notifications.
26
26
 
@@ -44,15 +44,20 @@ Or install it yourself as:
44
44
  First, you must configure HeyYou. Example:
45
45
  ```ruby
46
46
  HeyYou::Config.configure do
47
- config.collection_files = ['config/notifications.yml']
47
+ config.data_source.options = { collection_files: ['config/notifications.yml'] }
48
48
  config.email.from = 'noreply@example-mail.com'
49
49
  config.push.fcm_token = 'fcm_server_key'
50
50
  end
51
51
  ```
52
52
  #### Required settings
53
53
  Options for gem base work.
54
- ##### Base
55
- * __config.collection_files__ - File or files contained all your notifications texts.
54
+ ##### Data Source
55
+ * __config.data_source.source_class__ - Class implemented instance method `load_collections` returning hash (by default `HeyYou::DataSource::Yaml`)
56
+ * __config.data_source.options__ - Arguments for source_class. This options will be passed to init `source_class`
57
+ OR
58
+ * __config.data_source.source_instance__ - Instance of source class implemented `load_collections`
59
+
60
+ Read more about data source in [data source](#data-source-1).d
56
61
  ##### Push
57
62
  * __config.push.fcm_token__ - Required setting for push channel. You can not send
58
63
  push messages if setting was not set. You should set it to equal your fcm server key.
@@ -62,8 +67,6 @@ push messages if setting was not set. You should set it to equal your fcm server
62
67
  #### Optional settings
63
68
  Additional options for configure your notifications.
64
69
  #### Base
65
- * __config.env_collection_file__ - File contained all your notifications texts for
66
- environment. You can set it like `notifications.#{ENV['APP_ENV]}.yml`
67
70
  * __config.splitter__ - Chars for split notification keys for
68
71
  builder. Default: `.`
69
72
  * __config.registered_channels__ - Avialable channels for your
@@ -77,9 +80,10 @@ notifications for build should be nested in `I18n.locale` key. Default: `false`.
77
80
  # config/initializers/hey-you.rb
78
81
  HeyYou::Config.configure do
79
82
  ...
80
- config.collection_files = Rails.application.config.i18n.available_locales.map do |locale|
83
+ i18n_files = Rails.application.config.i18n.available_locales.map do |locale|
81
84
  "config/notifications/#{locale}.yml"
82
85
  end
86
+ config.data_source.options = { collection_files: i18n_files }
83
87
  ...
84
88
  end
85
89
  ```
@@ -159,8 +163,8 @@ fetching values required to send notification. For push channel
159
163
  expected that proc will return receiver's fcm registration id. For
160
164
  email expected that proc will return receiver's email address.
161
165
 
162
- You can pass options for receiver channels. You must pass proc with receive_data to `:subject` key and options
163
- pass to `:options` key:
166
+ You can pass options and sending condition for receiver channels. You must pass proc with receive_data to `:subject` key and options
167
+ pass to `:options` key. `if` key should be passed for sending condition:
164
168
 
165
169
  ```ruby
166
170
  class User < Model
@@ -168,7 +172,11 @@ class User < Model
168
172
 
169
173
  receive(
170
174
  push: -> { push_token.value },
171
- email: { subject: -> { email }, options: { mailer_class: UserMailer, mailer_method: :notify! } }
175
+ email: {
176
+ subject: -> { email },
177
+ if: -> { email_notifications? },
178
+ options: { mailer_class: UserMailer, mailer_method: :notify! }
179
+ }
172
180
  )
173
181
  end
174
182
  ```
@@ -185,9 +193,18 @@ Last command will fetch notifications credentials for user instance
185
193
  and will try to send SMS, Push and Email for it. What argument we pass
186
194
  for method? This is string key for builder. Read next to understand it.
187
195
 
196
+ Sometimes you need send notification independent on user's notification settings. For this case you can use
197
+ `force` option in `#send_notification`:
198
+ ```ruby
199
+ user = User.find(1)
200
+ user.settings.update!(email_notifications: false)
201
+ user.send_notification('for_users.hello') #=> will not send notification
202
+ user.send_notification('for_users.hello', force: true) #=> will send notification
203
+ ```
204
+
188
205
  ### Build your notification
189
206
  HeyYou Notification Builder - good system for store your notifications in one place.
190
- You need create yml file with follow format:
207
+ By default you need create yml file with follow format:
191
208
  ```yaml
192
209
  # config/notifications/collection.yml
193
210
  any_key:
@@ -214,6 +231,46 @@ notification will send for all available channels for receiver:
214
231
  1) Send push via fcm
215
232
  2) Send email
216
233
 
234
+ #### Data Source
235
+ Often we need store our notification text in another data source, not int yml files. HeyYou has flexible
236
+ system for data source. All what you need - make your own provider source and pass it to config. For example:
237
+
238
+ ```ruby
239
+ class NotificationText < ApplicationRecord
240
+ def self.load_collections
241
+ # load colelctions from database to hash
242
+ # THIS METHOD MUST returns hash!
243
+ end
244
+ end
245
+ ```
246
+
247
+ ```ruby
248
+ HeyYou::Config.configure do
249
+ # NotificationText is a rails model
250
+ config.data_source.source_instance = NotificationText
251
+ end
252
+ ```
253
+
254
+ HeyYou will pull texts from database to memory with initialize your application after this configuration. Builder
255
+ will build your texts successfully.
256
+
257
+ HeyYou by default contains only two data sources:
258
+ 1. `HeyYou::DataSource::Yaml` - for store notifications collections in data. For example:
259
+ ```ruby
260
+ HeyYou::Config.configure do
261
+ config.data_source.source_class = HeyYou::DataSource::Yaml
262
+ config.data_source.options = { collection_files: ['config/notifications.yml'] }
263
+ end
264
+ ```
265
+ 2. `HeyYou::DataSource::Hash` - store notification everywhere you want and pass to HeyYou only hash
266
+ ```ruby
267
+ config.data_source.source_class = HeyYou::DataSource::Yaml
268
+ config.data_source.options = { data: { welcome: { email: { ... }, push: { ... } } } }
269
+ ```
270
+
271
+ __Pay attention__: for difference source we should pass difference options.
272
+
273
+
217
274
  ### Send notification
218
275
  Receiver not only one way to send notification. You can send it using `HeyYou::Sender`.
219
276
  Just use method `#send` for HeyYou::Sender and pass notification key and `to` options
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_runtime_dependency "mail", '~> 2.7'
27
27
  spec.add_runtime_dependency "i18n", '~> 1.0'
28
28
 
29
- spec.add_development_dependency "rake", '~> 10.5'
29
+ spec.add_development_dependency "rake", '~> 13.0'
30
30
  spec.add_development_dependency "rspec", '~> 3.7'
31
31
  spec.add_development_dependency "webmock", '~> 3.4'
32
32
  spec.add_development_dependency "ffaker", '~> 2.9'
@@ -13,11 +13,14 @@ module HeyYou
13
13
  # Define methods for each registered channel. After initialize you can use
14
14
  # `instance.<ch_name>`. It will be return instance of HeyYou::Builder::<YOUR_CHANNEL_NAME>
15
15
  #
16
+ # Skip builder for excluded channels (not included in `only` option)
17
+ #
18
+ # @param [String] key - notification key for fetching notification data from collection
16
19
  def initialize(key, **options)
17
20
  @data = fetch_from_collection_by_key(key, options[:locale])
18
21
  @options = options
19
22
  config.registered_channels.each do |ch|
20
- init_channel_builder(ch, key)
23
+ init_channel_builder(ch, key) if channel_allowed_by_only?(ch, options[:only])
21
24
  end
22
25
  end
23
26
 
@@ -35,7 +38,7 @@ module HeyYou
35
38
  end
36
39
 
37
40
  ch_builder =
38
- HeyYou::Builder.const_get("#{ch.downcase.capitalize}").new(data, key, options)
41
+ HeyYou::Builder.const_get("#{ch.downcase.capitalize}").new(data[ch.to_s], key, **options)
39
42
  instance_variable_set("@#{ch}".to_sym, ch_builder)
40
43
 
41
44
  define_ch_method(ch)
@@ -61,6 +64,12 @@ module HeyYou
61
64
  raise DataNotFound, "collection data not found for `#{keys.join(config.splitter)}`"
62
65
  end
63
66
 
67
+ def channel_allowed_by_only?(ch, only)
68
+ return true unless only
69
+ return only.map(&:to_sym).include?(ch.to_sym) if only.is_a?(Array)
70
+ only.to_sym == ch.to_sym
71
+ end
72
+
64
73
  class UnknownLocale < StandardError; end
65
74
  class DataNotFound < StandardError; end
66
75
  class RequiredChannelNotFound < StandardError; end
@@ -23,10 +23,8 @@ module HeyYou
23
23
  raise InterpolationError, "Failed build notification string `#{notification_string}`: #{err.message}"
24
24
  end
25
25
 
26
- def ch_data
27
- data.fetch(current_builder_name)
28
- end
29
26
 
27
+ alias ch_data data
30
28
  alias channel_data ch_data
31
29
 
32
30
  def ch_options
@@ -3,19 +3,36 @@ require_relative '_base'
3
3
  module HeyYou
4
4
  class Builder
5
5
  class Email < Base
6
- attr_reader :subject, :body, :layout, :mailer_class, :mailer_method, :delivery_method
6
+ attr_reader :subject, :body, :layout, :mailer_class, :mailer_method, :delivery_method, :body_parts
7
7
 
8
8
  def build
9
9
  @mailer_class = ch_data.fetch('mailer_class', nil)
10
10
  @mailer_method = ch_data.fetch('mailer_method', nil)
11
11
  @delivery_method = ch_data.fetch('delivery_method', nil)
12
- @body = interpolate(ch_data.fetch('body'), options)
12
+ @body = interpolate(ch_data['body'], options) if ch_data['body']
13
+ @body_parts = interpolate_each(ch_data.fetch('body_parts', nil), options)
13
14
  @subject = interpolate(ch_data.fetch('subject'), options)
14
15
  end
15
16
 
16
17
  def to_hash
17
- { body: body, subject: subject }
18
+ { body: body, subject: subject, body_parts: body_parts }
19
+ end
20
+
21
+ private
22
+
23
+ def interpolate_each(notification_hash, options)
24
+ return notification_hash unless notification_hash.is_a?(Hash)
25
+
26
+ notification_hash.each do |k, v|
27
+ next interpolate_each(v, options) if v.is_a?(Hash)
28
+
29
+ begin
30
+ notification_hash[k] = v % options
31
+ rescue KeyError
32
+ raise InterpolationError, "Failed build notification string `#{v}`: #{err.message}"
33
+ end
34
+ end
18
35
  end
19
36
  end
20
37
  end
21
- end
38
+ end
@@ -7,13 +7,13 @@ module HeyYou
7
7
  class << self
8
8
  def send!(builder, to:, **options)
9
9
  method = config.email.use_default_mailing ? :send_via_mail : :send_via_custom_class
10
- public_send(method, builder, to, options)
10
+ public_send(method, builder, to, **options)
11
11
  end
12
12
 
13
13
  # Send email via custom class instance.
14
14
  def send_via_custom_class(builder, to, **options)
15
- mailer = mailer_class_from_builder(builder, options)
16
- mailer_method = mailer_method_from_builder(mailer, builder, options)
15
+ mailer = mailer_class_from_builder(builder, **options)
16
+ mailer_method = mailer_method_from_builder(mailer, builder, **options)
17
17
  delivery_method = options[:delivery_method] ||
18
18
  builder.email.delivery_method ||
19
19
  config.email.default_delivery_method
@@ -2,6 +2,7 @@ require 'yaml'
2
2
  require 'hey_you/config/conigurable'
3
3
  require 'hey_you/config/push'
4
4
  require 'hey_you/config/email'
5
+ require 'hey_you/config/data_source'
5
6
 
6
7
  #
7
8
  # @config REQUIRED collection_file [String] - File path for general notifications file
@@ -34,9 +35,8 @@ module HeyYou
34
35
 
35
36
  attr_reader :collection, :env_collection, :configured, :registered_receivers
36
37
  attr_accessor(
37
- :collection_files, :env_collection_file, :splitter,
38
- :registered_channels, :localization, :logger, :log_tag,
39
- :require_all_channels
38
+ :splitter, :registered_channels, :localization, :logger, :log_tag,
39
+ :require_all_channels, :data_source
40
40
  )
41
41
 
42
42
  def initialize
@@ -49,13 +49,6 @@ module HeyYou
49
49
  define_ch_config_methods
50
50
  end
51
51
 
52
- def collection_file
53
- @collection_files || raise(
54
- CollectionFileNotDefined,
55
- 'You must define HeyYou::Config.collection_files'
56
- )
57
- end
58
-
59
52
  def collection
60
53
  @collection ||= load_collection
61
54
  end
@@ -84,6 +77,10 @@ module HeyYou
84
77
  logger&.info("[#{log_tag}] #{msg} ")
85
78
  end
86
79
 
80
+ def data_source
81
+ DataSource.instance
82
+ end
83
+
87
84
  private
88
85
 
89
86
  def define_ch_config_methods
@@ -101,21 +98,8 @@ module HeyYou
101
98
  self.class.send(:define_method, ch, method_proc)
102
99
  end
103
100
 
104
- # Load yaml from collection_file and merge it with yaml from env_collection_file
105
101
  def load_collection
106
- @collection_files = [collection_files] if collection_files.is_a?(String)
107
- notification_collection = {}
108
- collection_files.each do |file|
109
- notification_collection.merge!(YAML.load_file(file))
110
- end
111
- notification_collection.merge!(env_collection)
112
- end
113
-
114
- def load_env_collection
115
- if env_collection_file
116
- return YAML.load_file(env_collection_file) rescue { }
117
- end
118
- {}
102
+ data_source.load_data
119
103
  end
120
104
  end
121
105
  end
@@ -0,0 +1,38 @@
1
+ require 'hey_you/config/conigurable'
2
+ require 'hey_you/data_source/yaml'
3
+ require 'hey_you/data_source/hash'
4
+
5
+ module HeyYou
6
+ class Config
7
+ class DataSource
8
+ extend Configurable
9
+
10
+ attr_accessor :source_class, :options, :source_instance
11
+
12
+ def initialize
13
+ @type = DEFAULTS[:type]
14
+ @options = DEFAULTS[:options]
15
+ @source_class = HeyYou::DataSource::Yaml
16
+ end
17
+
18
+ def load_data
19
+ return source_instance.load_collections if source_instance
20
+
21
+ if source_class.nil?
22
+ raise InvalidDataSourceError, 'You must pass `config.data_source.source_class` in configuration.'
23
+ end
24
+
25
+ source_class.new(**options).load_collections
26
+ rescue ArgumentError => err
27
+ problem_fields =
28
+ err.message.gsub(/missing keyword(.?):\s/, '').split(', ').map { |f| "`#{f}`" }.join(', ')
29
+ field_word = problem_fields.split(', ').size > 1 ? 'fields' : 'field'
30
+ msg = "You must pass #{field_word} #{problem_fields} for `config.data_source.options` in configuration"
31
+
32
+ raise InvalidOptionsError, msg
33
+ end
34
+
35
+ class InvalidOptionsError < StandardError; end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,9 @@
1
+ module HeyYou
2
+ module DataSource
3
+ class Base
4
+ def load_notifications
5
+ raise NotImplementedError
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,17 @@
1
+ require 'hey_you/data_source/_base'
2
+
3
+ module HeyYou
4
+ module DataSource
5
+ class Hash < Base
6
+ attr_reader :data
7
+
8
+ def initialize(data:)
9
+ @data = data
10
+ end
11
+
12
+ def load_collections
13
+ data
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,37 @@
1
+ require 'hey_you/data_source/_base'
2
+
3
+ module HeyYou
4
+ module DataSource
5
+ class Yaml < Base
6
+ attr_reader :collection_files, :env_collection_file
7
+
8
+ def initialize(collection_files:, env_collection_file: nil)
9
+ @collection_files = collection_files
10
+ @collection_files = [collection_files] if collection_files.is_a?(String)
11
+ @env_collection_file = env_collection_file
12
+ end
13
+
14
+ # Load yaml from collection_file and merge it with yaml from env_collection_file
15
+ def load_collections
16
+ notification_collection = {}
17
+ collection_files.each do |file|
18
+ notification_collection.merge!(YAML.load_file(file))
19
+ end
20
+ notification_collection.merge!(env_collection)
21
+ end
22
+
23
+ def env_collection
24
+ @env_collection ||= load_env_collection
25
+ end
26
+
27
+ private
28
+
29
+ def load_env_collection
30
+ if env_collection_file
31
+ return YAML.load_file(env_collection_file) rescue { }
32
+ end
33
+ {}
34
+ end
35
+ end
36
+ end
37
+ end
@@ -74,9 +74,11 @@ module HeyYou
74
74
  if receiver_data[ch].is_a?(Hash)
75
75
  me = self
76
76
  self.send(:define_method, "#{ch}_ch_receive_info", receiver_data[ch].fetch(:subject))
77
+ self.send(:define_method, "#{ch}_ch_receive_condition", receiver_data[ch].fetch(:if, -> { true }))
77
78
  self.send(:define_method, "#{ch}_ch_receive_options", -> { me.receiver_data[ch].fetch(:options, {}) })
78
79
  else
79
80
  self.send(:define_method, "#{ch}_ch_receive_info", receiver_data[ch])
81
+ self.send(:define_method, "#{ch}_ch_receive_condition", -> { true })
80
82
  self.send(:define_method, "#{ch}_ch_receive_options", -> { {} })
81
83
  end
82
84
  end
@@ -15,6 +15,7 @@ module HeyYou
15
15
  # @input notification_key [String] - key for notification builder
16
16
  # @input options [Hash]
17
17
  # @option only [String/Array[String]] - whitelist for using channels
18
+ # @option force [Boolean] - ignore `if` for receiver
18
19
  #
19
20
  def send_to(receiver, notification_key, **options)
20
21
  unless receiver_valid?(receiver)
@@ -29,6 +30,10 @@ module HeyYou
29
30
  def send!(notification_key, receiver, **options)
30
31
  to_hash = {}
31
32
  receiver.class.receiver_channels.each do |ch|
33
+ if !options[:force] && !receiver.public_send("#{ch}_ch_receive_condition")
34
+ next
35
+ end
36
+
32
37
  to_hash[ch] = {
33
38
  # Fetch receiver's info for sending: phone_number, email, etc
34
39
  subject: receiver.public_send("#{ch}_ch_receive_info"),
@@ -37,16 +42,16 @@ module HeyYou
37
42
  }
38
43
  end
39
44
 
40
- send_to_receive_info(notification_key, to_hash, options)
45
+ send_to_receive_info(notification_key, to_hash, **options)
41
46
  end
42
47
 
43
48
  def send_to_receive_info(notification_key, receive_info, **options)
44
- builder = Builder.new(notification_key, options)
49
+ builder = Builder.new(notification_key, **options)
45
50
  response = {}
46
51
  config.registered_channels.each do |ch|
47
- if channel_allowed?(ch, receive_info, builder, options) && builder.respond_to?(ch) && builder.public_send(ch)
52
+ if channel_allowed?(ch, receive_info, builder, **options) && builder.respond_to?(ch) && builder.public_send(ch)
48
53
  config.log(
49
- "Send #{ch}-message to #{receive_info[ch][:subject]} with data: #{builder.public_send(ch).data}" \
54
+ "Send #{ch}-message to `#{receive_info[ch][:subject]}` with data: #{builder.public_send(ch).data}" \
50
55
  " and options: #{receive_info[ch][:options]}"
51
56
  )
52
57
  receive_options = receive_info[ch].fetch(:options, {}) || {}
@@ -54,7 +59,7 @@ module HeyYou
54
59
  builder, to: receive_info[ch][:subject], **receive_options
55
60
  )
56
61
  else
57
- config.log("Channel #{ch} not allowed.")
62
+ config.log("Channel #{ch} not allowed or sending condition doesn't return truthy result.")
58
63
  end
59
64
  end
60
65
  response
@@ -63,7 +68,10 @@ module HeyYou
63
68
  private
64
69
 
65
70
  def channel_allowed?(ch, to, builder, **options)
66
- condition = to[ch].is_a?(Hash) ? to[ch.to_sym][:subject] || to[ch.to_s][:subject] : to[ch.to_sym] || to[ch.to_s]
71
+ data_in_subject = to[ch.to_sym]&.fetch(:subject, nil) || to[ch.to_s]&.fetch(:subject, nil)
72
+ data_in_core = to[ch.to_sym] || to[ch.to_s]
73
+
74
+ condition = to[ch].is_a?(Hash) ? data_in_subject : data_in_core
67
75
  return false unless condition
68
76
  channel_allowed_by_only?(ch, options[:only]) && !builder.send(ch).nil?
69
77
  end
@@ -1,3 +1,3 @@
1
1
  module HeyYou
2
- VERSION = "1.0.1"
2
+ VERSION = "1.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hey-you
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Nesterov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-19 00:00:00.000000000 Z
11
+ date: 2020-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fcm
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.5'
61
+ version: '13.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: '10.5'
68
+ version: '13.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -121,6 +121,7 @@ files:
121
121
  - ".rspec"
122
122
  - ".rubocop.yml"
123
123
  - ".travis.yml"
124
+ - CHANGELOG.md
124
125
  - Gemfile
125
126
  - README.md
126
127
  - Rakefile
@@ -137,8 +138,12 @@ files:
137
138
  - lib/hey_you/channels/push.rb
138
139
  - lib/hey_you/config.rb
139
140
  - lib/hey_you/config/conigurable.rb
141
+ - lib/hey_you/config/data_source.rb
140
142
  - lib/hey_you/config/email.rb
141
143
  - lib/hey_you/config/push.rb
144
+ - lib/hey_you/data_source/_base.rb
145
+ - lib/hey_you/data_source/hash.rb
146
+ - lib/hey_you/data_source/yaml.rb
142
147
  - lib/hey_you/helper.rb
143
148
  - lib/hey_you/receiver.rb
144
149
  - lib/hey_you/sender.rb
@@ -161,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
166
  - !ruby/object:Gem::Version
162
167
  version: '0'
163
168
  requirements: []
164
- rubygems_version: 3.0.6
169
+ rubygems_version: 3.1.2
165
170
  signing_key:
166
171
  specification_version: 4
167
172
  summary: Send multichannel notification with one command.