wisper_plus 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/wisper_plus/railtie.rb +21 -17
- data/lib/wisper_plus/version.rb +1 -1
- data/lib/wisper_plus.rb +1 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59894c1fa699b69e342ac88ad598630a093c2c9e99e33fd266ab85a6afb5790b
|
4
|
+
data.tar.gz: 4e7644aa0f78b6fdfeb5fbaa3a1f1dfb9dc1a19ecd2a3c77ddffba1cc253e643
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a71b7705fcf7d5a96c653f2d18ae2f2749ce9ab363bb28f68ecb363fa9f68e732fa2600b33257ea309a71231c3924ed3507e696e221b2644f598bafc16af0dc
|
7
|
+
data.tar.gz: 15a7688dad794bd8423f5b89b5c6f598098a1f49d8e4d8c9b764a2d86ce47a63a13be4f8437016a889513183906f0031cc410067b0f80c9ab42b8b88886288d2
|
data/lib/wisper_plus/railtie.rb
CHANGED
@@ -2,25 +2,29 @@ require 'rails'
|
|
2
2
|
|
3
3
|
class WisperPlus::Railtie < Rails::Railtie
|
4
4
|
|
5
|
-
config.
|
5
|
+
config.to_prepare do
|
6
|
+
Wisper.clear if Rails.env.development?
|
6
7
|
|
7
|
-
#
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
8
|
+
# AUTOLINK models to subscribers if DB exists
|
9
|
+
if (::ActiveRecord::Base.connection rescue false)
|
10
|
+
# Link any Models to their <Model>Subscriber class
|
11
|
+
Dir.glob(Rails.root.join('app/models/**/*.rb').to_s) do |filename|
|
12
|
+
next if filename.index('/concerns/')
|
13
|
+
filename = filename.remove(Rails.root.join('app/models/').to_s)[0..-4]
|
14
|
+
klass = filename.camelize.constantize
|
15
|
+
next unless klass.ancestors.include?(ApplicationRecord)
|
16
|
+
begin
|
17
|
+
notifier_klass = "#{klass}Subscriber".constantize
|
18
|
+
klass.subscribe(notifier_klass.new, async: false)
|
19
|
+
if Rails.env.development?
|
20
|
+
puts "🔹 #{klass.to_s.magenta} #{'subscriber'.blue}"
|
21
|
+
end
|
22
|
+
if !klass.ancestors.include?(Wisper::Publisher)
|
23
|
+
puts "🔸 #{klass} is not including Wisper::ActiveRecord::Publisher".yellow
|
24
|
+
end
|
25
|
+
rescue NameError
|
26
|
+
# ignore
|
18
27
|
end
|
19
|
-
if !klass.ancestors.include?(Wisper::Publisher)
|
20
|
-
puts "🔸 #{klass} is not including Wisper::ActiveRecord::Publisher".yellow
|
21
|
-
end
|
22
|
-
rescue NameError
|
23
|
-
# ignore
|
24
28
|
end
|
25
29
|
end
|
26
30
|
|
data/lib/wisper_plus/version.rb
CHANGED
data/lib/wisper_plus.rb
CHANGED
@@ -72,7 +72,6 @@ module Wisper
|
|
72
72
|
e
|
73
73
|
end
|
74
74
|
end
|
75
|
-
ap event
|
76
75
|
listener&.public_send(event, *args)
|
77
76
|
end
|
78
77
|
end
|
@@ -85,9 +84,9 @@ module Wisper
|
|
85
84
|
end
|
86
85
|
end
|
87
86
|
end
|
87
|
+
Wisper::ActiveJobBroadcaster.register
|
88
88
|
end
|
89
89
|
|
90
|
-
Wisper::ActiveJobBroadcaster.register
|
91
90
|
end
|
92
91
|
|
93
92
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wisper_plus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Sharpe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -119,8 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
- !ruby/object:Gem::Version
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
|
-
|
123
|
-
rubygems_version: 2.7.6
|
122
|
+
rubygems_version: 3.0.2
|
124
123
|
signing_key:
|
125
124
|
specification_version: 4
|
126
125
|
summary: Handy additions to Wisper
|