solidus_core 3.4.6 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -1
  3. data/app/helpers/spree/products_helper.rb +1 -1
  4. data/app/models/concerns/spree/active_storage_adapter.rb +0 -17
  5. data/app/models/concerns/spree/default_price.rb +0 -15
  6. data/app/models/concerns/spree/ransackable_attributes.rb +0 -21
  7. data/app/models/spree/adjustment.rb +0 -13
  8. data/app/models/spree/carton.rb +1 -1
  9. data/app/models/spree/fulfilment_changer.rb +2 -14
  10. data/app/models/spree/option_value.rb +2 -11
  11. data/app/models/spree/order.rb +9 -21
  12. data/app/models/spree/order_updater.rb +0 -29
  13. data/app/models/spree/payment.rb +5 -37
  14. data/app/models/spree/product/scopes.rb +0 -5
  15. data/app/models/spree/product.rb +3 -10
  16. data/app/models/spree/promotion/rules/item_total.rb +0 -11
  17. data/app/models/spree/promotion.rb +7 -30
  18. data/app/models/spree/promotion_rule.rb +0 -5
  19. data/app/models/spree/taxon.rb +2 -2
  20. data/app/models/spree/taxonomy.rb +1 -1
  21. data/app/models/spree/variant/price_selector.rb +1 -14
  22. data/app/models/spree/variant.rb +1 -17
  23. data/db/migrate/20210815004823_add_unique_index_to_option_values_variants.rb +16 -0
  24. data/db/migrate/20230321161854_change_column_null_option_values_option_type_id.rb +5 -0
  25. data/db/migrate/20230322085416_remove_match_policy_from_spree_promotion.rb +5 -0
  26. data/db/migrate/20230325132905_remove_unused_columns_from_promotion_rules.rb +6 -0
  27. data/db/migrate/20230325161633_drop_unused_promo_action_line_items.rb +13 -0
  28. data/db/migrate/20230425103509_remove_taxon_position.rb +5 -0
  29. data/db/migrate/20230427095534_drop_deprecated_address_id_from_shipments.rb +11 -0
  30. data/lib/generators/solidus/install/app_templates/frontend/none.rb +1 -2
  31. data/lib/generators/solidus/install/app_templates/frontend/starter.rb +1 -3
  32. data/lib/generators/solidus/install/app_templates/payment_method/paypal.rb +2 -14
  33. data/lib/generators/solidus/install/app_templates/payment_method/stripe.rb +5 -0
  34. data/lib/generators/solidus/install/install_generator.rb +59 -153
  35. data/lib/spree/app_configuration.rb +2 -82
  36. data/lib/spree/bus.rb +0 -11
  37. data/lib/spree/core/controller_helpers/auth.rb +0 -16
  38. data/lib/spree/core/engine.rb +11 -31
  39. data/lib/spree/core/validators/email.rb +0 -4
  40. data/lib/spree/core/version.rb +2 -2
  41. data/lib/spree/core.rb +0 -2
  42. data/lib/spree/migration_helpers.rb +3 -3
  43. data/lib/spree/preferences/preferable_class_methods.rb +1 -25
  44. data/lib/spree/testing_support/common_rake.rb +5 -1
  45. data/lib/spree/testing_support/dummy_app/rake_tasks.rb +4 -8
  46. data/lib/spree/testing_support/dummy_app.rb +1 -6
  47. data/lib/spree/testing_support/factories/address_factory.rb +0 -7
  48. data/lib/spree/testing_support/factories/adjustment_factory.rb +0 -11
  49. data/lib/spree/testing_support/factories/adjustment_reason_factory.rb +0 -5
  50. data/lib/spree/testing_support/factories/calculator_factory.rb +0 -5
  51. data/lib/spree/testing_support/factories/carton_factory.rb +0 -8
  52. data/lib/spree/testing_support/factories/country_factory.rb +0 -5
  53. data/lib/spree/testing_support/factories/credit_card_factory.rb +0 -5
  54. data/lib/spree/testing_support/factories/customer_return_factory.rb +0 -9
  55. data/lib/spree/testing_support/factories/image_factory.rb +0 -5
  56. data/lib/spree/testing_support/factories/inventory_unit_factory.rb +0 -10
  57. data/lib/spree/testing_support/factories/line_item_factory.rb +0 -8
  58. data/lib/spree/testing_support/factories/option_type_factory.rb +0 -8
  59. data/lib/spree/testing_support/factories/option_value_factory.rb +0 -5
  60. data/lib/spree/testing_support/factories/order_factory.rb +0 -12
  61. data/lib/spree/testing_support/factories/order_promotion_factory.rb +0 -8
  62. data/lib/spree/testing_support/factories/payment_factory.rb +0 -10
  63. data/lib/spree/testing_support/factories/payment_method_factory.rb +0 -5
  64. data/lib/spree/testing_support/factories/price_factory.rb +0 -7
  65. data/lib/spree/testing_support/factories/product_factory.rb +0 -11
  66. data/lib/spree/testing_support/factories/product_option_type_factory.rb +0 -8
  67. data/lib/spree/testing_support/factories/product_property_factory.rb +0 -8
  68. data/lib/spree/testing_support/factories/promotion_category_factory.rb +0 -5
  69. data/lib/spree/testing_support/factories/promotion_code_factory.rb +0 -8
  70. data/lib/spree/testing_support/factories/promotion_factory.rb +0 -8
  71. data/lib/spree/testing_support/factories/property_factory.rb +0 -5
  72. data/lib/spree/testing_support/factories/refund_factory.rb +0 -8
  73. data/lib/spree/testing_support/factories/refund_reason_factory.rb +0 -5
  74. data/lib/spree/testing_support/factories/reimbursement_factory.rb +0 -7
  75. data/lib/spree/testing_support/factories/reimbursement_type_factory.rb +0 -5
  76. data/lib/spree/testing_support/factories/return_authorization_factory.rb +0 -9
  77. data/lib/spree/testing_support/factories/return_item_factory.rb +0 -9
  78. data/lib/spree/testing_support/factories/return_reason_factory.rb +0 -5
  79. data/lib/spree/testing_support/factories/role_factory.rb +0 -5
  80. data/lib/spree/testing_support/factories/shipment_factory.rb +0 -10
  81. data/lib/spree/testing_support/factories/shipping_category_factory.rb +0 -5
  82. data/lib/spree/testing_support/factories/shipping_method_factory.rb +0 -9
  83. data/lib/spree/testing_support/factories/shipping_rate_factory.rb +0 -8
  84. data/lib/spree/testing_support/factories/state_factory.rb +0 -8
  85. data/lib/spree/testing_support/factories/stock_item_factory.rb +0 -8
  86. data/lib/spree/testing_support/factories/stock_location_factory.rb +0 -9
  87. data/lib/spree/testing_support/factories/stock_movement_factory.rb +0 -7
  88. data/lib/spree/testing_support/factories/stock_package_factory.rb +0 -8
  89. data/lib/spree/testing_support/factories/store_credit_category_factory.rb +0 -5
  90. data/lib/spree/testing_support/factories/store_credit_event_factory.rb +0 -8
  91. data/lib/spree/testing_support/factories/store_credit_factory.rb +0 -9
  92. data/lib/spree/testing_support/factories/store_credit_reason_factory.rb +0 -5
  93. data/lib/spree/testing_support/factories/store_credit_type_factory.rb +0 -5
  94. data/lib/spree/testing_support/factories/store_factory.rb +0 -5
  95. data/lib/spree/testing_support/factories/tax_category_factory.rb +0 -8
  96. data/lib/spree/testing_support/factories/tax_rate_factory.rb +0 -9
  97. data/lib/spree/testing_support/factories/taxon_factory.rb +0 -7
  98. data/lib/spree/testing_support/factories/taxonomy_factory.rb +0 -5
  99. data/lib/spree/testing_support/factories/user_factory.rb +0 -9
  100. data/lib/spree/testing_support/factories/variant_factory.rb +0 -10
  101. data/lib/spree/testing_support/factories/variant_property_rule_condition_factory.rb +0 -8
  102. data/lib/spree/testing_support/factories/variant_property_rule_factory.rb +0 -9
  103. data/lib/spree/testing_support/factories/variant_property_rule_value_factory.rb +0 -8
  104. data/lib/spree/testing_support/factories/zone_factory.rb +0 -8
  105. data/lib/spree/testing_support/factory_bot.rb +4 -28
  106. data/lib/spree/testing_support/sequences.rb +0 -5
  107. data/solidus_core.gemspec +4 -4
  108. metadata +48 -76
  109. data/app/subscribers/spree/mailer_subscriber.rb +0 -29
  110. data/lib/generators/solidus/install/app_templates/frontend/break_down_solidus_gem.rb +0 -54
  111. data/lib/generators/solidus/install/app_templates/frontend/classic.rb +0 -16
  112. data/lib/generators/solidus/install/app_templates/payment_method/bolt.rb +0 -13
  113. data/lib/spree/core/controller_helpers/current_host.rb +0 -19
  114. data/lib/spree/event/adapters/active_support_notifications.rb +0 -67
  115. data/lib/spree/event/configuration.rb +0 -25
  116. data/lib/spree/event/subscriber.rb +0 -86
  117. data/lib/spree/event/subscriber_registry.rb +0 -92
  118. data/lib/spree/event.rb +0 -119
  119. data/lib/spree/promotion/match_policies.rb +0 -2
  120. data/lib/spree/rails_compatibility.rb +0 -106
  121. data/lib/spree/testing_support/factories.rb +0 -11
  122. data/lib/spree/testing_support.rb +0 -36
  123. data/lib/tasks/solidus/check_orders_with_invalid_email.rake +0 -18
  124. data/lib/tasks/solidus/split_promotions_with_any_match_policy.rake +0 -33
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.6
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-02 00:00:00.000000000 Z
11
+ date: 2023-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -16,180 +16,160 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '6.0'
19
+ version: '7.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 7.1.x
22
+ version: '7.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '6.0'
29
+ version: '7.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 7.1.x
32
+ version: '7.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: actionpack
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '6.0'
39
+ version: '7.0'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: 7.1.x
42
+ version: '7.1'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: '6.0'
49
+ version: '7.0'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: 7.1.x
52
+ version: '7.1'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: actionview
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: '6.0'
59
+ version: '7.0'
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
- version: 7.1.x
62
+ version: '7.1'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: '6.0'
69
+ version: '7.0'
70
70
  - - "<"
