solidus_bolt 0.7.0 → 0.7.1

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: 7a29718f8e31f9d466f5699cc9d10bb6052ce24f0e85bc2a9cead45d5ba3a3e6
4
- data.tar.gz: 037250f96ab9782723363d2137e199a97488bccec18e43a615244761e894530c
3
+ metadata.gz: 89aae31a58ea5e33c4ec759f8f3ccca8c9cde9c397986074ca0d980b701b6281
4
+ data.tar.gz: 1f02b9e4d932af604eabb21bc3fe5af3cb2e7e9c6991d431a6715ced090890e1
5
5
  SHA512:
6
- metadata.gz: 586deaa3255d4ec43442474494397c07207fada7411ab8866c21131467645dd0803f21d4e2f8c583e2aceeed7063deafe939b6c882360e3657899c260899b9fa
7
- data.tar.gz: ad351e9d4f378fd93c9dfa09993586b0cd3506bfdf0d9fdcbe088d6a4234abf0c676d4c9f2f69e21c36c291e7e785af3a41c1df6a0794c8ac751c9d3419fdfc8
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 'solidus', github: 'solidusio/solidus', branch: '$BRANCH'
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 = /amazon: {\n\s*api_key:\sENV\['AMAZON_API_KEY'\],\n\s*api_secret:\sENV\['AMAZON_API_SECRET'\],\n\s*}\n\s*}/m # rubocop:disable Layout/LineLength
43
+ matcher = /(Spree::SocialConfig\.configure\sdo\s\|config\|.*progname\s=\s'omniauth')/m
44
+ # rubocop:disable Layout/HeredocIndentation
44
45
  a = <<~BOLT_PROVIDER
45
- amazon: {
46
- api_key: ENV['AMAZON_API_KEY'],
47
- api_secret: ENV['AMAZON_API_SECRET'],
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
- config.providers[:bolt] = {
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusBolt
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.1'
5
5
  end
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.0
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-08-31 00:00:00.000000000 Z
13
+ date: 2022-09-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: coffee-rails