solidus_social 1.2.0 → 1.3.0
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 +5 -5
- data/.circleci/config.yml +35 -0
- data/.gem_release.yml +5 -0
- data/.github/stale.yml +17 -0
- data/.gitignore +6 -8
- data/.rspec +3 -3
- data/.rubocop.yml +3 -149
- data/.rubocop_todo.yml +42 -0
- data/CHANGELOG.md +31 -9
- data/Gemfile +21 -20
- data/{LICENSE.md → LICENSE} +2 -2
- data/README.md +56 -14
- data/Rakefile +4 -19
- data/app/controllers/spree/admin/authentication_methods_controller.rb +2 -0
- data/app/controllers/spree/omniauth_callbacks_controller.rb +8 -6
- data/app/controllers/spree/user_authentications_controller.rb +3 -1
- data/app/decorators/controllers/solidus_social/spree/user_registrations_controller_decorator.rb +27 -0
- data/app/decorators/models/solidus_social/spree/user_decorator.rb +28 -0
- data/app/helpers/spree/omniauth_callbacks_helper.rb +2 -0
- data/app/models/spree/authentication_method.rb +3 -1
- data/app/models/spree/social_configuration.rb +2 -0
- data/app/models/spree/user_authentication.rb +3 -1
- data/app/overrides/add_authentications_to_account_summary.rb +2 -0
- data/app/overrides/admin_configuration_decorator.rb +3 -1
- data/app/overrides/user_registrations_decorator.rb +2 -0
- data/app/views/spree/admin/authentication_methods/_form.html.erb +4 -4
- data/app/views/spree/admin/authentication_methods/edit.html.erb +2 -2
- data/app/views/spree/admin/authentication_methods/index.html.erb +10 -10
- data/app/views/spree/admin/authentication_methods/new.html.erb +2 -2
- data/app/views/spree/shared/_social.html.erb +5 -5
- data/app/views/spree/shared/_user_form.html.erb +3 -3
- data/app/views/spree/users/_new-customer.html.erb +2 -2
- data/app/views/spree/users/_social.html.erb +5 -5
- data/bin/console +17 -0
- data/bin/rails +15 -4
- data/bin/rake +7 -0
- data/bin/sandbox +72 -0
- data/bin/setup +8 -0
- data/config/locales/en.yml +1 -0
- data/config/routes.rb +6 -4
- data/db/migrate/20120120163432_create_user_authentications.rb +2 -0
- data/db/migrate/20120123163222_create_authentication_methods.rb +2 -0
- data/lib/generators/solidus_social/install/install_generator.rb +7 -5
- data/lib/generators/solidus_social/install/templates/config/initializers/solidus_social.rb +3 -1
- data/lib/solidus_social.rb +22 -7
- data/lib/solidus_social/engine.rb +29 -54
- data/lib/solidus_social/facebook_omniauth_strategy_ext.rb +25 -0
- data/lib/solidus_social/factories.rb +4 -0
- data/lib/solidus_social/version.rb +3 -16
- data/solidus_social.gemspec +43 -46
- data/spec/controllers/spree/omniauth_callbacks_controller_spec.rb +14 -9
- data/spec/features/spree/admin/authentication_methods_configuration_spec.rb +13 -10
- data/spec/features/spree/sign_in_spec.rb +13 -10
- data/spec/lib/solidus_social/engine_spec.rb +9 -0
- data/spec/lib/{spree_social/engine_spec.rb → solidus_social_speec.rb} +3 -1
- data/spec/lib/spree/social_config_spec.rb +2 -0
- data/spec/models/spree/authentication_method_spec.rb +4 -2
- data/spec/models/spree/social_configuration_spec.rb +2 -0
- data/spec/models/spree/user_decorator_spec.rb +5 -3
- data/spec/spec_helper.rb +17 -29
- data/spec/support/omniauth.rb +4 -0
- metadata +56 -196
- data/.hound.yml +0 -26
- data/.travis.yml +0 -32
- data/app/assets/javascripts/spree/backend/solidus_social.js +0 -1
- data/app/assets/javascripts/spree/frontend/solidus_social.js +0 -1
- data/app/assets/stylesheets/spree/backend/solidus_social.css +0 -3
- data/app/controllers/spree/user_registrations_controller_decorator.rb +0 -15
- data/app/models/spree/user_decorator.rb +0 -16
- data/spec/support/capybara.rb +0 -11
- data/spec/support/database_cleaner.rb +0 -23
- data/spec/support/devise.rb +0 -3
- data/spec/support/factory_girl.rb +0 -7
- data/spec/support/spree.rb +0 -8
data/.hound.yml
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
---
|
2
|
-
# Too picky.
|
3
|
-
LineLength:
|
4
|
-
Enabled: false
|
5
|
-
|
6
|
-
# This should truly be on for well documented gems.
|
7
|
-
Documentation:
|
8
|
-
Enabled: false
|
9
|
-
|
10
|
-
# Neatly aligned code is too swell.
|
11
|
-
SingleSpaceBeforeFirstArg:
|
12
|
-
Enabled: false
|
13
|
-
|
14
|
-
# Don't mess with RSpec DSL.
|
15
|
-
Blocks:
|
16
|
-
Exclude:
|
17
|
-
- 'spec/**/*'
|
18
|
-
|
19
|
-
# We really like the readability with newline in beginning of classes.
|
20
|
-
EmptyLinesAroundBlockBody:
|
21
|
-
Enabled: false
|
22
|
-
|
23
|
-
# Use nested module/class definitions instead of compact style.
|
24
|
-
# Too high git impact to change this now.
|
25
|
-
ClassAndModuleChildren:
|
26
|
-
Enabled: false
|
data/.travis.yml
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
sudo: required
|
2
|
-
cache: bundler
|
3
|
-
language: ruby
|
4
|
-
dist: trusty
|
5
|
-
addons:
|
6
|
-
apt:
|
7
|
-
packages:
|
8
|
-
- google-chrome-beta
|
9
|
-
rvm:
|
10
|
-
- 2.3.5
|
11
|
-
env:
|
12
|
-
matrix:
|
13
|
-
- SOLIDUS_BRANCH=v1.0 DB=postgres
|
14
|
-
- SOLIDUS_BRANCH=v1.1 DB=postgres
|
15
|
-
- SOLIDUS_BRANCH=v1.2 DB=postgres
|
16
|
-
- SOLIDUS_BRANCH=v1.3 DB=postgres
|
17
|
-
- SOLIDUS_BRANCH=v1.4 DB=postgres
|
18
|
-
- SOLIDUS_BRANCH=v2.0 DB=postgres
|
19
|
-
- SOLIDUS_BRANCH=v2.1 DB=postgres
|
20
|
-
- SOLIDUS_BRANCH=v2.2 DB=postgres
|
21
|
-
- SOLIDUS_BRANCH=v2.3 DB=postgres
|
22
|
-
- SOLIDUS_BRANCH=master DB=postgres
|
23
|
-
- SOLIDUS_BRANCH=v1.0 DB=mysql
|
24
|
-
- SOLIDUS_BRANCH=v1.1 DB=mysql
|
25
|
-
- SOLIDUS_BRANCH=v1.2 DB=mysql
|
26
|
-
- SOLIDUS_BRANCH=v1.3 DB=mysql
|
27
|
-
- SOLIDUS_BRANCH=v1.4 DB=mysql
|
28
|
-
- SOLIDUS_BRANCH=v2.0 DB=mysql
|
29
|
-
- SOLIDUS_BRANCH=v2.1 DB=mysql
|
30
|
-
- SOLIDUS_BRANCH=v2.2 DB=mysql
|
31
|
-
- SOLIDUS_BRANCH=v2.3 DB=mysql
|
32
|
-
- SOLIDUS_BRANCH=master DB=mysql
|
@@ -1 +0,0 @@
|
|
1
|
-
//= require spree/backend
|
@@ -1 +0,0 @@
|
|
1
|
-
//= require spree/frontend
|
@@ -1,15 +0,0 @@
|
|
1
|
-
Spree::UserRegistrationsController.class_eval do
|
2
|
-
after_action :clear_omniauth, only: :create
|
3
|
-
|
4
|
-
private
|
5
|
-
|
6
|
-
def build_resource(*args)
|
7
|
-
super
|
8
|
-
@spree_user.apply_omniauth(session[:omniauth]) if session[:omniauth]
|
9
|
-
@spree_user
|
10
|
-
end
|
11
|
-
|
12
|
-
def clear_omniauth
|
13
|
-
session[:omniauth] = nil unless @spree_user.new_record?
|
14
|
-
end
|
15
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
Spree.user_class.class_eval do
|
2
|
-
has_many :user_authentications, dependent: :destroy
|
3
|
-
|
4
|
-
devise :omniauthable
|
5
|
-
|
6
|
-
def apply_omniauth(omniauth)
|
7
|
-
if omniauth.fetch('info', {})['email'].present?
|
8
|
-
self.email = omniauth['info']['email'] if email.blank?
|
9
|
-
end
|
10
|
-
user_authentications.build(provider: omniauth['provider'], uid: omniauth['uid'])
|
11
|
-
end
|
12
|
-
|
13
|
-
def password_required?
|
14
|
-
(user_authentications.empty? || !password.blank?) && super
|
15
|
-
end
|
16
|
-
end
|
data/spec/support/capybara.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'capybara/rspec'
|
2
|
-
require 'capybara/rails'
|
3
|
-
require 'capybara/poltergeist'
|
4
|
-
require 'capybara-screenshot/rspec'
|
5
|
-
require 'selenium-webdriver'
|
6
|
-
|
7
|
-
RSpec.configure do |config|
|
8
|
-
config.include Rack::Test::Methods, type: :requests
|
9
|
-
|
10
|
-
Capybara.javascript_driver = :selenium_chrome_headless
|
11
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'database_cleaner'
|
2
|
-
|
3
|
-
RSpec.configure do |config|
|
4
|
-
config.before(:suite) do
|
5
|
-
DatabaseCleaner.clean_with :truncation
|
6
|
-
end
|
7
|
-
|
8
|
-
config.before do
|
9
|
-
DatabaseCleaner.strategy = :transaction
|
10
|
-
end
|
11
|
-
|
12
|
-
config.before(:each, :js) do
|
13
|
-
DatabaseCleaner.strategy = :truncation
|
14
|
-
end
|
15
|
-
|
16
|
-
config.before do
|
17
|
-
DatabaseCleaner.start
|
18
|
-
end
|
19
|
-
|
20
|
-
config.after do
|
21
|
-
DatabaseCleaner.clean
|
22
|
-
end
|
23
|
-
end
|
data/spec/support/devise.rb
DELETED
data/spec/support/spree.rb
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
require 'spree/testing_support/factories'
|
2
|
-
require 'spree/testing_support/authorization_helpers'
|
3
|
-
require 'spree/testing_support/url_helpers'
|
4
|
-
require 'spree/testing_support/capybara_ext'
|
5
|
-
|
6
|
-
RSpec.configure do |config|
|
7
|
-
config.include Spree::TestingSupport::UrlHelpers
|
8
|
-
end
|