71
71
  - !ruby/object:Gem::Version
72
- version: 7.1.x
72
+ version: '7.1'
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: activejob
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
77
  - - ">="
78
78
  - !ruby/object:Gem::Version
79
- version: '6.0'
79
+ version: '7.0'
80
80
  - - "<"
81
81
  - !ruby/object:Gem::Version
82
- version: 7.1.x
82
+ version: '7.1'
83
83
  type: :runtime
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '6.0'
89
+ version: '7.0'
90
90
  - - "<"
91
91
  - !ruby/object:Gem::Version
92
- version: 7.1.x
92
+ version: '7.1'
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: activemodel
95
95
  requirement: !ruby/object:Gem::Requirement
96
96
  requirements:
97
97
  - - ">="
98
98
  - !ruby/object:Gem::Version
99
- version: '6.0'
99
+ version: '7.0'
100
100
  - - "<"
101
101
  - !ruby/object:Gem::Version
102
- version: 7.1.x
102
+ version: '7.1'
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: '6.0'
109
+ version: '7.0'
110
110
  - - "<"
111
111
  - !ruby/object:Gem::Version
112
- version: 7.1.x
112
+ version: '7.1'
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: activerecord
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - ">="
118
118
  - !ruby/object:Gem::Version
119
- version: '6.0'
119
+ version: '7.0'
120
120
  - - "<"
