solidus_social 1.0.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +35 -0
  3. data/.gem_release.yml +5 -0
  4. data/.gitignore +6 -8
  5. data/.rspec +3 -3
  6. data/.rubocop.yml +3 -7
  7. data/.rubocop_todo.yml +42 -0
  8. data/CHANGELOG.md +34 -4
  9. data/Gemfile +23 -0
  10. data/{LICENSE.md → LICENSE} +2 -2
  11. data/README.md +133 -78
  12. data/Rakefile +4 -13
  13. data/app/controllers/spree/admin/authentication_methods_controller.rb +2 -12
  14. data/app/controllers/spree/omniauth_callbacks_controller.rb +46 -42
  15. data/app/controllers/spree/user_authentications_controller.rb +3 -1
  16. data/app/core/spree/permission_sets/authentication_method_display.rb +11 -0
  17. data/app/core/spree/permission_sets/authentication_method_management.rb +11 -0
  18. data/app/decorators/controllers/solidus_social/spree/user_registrations_controller_decorator.rb +27 -0
  19. data/app/decorators/models/solidus_social/spree/user_decorator.rb +28 -0
  20. data/app/helpers/spree/omniauth_callbacks_helper.rb +2 -0
  21. data/app/models/spree/authentication_method.rb +8 -2
  22. data/app/models/spree/social_configuration.rb +3 -0
  23. data/app/models/spree/user_authentication.rb +3 -1
  24. data/app/overrides/add_authentications_to_account_summary.rb +2 -0
  25. data/app/overrides/admin_configuration_decorator.rb +9 -2
  26. data/app/overrides/user_registrations_decorator.rb +2 -0
  27. data/app/views/spree/admin/authentication_methods/_form.html.erb +6 -22
  28. data/app/views/spree/admin/authentication_methods/edit.html.erb +5 -3
  29. data/app/views/spree/admin/authentication_methods/index.html.erb +22 -18
  30. data/app/views/spree/admin/authentication_methods/new.html.erb +5 -3
  31. data/app/views/spree/shared/_social.html.erb +5 -5
  32. data/app/views/spree/shared/_user_form.html.erb +3 -3
  33. data/app/views/spree/users/_new-customer.html.erb +2 -2
  34. data/app/views/spree/users/_social.html.erb +24 -22
  35. data/bin/console +17 -0
  36. data/bin/rails +15 -4
  37. data/bin/rake +7 -0
  38. data/bin/sandbox +72 -0
  39. data/bin/setup +8 -0
  40. data/config/locales/en.yml +1 -0
  41. data/config/locales/es-MX.yml +8 -4
  42. data/config/locales/es.yml +30 -0
  43. data/config/locales/it.yml +26 -0
  44. data/config/routes.rb +7 -5
  45. data/db/migrate/20120120163432_create_user_authentications.rb +3 -1
  46. data/db/migrate/20120123163222_create_authentication_methods.rb +3 -1
  47. data/lib/generators/solidus_social/install/install_generator.rb +13 -5
  48. data/lib/generators/solidus_social/install/templates/config/initializers/solidus_social.rb +50 -0
  49. data/lib/solidus_social.rb +24 -8
  50. data/lib/solidus_social/engine.rb +29 -55
  51. data/lib/solidus_social/facebook_omniauth_strategy_ext.rb +25 -0
  52. data/lib/solidus_social/factories.rb +4 -0
  53. data/lib/solidus_social/version.rb +3 -16
  54. data/solidus_social.gemspec +43 -46
  55. data/spec/controllers/spree/omniauth_callbacks_controller_spec.rb +42 -9
  56. data/spec/features/spree/admin/authentication_methods_configuration_spec.rb +21 -27
  57. data/spec/features/spree/sign_in_spec.rb +27 -19
  58. data/spec/lib/solidus_social/engine_spec.rb +9 -0
  59. data/spec/lib/solidus_social_speec.rb +25 -0
  60. data/spec/lib/spree/social_config_spec.rb +11 -0
  61. data/spec/models/spree/authentication_method_spec.rb +19 -0
  62. data/spec/models/spree/social_configuration_spec.rb +6 -0
  63. data/spec/models/spree/user_decorator_spec.rb +25 -2
  64. data/spec/spec_helper.rb +17 -29
  65. data/spec/support/omniauth.rb +4 -0
  66. metadata +71 -198
  67. data/.hound.yml +0 -26
  68. data/.travis.yml +0 -19
  69. data/Guardfile +0 -10
  70. data/app/assets/javascripts/spree/backend/solidus_social.js +0 -1
  71. data/app/assets/javascripts/spree/frontend/solidus_social.js +0 -1
  72. data/app/assets/stylesheets/spree/backend/solidus_social.css +0 -3
  73. data/app/controllers/spree/user_registrations_controller_decorator.rb +0 -15
  74. data/app/models/spree/user_decorator.rb +0 -16
  75. data/app/views/spree/admin/shared/_configurations_menu.html.erb +0 -4
  76. data/config/initializers/devise.rb +0 -13
  77. data/spec/lib/spree_social/engine_spec.rb +0 -16
  78. data/spec/support/capybara.rb +0 -18
  79. data/spec/support/database_cleaner.rb +0 -24
  80. data/spec/support/devise.rb +0 -3
  81. data/spec/support/factory_girl.rb +0 -7
  82. data/spec/support/spree.rb +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3fe49d36ea644340c59c66b5e8506ab57a466f6c
