solidus_bolt 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/sandbox +6 -1
- data/lib/generators/solidus_bolt/install/install_generator.rb +27 -7
- data/lib/solidus_bolt/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89aae31a58ea5e33c4ec759f8f3ccca8c9cde9c397986074ca0d980b701b6281
|
4
|
+
data.tar.gz: 1f02b9e4d932af604eabb21bc3fe5af3cb2e7e9c6991d431a6715ced090890e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ca7162deec70cf4296d2a14ff3bc234c7ddb8a97619cb9a26e33092cc21621283bf36a0d866f000ba6ed2358afbfee9c728cc8255aed272184c66d1d9f853e1
|
7
|
+
data.tar.gz: d216520effb6569e31f6685e7472047523453ff68e0b15bed56b5a22a64aa712f5e888ff791a25c75a04de73b656d3a640f54e3850238534ec902c7bbbdf2261
|
data/bin/sandbox
CHANGED
@@ -49,7 +49,12 @@ fi
|
|
49
49
|
|
50
50
|
cd ./sandbox
|
51
51
|
cat <<RUBY >> Gemfile
|
52
|
-
gem
|
52
|
+
gem "solidus_core", git: "https://github.com/solidusio/solidus.git", ref: '$BRANCH'
|
53
|
+
gem "solidus_backend", git: "https://github.com/solidusio/solidus.git", ref: "$BRANCH"
|
54
|
+
gem "solidus_api", git: "https://github.com/solidusio/solidus.git", ref: "$BRANCH"
|
55
|
+
gem "solidus_sample", git: "https://github.com/solidusio/solidus.git", ref: "$BRANCH"
|
56
|
+
gem "solidus_frontend", git: "https://github.com/solidusio/solidus_frontend.git", ref: "$BRANCH"
|
57
|
+
|
53
58
|
gem 'solidus_auth_devise', '>= 2.1.0'
|
54
59
|
gem 'rails-i18n'
|
55
60
|
gem 'solidus_i18n'
|
@@ -40,26 +40,46 @@ module SolidusBolt
|
|
40
40
|
solidus_social_initializer_file = 'config/initializers/solidus_social.rb'
|
41
41
|
return if File.readlines(solidus_social_initializer_file).grep(/bolt/).any?
|
42
42
|
|
43
|
-
matcher = /
|
43
|
+
matcher = /(Spree::SocialConfig\.configure\sdo\s\|config\|.*progname\s=\s'omniauth')/m
|
44
|
+
# rubocop:disable Layout/HeredocIndentation
|
44
45
|
a = <<~BOLT_PROVIDER
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
}
|
46
|
+
Rails.application.config.to_prepare do
|
47
|
+
Spree::SocialConfig.configure do |c|
|
48
|
+
c.use_static_preferences!
|
49
|
+
|
50
|
+
c.providers = {}
|
50
51
|
|
51
52
|
begin
|
52
|
-
|
53
|
+
c.providers[:bolt] = {
|
53
54
|
api_key: SolidusBolt::BoltConfiguration.fetch.publishable_key,
|
54
55
|
api_secret: SolidusBolt::BoltConfiguration.fetch.api_key,
|
55
56
|
}
|
56
57
|
rescue StandardError
|
57
58
|
end
|
59
|
+
end
|
60
|
+
|
61
|
+
SolidusSocial.init_providers
|
62
|
+
end
|
63
|
+
|
64
|
+
OmniAuth.config.logger = Logger.new(STDOUT)
|
65
|
+
OmniAuth.logger.progname = 'omniauth'
|
66
|
+
OmniAuth.config.allowed_request_methods = [:get]
|
58
67
|
BOLT_PROVIDER
|
68
|
+
# rubocop:enable Layout/HeredocIndentation
|
59
69
|
|
60
70
|
gsub_file solidus_social_initializer_file, matcher, a
|
61
71
|
end
|
62
72
|
|
73
|
+
def add_omniauth_middleware
|
74
|
+
bolt_middleware_initializer = <<~BOLT_PROVIDER
|
75
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
76
|
+
provider :bolt, publishable_key: SolidusBolt::BoltConfiguration.fetch.publishable_key,
|
77
|
+
api_key: SolidusBolt::BoltConfiguration.fetch.api_key
|
78
|
+
end
|
79
|
+
BOLT_PROVIDER
|
80
|
+
append_file 'config/initializers/solidus_social.rb', bolt_middleware_initializer
|
81
|
+
end
|
82
|
+
|
63
83
|
def run_migrations
|
64
84
|
run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask('Would you like to run the migrations now? [Y/n]')) # rubocop:disable Layout/LineLength
|
65
85
|
if run_migrations
|
data/lib/solidus_bolt/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_bolt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piyushswain
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-
|
13
|
+
date: 2022-09-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: coffee-rails
|