121
121
  - !ruby/object:Gem::Version
122
- version: 7.1.x
122
+ version: '7.1'
123
123
  type: :runtime
124
124
  prerelease: false
125
125
  version_requirements: !ruby/object:Gem::Requirement
126
126
  requirements:
127
127
  - - ">="
128
128
  - !ruby/object:Gem::Version
129
- version: '6.0'
129
+ version: '7.0'
130
130
  - - "<"
131
131
  - !ruby/object:Gem::Version
132
- version: 7.1.x
133
- - !ruby/object:Gem::Dependency
134
- name: activestorage
135
- requirement: !ruby/object:Gem::Requirement
136
- requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- version: '6.0'
140
- - - "<"
141
- - !ruby/object:Gem::Version
142
- version: 7.1.x
143
- type: :runtime
144
- prerelease: false
145
- version_requirements: !ruby/object:Gem::Requirement
146
- requirements:
147
- - - ">="
148
- - !ruby/object:Gem::Version
149
- version: '6.0'
150
- - - "<"
151
- - !ruby/object:Gem::Version
152
- version: 7.1.x
132
+ version: '7.1'
153
133
  - !ruby/object:Gem::Dependency
154
134
  name: activesupport
155
135
  requirement: !ruby/object:Gem::Requirement
156
136
  requirements:
157
137
  - - ">="
158
138
  - !ruby/object:Gem::Version
159
- version: '6.0'
139
+ version: '7.0'
160
140
  - - "<"
161
141
  - !ruby/object:Gem::Version
162
- version: 7.1.x
142
+ version: '7.1'
163
143
  type: :runtime
164
144
  prerelease: false
165
145
  version_requirements: !ruby/object:Gem::Requirement
166
146
  requirements:
167
147
  - - ">="
168
148
  - !ruby/object:Gem::Version
169
- version: '6.0'
149
+ version: '7.0'
170
150
  - - "<"
171
151
  - !ruby/object:Gem::Version
172
- version: 7.1.x
152
+ version: '7.1'
173
153
  - !ruby/object:Gem::Dependency
174
154
  name: railties
175
155
  requirement: !ruby/object:Gem::Requirement
176
156
  requirements:
177
157
  - - ">="
178
158
  - !ruby/object:Gem::Version
179
- version: '6.0'
159
+ version: '7.0'
180
160
  - - "<"
181
161
  - !ruby/object:Gem::Version
182
- version: 7.1.x
162
+ version: '7.1'
183
163
  type: :runtime
184
164
  prerelease: false
185
165
  version_requirements: !ruby/object:Gem::Requirement
186
166
  requirements:
187
167
  - - ">="
188
168
  - !ruby/object:Gem::Version
189
- version: '6.0'
169
+ version: '7.0'
190
170
  - - "<"
191
171
  - !ruby/object:Gem::Version
192
- version: 7.1.x
172
+ version: '7.1'
193
173
  - !ruby/object:Gem::Dependency
194
174
  name: activemerchant
195
175
  requirement: !ruby/object:Gem::Requirement
@@ -376,7 +356,7 @@ dependencies:
376
356
  requirements:
377
357
  - - ">="
378
358
  - !ruby/object:Gem::Version
379
- version: 4.0.1
359
+ version: 3.1.0
380
360
  - - "<"
381
361
  - !ruby/object:Gem::Version
382
362
  version: '5.0'
@@ -386,7 +366,7 @@ dependencies:
386
366
  requirements:
387
367
  - - ">="
388
368
  - !ruby/object:Gem::Version
389
- version: 4.0.1
369
+ version: 3.1.0
390
370
  - - "<"
391
371
  - !ruby/object:Gem::Version
392
372
  version: '5.0'
@@ -717,7 +697,6 @@ files:
717
697
  - app/models/spree/wallet_payment_source.rb
718
698
  - app/models/spree/zone.rb
719
699
  - app/models/spree/zone_member.rb
720
- - app/subscribers/spree/mailer_subscriber.rb
721
700
  - app/subscribers/spree/order_mailer_subscriber.rb
722
701
  - app/views/layouts/spree/base_mailer.html.erb
723
702
  - app/views/spree/carton_mailer/shipped_email.html.erb
@@ -785,22 +764,27 @@ files:
785
764
  - db/migrate/20201127212108_add_type_before_removal_to_spree_payment_methods.rb
786
765
  - db/migrate/20210122110141_add_name_to_spree_addresses.rb
787
766
  - db/migrate/20210312061050_change_column_null_on_prices.rb
767
+ - db/migrate/20210815004823_add_unique_index_to_option_values_variants.rb
788
768
  - db/migrate/20220317165036_set_promotions_with_any_policy_to_all_if_possible.rb
789
769
  - db/migrate/20220805202442_add_level_to_spree_tax_rates.rb
790
770
  - db/migrate/20221123152807_add_shipping_category_to_spree_variants.rb
