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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 289a43c7e028fb5c620f979361689b418cf240ce9e699e98b1dbcc5f5eb3d2a2
4
- data.tar.gz: 5e6399c01662b97fffd848385f883cc585a5045386fcf5f467d736b339ed7ada
3
+ metadata.gz: 59894c1fa699b69e342ac88ad598630a093c2c9e99e33fd266ab85a6afb5790b
4
+ data.tar.gz: 4e7644aa0f78b6fdfeb5fbaa3a1f1dfb9dc1a19ecd2a3c77ddffba1cc253e643
5
5
  SHA512:
6
- metadata.gz: 6a4041016bd9aa35a517ebe4ba97e9f47c851a65ed31def789d40174938ba43da65f48e099706fa3f2adba018237335c6a18f5620dd7e101b587c9c821e00df2
7
- data.tar.gz: 98e8587b9e44efbfd5b2250dfd194e5ef337aa17c79b7304c2bf4dc2adf99c04e97020bc646462d168215222a10860fbc846cd1ef31d3b809740beb3945bba2a
6
+ metadata.gz: 4a71b7705fcf7d5a96c653f2d18ae2f2749ce9ab363bb28f68ecb363fa9f68e732fa2600b33257ea309a71231c3924ed3507e696e221b2644f598bafc16af0dc
7
+ data.tar.gz: 15a7688dad794bd8423f5b89b5c6f598098a1f49d8e4d8c9b764a2d86ce47a63a13be4f8437016a889513183906f0031cc410067b0f80c9ab42b8b88886288d2
@@ -2,25 +2,29 @@ require 'rails'
2
2
 
3
3
  class WisperPlus::Railtie < Rails::Railtie
4
4
 
5
- config.after_initialize do
5
+ config.to_prepare do
6
+ Wisper.clear if Rails.env.development?
6
7
 
7
- # Link any Models to their <Model>Subscriber class
8
- Dir.glob(Rails.root.join('app/models/**/*.rb').to_s) do |filename|
9
- next if filename.index('/concerns/')
10
- filename = filename.remove(Rails.root.join('app/models/').to_s)[0..-4]
11
- klass = filename.camelize.constantize
12
- next unless klass.ancestors.include?(ApplicationRecord)
13
- begin
14
- notifier_klass = "#{klass}Subscriber".constantize
15
- klass.subscribe(notifier_klass.new, async: false)
16
- if Rails.env.development?
17
- puts "🔹 #{klass.to_s.magenta} #{'subscriber'.blue}"
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
 
@@ -1,3 +1,3 @@
1
1
  module WisperPlus
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
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: 2018-08-29 00:00:00.000000000 Z
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
- rubyforge_project:
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