4
- data.tar.gz: d42af370d565407ebdbccbe60d32fbcbef814478
2
+ SHA256:
3
+ metadata.gz: a86b6cfe4109e24c01c128b99b42a23c5387001a642acbdb4ae78d0efbf5e108
4
+ data.tar.gz: 116bca0155aa00db87caac0c00a59bbc2139729e2addd378d7159641ba424613
5
5
  SHA512:
6
- metadata.gz: 836eb284a9553b79eec6a3738a50cb30cb37162dad469fccee63ec153b4b7c888268d8beae8564a47efae281811c0f14f9ebf1f5f72136092eb32655428f4b79
7
- data.tar.gz: 9b458f66b04f4ab4be83f0d4c151f5096cce9ff51790a2b9de95bba362e14e602d3fd392ae817491970ca4a6bd6cc55eb4c9eb30e788a615b566632ccd9e11b1
6
+ metadata.gz: 3d37b9986abcee5ddd8dd82c003f92b5a497ccbe36c619268f20fc390db9375dd88a05a4536942418afc4193e147fd82028b136d4578cd8888157daa4ea5ce7c
7
+ data.tar.gz: 737587a8380670d75146924a52a3794bf628679e6b1701129b10f88fbace10259920b5654b9108f7ba0859a739f529d2c5249afc5e91941cd6016b7ccfc6708b
@@ -0,0 +1,35 @@
1
+ version: 2.1
2
+
3
+ orbs:
4
+ # Always take the latest version of the orb, this allows us to
5
+ # run specs against Solidus supported versions only without the need
6
+ # to change this configuration every time a Solidus version is released
7
+ # or goes EOL.
8
+ solidusio_extensions: solidusio/extensions@volatile
9
+
10
+ jobs:
11
+ run-specs-with-postgres:
12
+ executor: solidusio_extensions/postgres
13
+ steps:
14
+ - solidusio_extensions/run-tests
15
+ run-specs-with-mysql:
16
+ executor: solidusio_extensions/mysql
17
+ steps:
18
+ - solidusio_extensions/run-tests
19
+
20
+ workflows:
21
+ "Run specs on supported Solidus versions":
22
+ jobs:
23
+ - run-specs-with-postgres
24
+ - run-specs-with-mysql
25
+ "Weekly run specs against master":
26
+ triggers:
27
+ - schedule:
28
+ cron: "0 0 * * 4" # every Thursday
29
+ filters:
30
+ branches:
31
+ only:
32
+ - master
33
+ jobs:
34
+ - run-specs-with-postgres
35
+ - run-specs-with-mysql
data/.gem_release.yml ADDED
@@ -0,0 +1,5 @@
1
+ bump:
2
+ recurse: false
3
+ file: 'lib/solidus_social/version.rb'
4
+ message: Bump SolidusSocial to %{version}
5
+ tag: true
data/.gitignore CHANGED
@@ -1,18 +1,16 @@
1
+ *.gem
1
2
  \#*