771
+ - db/migrate/20230321161854_change_column_null_option_values_option_type_id.rb
772
+ - db/migrate/20230322085416_remove_match_policy_from_spree_promotion.rb
773
+ - db/migrate/20230325132905_remove_unused_columns_from_promotion_rules.rb
774
+ - db/migrate/20230325161633_drop_unused_promo_action_line_items.rb
775
+ - db/migrate/20230425103509_remove_taxon_position.rb
776
+ - db/migrate/20230427095534_drop_deprecated_address_id_from_shipments.rb
791
777
  - db/seeds.rb
792
778
  - lib/generators/solidus/install/app_templates/authentication/custom.rb
793
779
  - lib/generators/solidus/install/app_templates/authentication/devise.rb
794
780
  - lib/generators/solidus/install/app_templates/authentication/existing.rb
795
781
  - lib/generators/solidus/install/app_templates/authentication/none.rb
796
- - lib/generators/solidus/install/app_templates/frontend/break_down_solidus_gem.rb
797
- - lib/generators/solidus/install/app_templates/frontend/classic.rb
798
782
  - lib/generators/solidus/install/app_templates/frontend/none.rb
799
783
  - lib/generators/solidus/install/app_templates/frontend/starter.rb
800
- - lib/generators/solidus/install/app_templates/payment_method/bolt.rb
801
784
  - lib/generators/solidus/install/app_templates/payment_method/braintree.rb
802
785
  - lib/generators/solidus/install/app_templates/payment_method/none.rb
803
786
  - lib/generators/solidus/install/app_templates/payment_method/paypal.rb
787
+ - lib/generators/solidus/install/app_templates/payment_method/stripe.rb
804
788
  - lib/generators/solidus/install/install_generator.rb
805
789
  - lib/generators/solidus/install/templates/config/initializers/spree.rb.tt
806
790
  - lib/generators/solidus/install/templates/vendor/assets/javascripts/spree/backend/all.js
@@ -828,7 +812,6 @@ files:
828
812
  - lib/spree/core/class_constantizer.rb
829
813
  - lib/spree/core/controller_helpers/auth.rb
830
814
  - lib/spree/core/controller_helpers/common.rb
831
- - lib/spree/core/controller_helpers/current_host.rb
832
815
  - lib/spree/core/controller_helpers/order.rb
833
816
  - lib/spree/core/controller_helpers/payment_parameters.rb
834
817
  - lib/spree/core/controller_helpers/pricing.rb
@@ -864,11 +847,6 @@ files:
864
847
  - lib/spree/core/versioned_value.rb
865
848
  - lib/spree/deprecation.rb
866
849
  - lib/spree/encryptor.rb
867
- - lib/spree/event.rb
868
- - lib/spree/event/adapters/active_support_notifications.rb
869
- - lib/spree/event/configuration.rb
870
- - lib/spree/event/subscriber.rb
871
- - lib/spree/event/subscriber_registry.rb
872
850
  - lib/spree/i18n.rb
873
851
  - lib/spree/localized_number.rb
874
852
  - lib/spree/mailer_previews/carton_preview.rb
@@ -906,9 +884,6 @@ files:
906
884
  - lib/spree/preferences/static_model_preferences.rb
907
885
  - lib/spree/preferences/statically_configurable.rb
908
886
  - lib/spree/preferences/store.rb
909
- - lib/spree/promotion/match_policies.rb
910
- - lib/spree/rails_compatibility.rb
911
- - lib/spree/testing_support.rb
912
887
  - lib/spree/testing_support/ability_helpers.rb
913
888
  - lib/spree/testing_support/authorization_helpers.rb
914
889
  - lib/spree/testing_support/blacklist_urls.rb
@@ -929,7 +904,6 @@ files:
929
904
  - lib/spree/testing_support/dummy_app/routes.rb
930
905
  - lib/spree/testing_support/dummy_app/views/layouts/application.html.erb
931
906
  - lib/spree/testing_support/extension_rake.rb
932
- - lib/spree/testing_support/factories.rb
933
907
  - lib/spree/testing_support/factories/address_factory.rb
934
908
  - lib/spree/testing_support/factories/adjustment_factory.rb
