solidus_support 0.14.0 → 0.14.1

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: 2cdd9849818af1dc56048136d30a8198d6d79c7245250824283659a47c396932
4
- data.tar.gz: e82afa4bcca816ad08c7b0afb4ff09279104c99c111818d96ba26cf0f7dab2f7
3
+ metadata.gz: f806b6a51765583aba92e5da3dc943006b383572af0aaf02d1aba0ecce33ed5a
4
+ data.tar.gz: 46bb34278a3de81f7af8e2d90c4a3852430f204248904e37df898fbff4bac874
5
5
  SHA512:
6
- metadata.gz: f619198e4c09da849dbab523854002358b35183d9c1cf13c5a24ae4001a986b6d5c38c5edc8d4ea06412581f4f14080a0abc1628d948409dbf47dc7be5364ee0
7
- data.tar.gz: bb3060ebe160c24dca44376cab8d5c1cdb3bf377cc47312a1a70d15eaeabee3df045d566d464433f86b0943a24dbd5e2cbfd907a89c21374808defc0a054de72
6
+ metadata.gz: a2ffa3274fb6a3bb433a50de1051083567c11b79d770281cd7001b2aca0b184c8ffb6c3f08c2f67c82c34fee941260e3f270e0b7ef7a689e7bb7d090fb40edbb
7
+ data.tar.gz: a8d1e98aa2fbc7657c0d2c78a84597c6950ca7618b26dd5b1c57a3dd24ea34fdbf80020bc6bbb7e0b5a70d7eb88a42782ebcc38e60dd3ee68d78102f968f8e98
@@ -37,16 +37,16 @@ module SolidusSupport
37
37
  # This allows to add event subscribers to extensions without explicitly subscribing them,
38
38
  # similarly to what happens in Solidus core.
39
39
  def load_solidus_subscribers_from(path)
40
- if SolidusSupport::LegacyEventCompat.using_legacy?
41
- path.glob("**/*_subscriber.rb") do |subscriber_path|
42
- require_dependency(subscriber_path)
43
- end
40
+ return unless SolidusSupport::LegacyEventCompat.using_legacy?
44
41
 
45
- if Spree::Event.respond_to?(:activate_all_subscribers)
46
- Spree::Event.activate_all_subscribers
47
- else
48
- Spree::Event.subscribers.each(&:subscribe!)
49
- end
42
+ path.glob("**/*_subscriber.rb") do |subscriber_path|
43
+ require_dependency(subscriber_path)
44
+ end
45
+
46
+ if Spree::Event.respond_to?(:activate_all_subscribers)
47
+ Spree::Event.activate_all_subscribers
48
+ else
49
+ Spree::Event.subscribers.each(&:subscribe!)
50
50
  end
51
51
  end
52
52
 
@@ -130,13 +130,19 @@ module SolidusSupport
130
130
  end
131
131
 
132
132
  initializer "#{engine_name}_#{engine}_patch_paths" do
133
- patch_paths = root.join("lib/patches/#{engine}").glob("*")
134
- Flickwerk.patch_paths += patch_paths
133
+ if SolidusSupport.send(:"#{engine}_available?")
134
+ patch_paths = root.join("lib/patches/#{engine}").glob("*")
135
+ Flickwerk.patch_paths += patch_paths
136
+ end
135
137
  end
136
138
 
137
139
  initializer "#{engine_name}_#{engine}_user_patches" do |app|
138
140
  app.reloader.to_prepare do
139
- Flickwerk.aliases["Spree.user_class"] = Spree.user_class_name
141
+ Flickwerk.aliases["Spree.user_class"] = if Spree.respond_to?(:user_class_name)
142
+ Spree.user_class_name
143
+ else
144
+ Spree.user_class.name
145
+ end
140
146
  end
141
147
  end
142
148
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusSupport
4
- VERSION = '0.14.0'
4
+ VERSION = '0.14.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hawthorn