2
3
  *~
3
4
  .#*
4
5
  .DS_Store
5
6
  .idea
6
7
  .project
8
+ .sass-cache
9
+ coverage
10
+ Gemfile.lock
7
11
  tmp
8
12
  nbproject
13
+ pkg
9
14
  *.swp
10
15
  spec/dummy
11
- .rvmrc
12
- .bundle
13
- Gemfile.lock
14
- coverage
15
- .ruby-version
16
- .ruby-gemset
17
- .node-version
18
- .phantom-version
16
+ spec/examples.txt
data/.rspec CHANGED
@@ -1,3 +1,3 @@
1
- --colour
2
- -r spec_helper
3
- -f documentation
1
+ --color
2
+ --format documentation
3
+ --require spec_helper
data/.rubocop.yml CHANGED
@@ -1,8 +1,4 @@
1
- ---
2
- inherit_from: .hound.yml
1
+ require:
2
+ - solidus_dev_support/rubocop
3
3
 
4
- AllCops:
5
- Exclude:
6
- - spec/dummy/**/*
7
- - bin/*
8
- - Guardfile
4
+ inherit_from: .rubocop_todo.yml
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,42 @@
1
+ Metrics/LineLength:
2
+ Enabled: true
3
+ Max: 160
4
+
5
+ Rails/FilePath:
6
+ Enabled: false
7
+
8
+ RSpec/AnyInstance:
9
+ Enabled: false
10
+
11
+ RSpec/ContextWording:
12
+ Enabled: false
13
+
14
+ RSpec/DescribeClass:
15
+ Enabled: false
16
+
17
+ RSpec/InstanceVariable:
18
+ Enabled: false
19
+
20
+ RSpec/MessageSpies:
21
+ Enabled: false
22
+
23
+ RSpec/MultipleExpectations:
24
+ Enabled: false
25
+
26
+ RSpec/NamedSubject:
27
+ Enabled: false
28
+
29
+ RSpec/NestedGroups:
30
+ Enabled: false
31
+
32
+ Style/NestedParenthesizedCalls:
33
+ Enabled: false
34
+
35
+ RSpec/VerifiedDoubles:
36
+ Enabled: false
37
+
38
+ Style/ClassAndModuleChildren:
39
+ Enabled: false
40
+
41
+ Style/GuardClause:
42
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
- ## Solidus Social 1.0.0
1
+ ## Unreleased
2
2
 
3
- * Renamed SpreeSocial to SolidusSocial
4
- * Relaxed versions to support solidus 1.0+
5
- * Port of https://github.com/DynamoMTL/spree_social's solidus branch
3
+ ## v1.3.0
4
+
5
+ - Migrated factories from FactoryGirl to FactoryBot
6
+ - Add support for Solidus 2.4+
7
+ - Reduced compatible versions of `solidus_core` to 2.x
8
+ - Removed the deprecated `icon:` argument from admin buttons
9
+ - Fixed an issue when using Safari to authenticate
10
+ - `Spree::UserRegistrationsController` and `Spree.user_class` are now decorated by
11
+ prepending modules in the `SolidusSocial::Spree` namespace instead of using `class_eval`
12
+ - Development of the extension is not relying on `solidus_dev_support` and CircleCI
13
+ - Moved the Facebook strategy patch to it's own prepended module
14
+
15
+ ## v1.2.0
16
+
17
+ - Switched to using the install generator to import the solidus social
18
+ initializer into apps. **Please run `bin/rails generate solidus_social:install`
19
+ in order to upgrade.**
20
+ - Removed the `SolidusSocial::OAUTH_PROVIDERS` constant in favour of
21
+ the `Spree::AuthenticationMethod.providers_options` class
22
+ method. This is populated using the `Spree::SocialConfig#providers` Hash.
23
+ - Added support for Rails 5.1.
24
+ - Added Italian translations
25
+
26
+ ## v1.1.0
27
+
28
+ - Added support for Solidus 2/Rails 5
29
+ - Bugfixes
30
+
31
+ ## v1.0.0
32
+
33
+ - Renamed SpreeSocial to SolidusSocial
34
+ - Relaxed versions to support solidus 1.0+
35
+ - Port of https://github.com/DynamoMTL/spree_social's solidus branch
data/Gemfile CHANGED
@@ -1,7 +1,30 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
4
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
2
5
 
3
6
  branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
4
7
  gem 'solidus', github: 'solidusio/solidus', branch: branch
8
+
9
+ # Needed to help Bundler figure out how to resolve dependencies,
10
+ # otherwise it takes forever to resolve them.
11
+ # See https://github.com/bundler/bundler/issues/6677
12
+ gem 'rails', '>0.a'
13
+
14
+ # Provides basic authentication functionality for testing parts of your engine
5
15
  gem 'solidus_auth_devise'
6
16
 
17
+ case ENV['DB']
18
+ when 'mysql'
19
+ gem 'mysql2'
20
+ when 'postgresql'
21
+ gem 'pg'
22
+ else
23
+ gem 'sqlite3'
24
+ end
25
+
7
26
  gemspec
27
+
28
+ # Use a local Gemfile to include development dependencies that might not be
29
+ # relevant for the project or for other contributors, e.g.: `gem 'pry-debug'`.
30
+ send :eval_gemfile, 'Gemfile-local' if File.exist? 'Gemfile-local'
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014 John Dyer and other contributors
1
+ Copyright (c) 2014-2020 John Dyer and other contributors
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification,
@@ -9,7 +9,7 @@ are permitted provided that the following conditions are met:
9
9
  * Redistributions in binary form must reproduce the above copyright notice,
10
10
  this list of conditions and the following disclaimer in the documentation
11
11
  and/or other materials provided with the distribution.
12
- * Neither the name Spree nor the names of its contributors may be used to
12
+ * Neither the name Solidus nor the names of its contributors may be used to
13
13
  endorse or promote products derived from this software without specific
14
14
  prior written permission.
15
15
 
data/README.md CHANGED
@@ -1,137 +1,188 @@
1
- # Solidus Social
1
+ SolidusSocial
2
+ =============
2
3
 
3
- [![Build Status](https://travis-ci.org/solidusio-contrib/solidus_social.svg?branch=master)](https://travis-ci.org/solidusio-contrib/solidus_social)
4
+ [![CircleCI](https://circleci.com/gh/solidusio-contrib/solidus_social.svg?style=svg)](https://circleci.com/gh/solidusio-contrib/solidus_social)
4
5
  [![Code Climate](https://codeclimate.com/github/solidusio-contrib/solidus_social/badges/gpa.svg)](https://codeclimate.com/github/solidusio-contrib/solidus_social)
5
6
 
6
- Core for all social media related functionality for Solidus.
7
- The Solidus Social gem handles authorization, account creation and association through social media sources such as Twitter and Facebook.
8
- This gem is beta at best and should be treated as such.
9
- Features and code base will change rapidly as this is under active development.
10
- Use with caution.
7
+ Social login support for Solidus. Solidus Social handles authorization, account
8
+ creation and association through third-party services. Currently Twitter,
9
+ Facebook, Github, Google OAuth2, and Amazon are available out of the box.
11
10
 
12
- ---
11
+ Installation
12
+ ------------
13
13
 
14
- ## Setup for Production
14
+ Add solidus_social to your Gemfile:
15
15
 
16
- Add this extension to your `Gemfile`:
17
16
  ```ruby
18
17
  gem 'solidus_social'
19
18
  ```
20
19
 
21
- Then run:
22
- ```sh
23
- $ bundle && bundle exec rails g solidus_social:install
24
- $ bundle exec rake db:migrate
25
- ```
26
-
27
- Preference(optional): By default url will be '/users/auth/:provider'. If you wish to modify the url to: '/member/auth/:provider', '/profile/auth/:provider', or '/auth/:provider' then you can do this accordingly in your **config/initializers/spree.rb** file as described below -
20
+ Bundle your dependencies and run the installation generator:
28
21
 
29
- ```ruby
30
- Spree::SocialConfig[:path_prefix] = 'member' # for /member/auth/:provider
31
- Spree::SocialConfig[:path_prefix] = 'profile' # for /profile/auth/:provider
32
- Spree::SocialConfig[:path_prefix] = '' # for /auth/:provider
22
+ ```shell
23
+ bundle
24
+ bundle exec rails g solidus_social:install
25
+ bundle exec rails db:migrate
33
26
  ```
34
27
 
35
- ---
28
+ This will install a new initializer `config/initializers/solidus_social.rb` into
29
+ your project that allows you to setup the services you want configured for your app.
36
30
 
37
- ## Spree Setup to Utilize OAuth Sources
31
+ Optional: By default the login path will be '/users/auth/:provider'. If you
32
+ want something else, configure it in `config/initializers/solidus_social.rb`.
38
33
 
39
- Login as an admin user and navigate to Configuration > Social Authentication Methods
40
34
 
41
- Click on the New Authentication Method button to enter the key obtained from their respective source, (See below for instructions on setting up the various providers).
35
+ Using OAuth Sources
36
+ -------------------
42
37
 
43
- Multiple key entries can now be entered based on the rails environment. This allows for portability and the lack of need to check in your key to your repository. You also have the ability to enable and disable sources. These setting will be reflected on the client UI as well.
38
+ Login as an admin user and navigate to Configuration > Social Authentication Methods
44
39
 
45
- Alternatively you can ship keys as environment variables and create these Authentication Method records on application boot via an initializer. Below is an example for facebook.
46
-
47
- ```ruby
48
- # Ensure our environment is bootstrapped with a facebook connect app
49
- if ActiveRecord::Base.connection.table_exists? 'spree_authentication_methods'
50
- Spree::AuthenticationMethod.where(environment: Rails.env, provider: 'facebook').first_or_create do |auth_method|
51
- auth_method.api_key = ENV['FACEBOOK_APP_ID']
52
- auth_method.api_secret = ENV['FACEBOOK_APP_SECRET']
53
- auth_method.active = true
54
- end
55
- end
56
- ```
40
+ Click "New Authentication Method" and choose one of your configured providers.
57
41
 
58
42
  **You MUST restart your application after configuring or updating an authentication method.**
59
43
 
60
- ---
61
-
62
- ## Setup the Applications at the Respective Sources
44
+ Registering Your Application
45
+ ----------------------------
63
46
 
64
- OAuth Applications @ Facebook, Twitter and / or Github are supported out of the box but you will need to setup applications are each respective site as follows for public use and for development.
47
+ Facebook, Twitter, Github, Google OAuth2, and Amazon are supported out of the
48
+ box but, you will need to register your application with each of the sites you
49
+ want to use.
65
50
 
66
- > All URLs must be in the form of domain.tld you may add a port as well for development
51
+ When setting up development applications, keep in mind that most services do
52
+ not support `localhost` for your URL/domain. You will need to us a regular
53
+ domain (i.e. `domain.tld`, `hostname.local`) or an IP addresses (`127.0.0.1`).
54
+ Make sure you specifity the right IP address.
67
55
 
68
56
  ### Facebook
69
57
 
70
58
  [Facebook / Developers / Apps][2]
71
59
 
72
- 1. Name the app what you will and agree to the terms.
73
- 2. Fill out the capcha
74
- 3. Under the Web Site tab
75
- 4. Site URL: http://your_computer.local:3000 for development / http://your-site.com for production
76
- 5. Site domain: your-computer.local / your-site.com respectively
60
+ 1. Name the app and agree to the terms.
61
+ 2. Fill out the capcha.
62
+ 3. Under the "Web Site" tab enter:
63
+ - Site URL: `http://yourhostname.local:3000` for development and
64
+ `http://your-site.com` for production
65
+ - Site domain: `yourhostname.local` and `your-site.com` respectively
77
66
 
78
67
  ### Twitter
79
68
 
80
69
  [Twitter / Application Management / Create an application][3]
81
70
 
82
- 1. Name and Description must be filled in with something
83
- 2. Application Website: http://your_computer.local:3000 for development / http://your-site.com for production
84
- 3. Application Type: Browser
85
- 4. Callback URL: http://your_computer.local:3000 for development / http://your-site.com for production
86
- 5. Default Access Type: Read & Write
87
- 6. Save Application
71
+ 1. Fill in the name and description.
72
+ 2. Fill in the rest of the details:
73
+ - Application Website: `http://yourhostname.local:3000` for development and
74
+ `http://your-site.com` for production
75
+ - Application Type: "Browser"
76
+ - Callback URL: `http://yourhostname.local:3000` for development and
77
+ `http://your-site.com` for production
78
+ - Default Access Type: "Read & Write"
79
+ 6. Save the application.
88
80
 
89
81
  ### Github
90
82
 
91
83
  [Github / Applications / Register a new OAuth application][4]
92
84
 
93
- 1. Name The Application
94
- 2. Main URL: http://your_computer.local:3000 for development / http://your-site.com for production
95
- 3. Callback URL: http://your_computer.local:3000 for development / http://your-site.com for production
96
- 4. Click Create
97
-
98
- > This does not seem to be a listed Github item right now. To View and / or edit your applications goto [http://github.com/account/applications](http://github.com/account/applications)
85
+ 1. Name the application.
86
+ 2. Fill in the details
87
+ - Main URL: `http://yourhostname.local:3000` for development and
88
+ `http://your-site.com` for production
89
+ - Callback URL: `http://yourhostname.local:3000` for development and
90
+ `http://your-site.com` for production
91
+ 4. Click Create.
99
92
 
100
93
  ### Amazon
101
94
 
102
95
  [Amazon / App Console / Register a new OAuth application][10]
103
96
 
104
- 1. Register New Application
105
- 2. Name the Application, provide description and URL for Privacy Policy
106
- 3. Click Save
107
- 4. Add Your site under Web Settings > Allowed Return URLs (example: http://localhost:3000/users/auth/amazon/callback)
97
+ 1. Register New Application.
98
+ 2. Name the Application, provide description and URL for Privacy Policy.
99
+ 3. Click Save.
100
+ 4. Add Your site under Web Settings > Allowed Return URLs (example:
101
+ `http://localhost:3000/users/auth/amazon/callback`)
108
102
 
109
103
  > The app console is available at [https://login.amazon.com/manageApps](https://login.amazon.com/manageApps)
110
104
 
111
- ### Other OAuth sources that are currently supported
105
+ ### Google OAuth2
106
+ [Google / APIs / Credentials/ Create Credential](https://console.developers.google.com/)
107
+
108
+ 1. In the APIs and Services dashboard, visit 'Credentials' on the side, then select 'Create Credentials' and 'Oauth client ID'.
109
+ 2. Name the Application, select "Web Application" as a type.
110
+ 3. Under "Authorized redirect URIs", add your site (example:
111
+ `http://localhost:3000/users/auth/google_oauth2/callback`)
112
+
113
+ > More info: [https://developers.google.com/identity/protocols/OAuth2](https://developers.google.com/identity/protocols/OAuth2)
114
+
115
+ ### Other OAuth Providers
112
116
 
113
- * Google (OAuth)
117
+ Other OAuth providers are supported, given that there is an [OmniAuth
118
+ strategy][12] for them. (If there isn't, you can [write one][13].)
114
119
 
115
- ## Adding other OAuth sources
120
+ #### LinkedIn Example
116
121
 
117
- It is easy to add any OAuth source, given there is an OmniAuth strategy gem for it (and if not, you can easily [write one by yourself](https://github.com/intridea/omniauth/wiki/Strategy-Contribution-Guide). For instance, if you want to add authorization via LinkedIn, the steps will be:
122
+ 1. Add `gem "omniauth-linkedin"` to your Gemfile and run `bundle install`.
123
+ 2. In `config/initializers/solidus_social.rb` add and initialize a new provider
124
+ for SolidusSocial:
118
125
 
119
- 1. Add `gem "omniauth-linkedin"` to your Gemfile, run `bundle install`.
120
- 2. In an initializer file, e.g. `config/initializers/devise.rb`, add and init a new provider for SolidusSocial:
126
+ ```ruby
121
127
 
122
- SolidusSocial::OAUTH_PROVIDERS << ['LinkedIn', 'linkedin']
123
- SolidusSocial.init_provider('linkedin')
128
+ config.providers = {
129
+ # The configuration key has to match your omniauth strategy.
130
+ linkedin: {
131
+ api_key: ENV['LINKEDIN_API_KEY'],
132
+ api_secret: ENV['LINKEDIN_API_SECRET'],
133
+ },
134
+ # More providers here
135
+ ```
136
+ 3. Activate your provider as usual.
137
+ 4. Do **one** of the following:
124
138
 
125
- 3. Activate your provider as usual (via initializer or admin interface).
126
- 4. Override `spree/users/social` view to render OAuth links in preferred way for a new one to be displayed. Or alternatively, include to your CSS a definition for `.icon-spree-linkedin-circled` and an embedded icon font for LinkedIn from [fontello.com](http://fontello.com/) (the way existing icons for Facebook, Twitter, etc are implemented). You can also override CSS classes for other providers, `.icon-spree-<provider>-circled`, to use different font icons or classic background images, without having to override views.
139
+ - Override the `spree/users/social` view to render OAuth links to display
140
+ your LinkedIn link.
141
+ - Include in your CSS a definition for `.icon-spree-linkedin-circled` and an
142
+ embedded icon font for LinkedIn from [Fontello][14] (the way existing
143
+ icons for Facebook, Twitter, etc are implemented). You can also override
144
+ CSS classes for other providers, `.icon-spree-<provider>-circled`, to use
145
+ different font icons or classic background images, without having to
146
+ override views.
127
147
 
128
- ---
148
+ Documentation
149
+ -------------
129
150
 
130
- ## Contributing
151
+ API documentation is available [on RubyDoc.info][15].
152
+
153
+ Contributing
154
+ ------------
131
155
 
132
156
  See corresponding [guidelines][11].
133
157
 
134
- ---
158
+ Testing
159
+ -------
160
+
161
+ First bundle your dependencies, then run `rake`. `rake` will default to building the dummy app if it does not exist, then it will run specs, and [Rubocop](https://github.com/bbatsov/rubocop) static code analysis. The dummy app can be regenerated by using `rake test_app`.
162
+
163
+ ```shell
164
+ bundle
165
+ bin/rake
166
+ ```
167
+
168
+ When testing your application's integration with this extension you may use its factories.
169
+ Simply add this require statement to your spec_helper:
170
+
171
+ ```ruby
172
+ require 'solidus_social/factories'
173
+ ```
174
+
175
+ Releasing
176
+ ---------
177
+
178
+ Your new extension version can be released using `gem-release` like this:
179
+
180
+ ```shell
181
+ bundle exec gem bump -v VERSION --tag --push --remote upstream && gem release
182
+ ```
183
+
184
+ License
185
+ -------
135
186
 
136
187
  Copyright (c) 2014 [John Dyer][7] and [contributors][8], released under the [New BSD License][9]
137
188
 
@@ -143,6 +194,10 @@ Copyright (c) 2014 [John Dyer][7] and [contributors][8], released under the [New
143
194
  [6]: https://github.com/solidusio-contrib/solidus_social/issues
144
195
  [7]: https://github.com/LBRapid
145
196
  [8]: https://github.com/solidusio-contrib/solidus_social/graphs/contributors
146
- [9]: https://github.com/solidusio-contrib/solidus_social/blob/master/LICENSE.md
197
+ [9]: https://github.com/solidusio-contrib/solidus_social/blob/master/LICENSE
147
198
  [10]: https://login.amazon.com/manageApps
148
199
  [11]: https://github.com/solidusio-contrib/solidus_social/blob/master/CONTRIBUTING.md
200
+ [12]: https://github.com/intridea/omniauth/wiki/List-of-Strategies
201
+ [13]: https://github.com/intridea/omniauth/wiki/Strategy-Contribution-Guide
202
+ [14]: http://fontello.com/
203
+ [15]: http://www.rubydoc.info/github/solidusio-contrib/solidus_social/