935
909
  - lib/spree/testing_support/factories/adjustment_reason_factory.rb
@@ -1008,9 +982,7 @@ files:
1008
982
  - lib/spree_core.rb
1009
983
  - lib/tasks/colorado_delivery_fee.rake
1010
984
  - lib/tasks/payment_method.rake
1011
- - lib/tasks/solidus/check_orders_with_invalid_email.rake
1012
985
  - lib/tasks/solidus/delete_prices_with_nil_amount.rake
1013
- - lib/tasks/solidus/split_promotions_with_any_match_policy.rake
1014
986
  - solidus_core.gemspec
1015
987
  - vendor/assets/javascripts/jquery.payment.js
1016
988
  - vendor/assets/javascripts/jsuri.js
@@ -1050,15 +1022,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
1050
1022
  requirements:
1051
1023
  - - ">="
1052
1024
  - !ruby/object:Gem::Version
1053
- version: 2.7.0
1025
+ version: 3.0.0
1054
1026
  required_rubygems_version: !ruby/object:Gem::Requirement
1055
1027
  requirements:
1056
1028
  - - ">="
1057
1029
  - !ruby/object:Gem::Version
1058
1030
  version: 1.8.23
1059
1031
  requirements: []
1060
- rubygems_version: 3.4.17
1061
- signing_key:
1032
+ rubygems_version: 3.4.9
1033
+ signing_key:
1062
1034
  specification_version: 4
1063
1035
  summary: Essential models, mailers, and classes for the Solidus e-commerce project.
