noticed 2.0.2 → 2.0.3

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: 2526071997479bc9e570c51d5b148ce569f9afb45912b6c2b1bea71be65fc30e
4
- data.tar.gz: ffa64bdc283245497a456f125680a41da2cf0ba7ad52c2c6320af24b5ec3d956
3
+ metadata.gz: cf12a81661e3c6fa7e6240e54f6cb802420b13e2cfd35feabdc713a415986b5a
4
+ data.tar.gz: '08074571747ce14478e7f45de5917700fa997caefd0bb93b3bd154287f3b7830'
5
5
  SHA512:
6
- metadata.gz: 1cf980bb8d8ae9057ff80bd6313158997b1cee1fd664e3e4fef819d1cf3ba5cac469e55e02e8c4d1a2e70bf53658a58cd6c524e93da00fb2dc7a228bdda1a195
7
- data.tar.gz: 109fe7195032238f53ed001910db4bdce5e58a89543b45c2aefc88046f7e649b68cd77421dc005fa932fe1984e610349597b1f5ffb60fde9550356b91585f5b9
6
+ metadata.gz: c5ed4a60a134a094a9837127d2ac5aaab7ab2bae500222861ebb99e3053ef8450a439093543f03f58fefe5d1df04b47e519bfcfb3193b2aa82262bb5d725fe7a
7
+ data.tar.gz: 4cfcb122083862b7400459b99695619fabafb8676ea44e5185a06f85eaa693cc12a4eca0fb3094a0c502017fe0b67767d5853ec72e5928b4b560209189e95c4e
@@ -7,12 +7,20 @@ module Noticed
7
7
  class NotifierGenerator < Rails::Generators::NamedBase
8
8
  include Rails::Generators::ResourceHelpers
9
9
 
10
+ check_class_collision suffix: "Notifier"
11
+
10
12
  source_root File.expand_path("../templates", __FILE__)
11
13
 
12
14
  desc "Generates a notification with the given NAME."
13
15
 
14
16
  def generate_notification
15
- template "notifier.rb", "app/notifiers/#{file_path}.rb"
17
+ template "notifier.rb", "app/notifiers/#{file_path}_notifier.rb"
18
+ end
19
+
20
+ private
21
+
22
+ def file_name # :doc:
23
+ @_file_name ||= super.sub(/_notifier\z/i, "")
16
24
  end
17
25
  end
18
26
  end
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # <%= class_name %>.with(record: @post, message: "New post").deliver(User.all)
4
4
 
5
- class <%= class_name %> < Noticed::Event
5
+ class <%= class_name %>Notifier < Noticed::Event
6
6
  # Add your delivery methods
7
7
  #
8
8
  # deliver_by :email do |config|
@@ -40,7 +40,7 @@ module Noticed
40
40
 
41
41
  # Call method if symbol and matching method on Notifier
42
42
  elsif option.is_a?(Symbol) && event.respond_to?(option)
43
- event.send(option, self)
43
+ event.send(option, notification)
44
44
 
45
45
  # Return the value
46
46
  else
@@ -1,3 +1,3 @@
1
1
  module Noticed
2
- VERSION = "2.0.2"
2
+ VERSION = "2.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noticed
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-19 00:00:00.000000000 Z
11
+ date: 2024-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
- rubygems_version: 3.5.4
97
+ rubygems_version: 3.5.3
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Notifications for Ruby on Rails applications