1064
1036
  test_files: []
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spree/event/subscriber'
4
-
5
- module Spree
6
- # Legacy subscriber
7
- #
8
- # This subscriber module is used by the legacy pub/sub system (see
9
- # {Spree::Event}).
10
- module MailerSubscriber
11
- include Spree::Event::Subscriber
12
-
13
- event_action :order_finalized
14
- event_action :send_reimbursement_email, event_name: :reimbursement_reimbursed
15
-
16
- def order_finalized(event)
17
- order = event.payload[:order]
18
- unless order.confirmation_delivered?
19
- Spree::Config.order_mailer_class.confirm_email(order).deliver_later
20
- order.update_column(:confirmation_delivered, true)
21
- end
22
- end
23
-
24
- def send_reimbursement_email(event)
25
- reimbursement = event.payload[:reimbursement]
26
- Spree::Config.reimbursement_mailer_class.reimbursement_email(reimbursement.id).deliver_later
27
- end
28
- end
29
- end
@@ -1,54 +0,0 @@
1
- # # This will unpack the solidus gem into its components without calling `bundle install`.
2
- #
3
- # # Nothing to do if the `solidus` gem is not there.
4
- solidus = Bundler.locked_gems.dependencies['solidus'] or return
5
-
6
- # Write and remove into and from a Gemfile
7
- #
8
- # This custom injector fixes support for path, git and custom sources,
9
- # which is missing in bundler's upstream injector for a dependency fetched
10
- # with `Bundler.locked_gems.dependencies`.
11
- bundler_injector = Class.new(Bundler::Injector) do
12
- def build_gem_lines(conservative_versioning)
13
- @deps.map do |d|
14
- name = d.name.dump
15
- is_local = d.source.instance_of?(Bundler::Source::Path)
16
- is_git = d.source.instance_of?(Bundler::Source::Git)
17
-
18
- requirement = if is_local
19
- ", path: \"#{d.source.path}\""
20
- elsif is_git
21
- ", git: \"#{d.git}\"".then { |g| d.ref ? g + ", ref: \"#{d.ref}\"" : g }
22
- elsif conservative_versioning
23
- ", \"#{conservative_version(@definition.specs[d.name][0])}\""
24
- else
25
- ", #{d.requirement.as_list.map(&:dump).join(", ")}"
26
- end
27
-
28
- source = ", source: \"#{d.source.remotes.join(",")}\"" unless is_local || is_git || d.source.nil?
29
-
30
- %(gem #{name}#{requirement}#{source})
31
- end.join("\n")
32
- end
33
- end
34
-
35
- to_dependency = ->(component) do
36
- Bundler::Dependency.new(
37
- component,
38
- solidus.requirement,
39
- "source" => solidus.source,
40
- "git" => solidus.source.try(:uri),
41
- "ref" => solidus.source.try(:ref),
42
- )
43
- end
44
-
45
- bundler_injector.inject(%w[
46
- solidus_core
47
- solidus_backend
48
- solidus_api
49
- solidus_sample
50
- ].map(&to_dependency))
51
-
52
- bundler_injector.remove(%w[
53
- solidus
54
- ])
@@ -1,16 +0,0 @@
1
- solidus = Bundler.locked_gems.dependencies['solidus']
2
-
3
- if Bundler.locked_gems.dependencies['solidus_frontend']
4
- say_status :skipping, "solidus_frontend is already in the bundle", :blue
5
- else
6
- # `solidus_frontend` is not sourced from rubygems if the solidus gem was not.
7
- github_solidus_frontend = '--github solidusio/solidus_frontend' unless solidus.nil? || solidus.source.is_a?(Bundler::Source::Rubygems)
8
-
9
- bundle_command("add solidus_frontend #{github_solidus_frontend}")
10
- end
11
-
12
- # Disable solidus_bolt installation from solidus_frontend as it can be
13
- # explicitly selected directly from the solidus installer.
14
- with_env('SKIP_SOLIDUS_BOLT' => 'true') do
15
- generate 'solidus_frontend:install'
16
- end
@@ -1,13 +0,0 @@
1
- unless Bundler.locked_gems.dependencies['solidus_frontend']
2
- say_status :warning, "Support for frontends other than `solidus_frontend` by `solidus_bolt` is still in progress.", :yellow
3
- end
4
-
5
- unless Bundler.locked_gems.dependencies['solidus_auth_devise']
6
- say_status :warning, "Running solidus_bolt without solidus_auth_devise is not supported.", :yellow
7
- end
8
-
9
- unless Bundler.locked_gems.dependencies['solidus_bolt']
10
- bundle_command 'add solidus_bolt'
11
- end
12
-
13
- generate "solidus_bolt:install --auto-run-migrations=#{options[:migrate]}"
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Spree
4
- module Core
5
- module ControllerHelpers
6
- module CurrentHost
7
- extend ActiveSupport::Concern
8
-
9
- included do
10
- Spree::Deprecation.warn <<~MSG
11
- 'Spree::Core::ControllerHelpers::CurrentHost' is deprecated.
12
- Please, include 'ActiveStorage::SetCurrent' instead.
13
- MSG
14
- include ActiveStorage::SetCurrent
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,67 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Spree
4
- module Event
5
- module Adapters
6
- module ActiveSupportNotifications
7
- class InvalidEventNameType < StandardError; end
8
-
9
- extend self
10
-
11
- def fire(event_name, opts)
12
- ActiveSupport::Notifications.instrument event_name, opts do
13
- yield opts if block_given?
14
- end
15
- end
16
-
17
- def subscribe(event_name)
18
- ActiveSupport::Notifications.subscribe event_name do |*args|
19
- event = ActiveSupport::Notifications::Event.new(*args)
20
- yield event
21
- end
22
- end
23
-
24
- def unsubscribe(subscriber_or_name)
25
- ActiveSupport::Notifications.unsubscribe(subscriber_or_name)
26
- end
27
-
28
- def listeners_for(names)
29
- names.each_with_object({}) do |name, memo|
30
- listeners = ActiveSupport::Notifications.notifier.listeners_for(name)
31
- memo[name] = listeners if listeners.present?
32
- end
33
- end
34
-
35
- # Normalizes the event name according to this specific adapter rules.
36
- # When the event name is a string or a symbol, if the suffix is missing, then
37
- # it is added automatically.
38
- # When the event name is a regexp, due to the huge variability of regexps, adding
39
- # or not the suffix is developer's responsibility (if you don't, you will subscribe
40
- # to all internal rails events as well).
41
- # When the event type is not supported, an error is raised.
42
- #
43
- # @param [String, Symbol, Regexp] event_name the event name, with or without the
44
- # suffix (Spree::Config.events.suffix defaults to `.spree`).
45
- def normalize_name(event_name)
46
- case event_name
47
- when Regexp
48
- event_name
49
- when String, Symbol
50
- name = event_name.to_s
51
- name.end_with?(suffix) ? name : [name, suffix].join
52
- else
53
- raise InvalidEventNameType, "Invalid event name type: #{event_name.class}"
54
- end
55
- end
56
-
57
- # The suffix used for namespacing event names, defaults to
58
- # `.spree`
59
- #
60
- # @see Spree::Event::Configuration#suffix
61
- def suffix
62
- Spree::Config.events.suffix
63
- end
64
- end
65
- end
66
- end
67
- end
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Spree
4
- module Event
5
- class Configuration
6
- def subscriber_registry
7
- @subscriber_registry ||= Spree::Event::SubscriberRegistry.new
8
- end
9
-
10
- attr_writer :adapter, :suffix, :autoload_subscribers
11
-
12
- def autoload_subscribers
13
- @autoload_subscribers.nil? ? true : !!@autoload_subscribers
14
- end
15
-
16
- def adapter
17
- @adapter ||= Spree::Event::Adapters::ActiveSupportNotifications
18
- end
19
-
20
- def suffix
21
- @suffix ||= '.spree'
22
- end
23
- end
24
- end
25
- end
@@ -1,86 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Spree
4
- module Event
5
- # This module simplifies adding and removing subscriptions to {Spree::Event} events.
6
- # Here's a complete example:
7
- # module EmailSender
8
- # include Spree::Event::Subscriber
9
- #
10
- # event_action :order_finalized
11
- # event_action :confirm_reimbursement, event_name: :reimbursement_reimbursed
12
- #
13
- # def order_finalized(event)
14
- # Mailer.send_email(event.payload[:order])
15
- # end
16
- #
17
- # def confirm_reimbursement(event)
18
- # Mailer.send_email(event.payload[:reimbursement])
19
- # end
20
- # end
21
- #
22
- # # Optional, required only when the subscriber needs to be loaded manually.
23
- # #
24
- # # If Spree::Config.events.autoload_subscribers is set to `true` and the module
25
- # # file matches the pattern `app/subscribers/**/*_subscriber.rb` then it will
26
- # # be loaded automatically at boot and this line can be removed:
27
- # EmailSender.activate
28
- module Subscriber
29
- def self.included(base)
30
- base.extend base
31
-
32
- base.mattr_accessor :event_actions
33
- base.event_actions = {}
34
-
35
- Spree::Event.subscriber_registry.register(base)
36
- end
37
-
38
- # Declares a method name in the including module that can be subscribed/unsubscribed
39
- # to an event.
40
- #
41
- # @param method_name [String, Symbol] the method that will be called when the subscribed event is fired
42
- # @param event_name [String, Symbol] the name of the event to be subscribed
43
- #
44
- # @example Declares 'send_email' as an event action that can subscribe the event 'order_finalized'
45
- # module EmailSender
46
- # event_action :send_email, event_name: :order_finalized
47
- #
48
- # def send_email(event)
49
- # Mailer.send_email(event.payload[:order])
50
- # end
51
- # end
52
- #
53
- # @example Same as above, but the method name is same as the event name:
54
- # module EmailSender
55
- # event_action :order_completed
56
- #
57
- # def order_completed(event)
58
- # Mailer.send_email(event.payload[:order])
59
- # end
60
- # end
61
- def event_action(method_name, event_name: nil)
62
- event_actions[method_name] = (event_name || method_name).to_s
63
- end
64
-
65
- # Activates all declared event actions to their events. Only actions that are activated
66
- # will be called when their event fires.
67
- #
68
- # @example activate all event actions for module 'EmailSender'
69
- # EmailSender.activate
70
- def activate
71
- Spree::Event.subscriber_registry.activate_subscriber(self)
72
- end
73
-
74
- # Deactivates all declared event actions (or a single specific one) from their events.
75
- # This means that when an event fires then none of its unsubscribed event actions will
76
- # be called.
77
- # @example deactivate all event actions for module 'EmailSender'
78
- # EmailSender.deactivate
79
- # @example deactivate only order_finalized for module 'EmailSender'
80
- # EmailSender.deactivate(:order_finalized)
81
- def deactivate(event_action_name = nil)
82
- Spree::Event.subscriber_registry.deactivate_subscriber(self, event_action_name)
83
- end
84
- end
85
- end
86
- end