Skip to content

Commit eaba0e4

Browse files
committed
standardrb --fix
1 parent b56e759 commit eaba0e4

60 files changed

Lines changed: 717 additions & 717 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Gemfile

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
# frozen_string_literal: true
22

3-
source 'https://rubygems.org'
3+
source "https://rubygems.org"
44
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
55

6-
branch = ENV.fetch('SOLIDUS_BRANCH', 'main')
7-
gem 'solidus', github: 'solidusio/solidus', branch: branch
8-
gem 'solidus_backend', github: 'solidusio/solidus', branch: branch
6+
branch = ENV.fetch("SOLIDUS_BRANCH", "main")
7+
gem "solidus", github: "solidusio/solidus", branch: branch
8+
gem "solidus_backend", github: "solidusio/solidus", branch: branch
99

10-
rails_requirement_string = ENV.fetch('RAILS_VERSION', '~> 7.0')
11-
gem 'rails', rails_requirement_string
10+
rails_requirement_string = ENV.fetch("RAILS_VERSION", "~> 7.0")
11+
gem "rails", rails_requirement_string
1212

1313
# The solidus_frontend gem has been pulled out since v3.2
14-
if branch >= 'v3.2'
15-
gem 'solidus_frontend'
16-
elsif branch == 'main'
17-
gem 'solidus_frontend', github: 'solidusio/solidus_frontend'
14+
if branch >= "v3.2"
15+
gem "solidus_frontend"
16+
elsif branch == "main"
17+
gem "solidus_frontend", github: "solidusio/solidus_frontend"
1818
else
19-
gem 'solidus_frontend', github: 'solidusio/solidus', branch: branch
19+
gem "solidus_frontend", github: "solidusio/solidus", branch: branch
2020
end
2121

22-
case ENV.fetch('DB', nil)
23-
when 'mysql'
24-
gem 'mysql2'
25-
when 'postgresql'
26-
gem 'pg'
22+
case ENV.fetch("DB", nil)
23+
when "mysql"
24+
gem "mysql2"
25+
when "postgresql"
26+
gem "pg"
2727
else
2828
rails_version = Gem::Requirement.new(rails_requirement_string).requirements[0][1]
29-
sqlite_version = rails_version < Gem::Version.new(7.2) ? "~> 1.4" : "~> 2.0"
29+
sqlite_version = (rails_version < Gem::Version.new(7.2)) ? "~> 1.4" : "~> 2.0"
3030

31-
gem 'sqlite3', sqlite_version
31+
gem "sqlite3", sqlite_version
3232
end
3333

34-
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3')
34+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3")
3535
# While we still support Ruby < 3 we need to workaround a limitation in
3636
# the 'async' gem that relies on the latest ruby, since RubyGems doesn't
3737
# resolve gems based on the required ruby version.
38-
gem 'async', '< 3', require: false
38+
gem "async", "< 3", require: false
3939
end
4040

4141
# 'net/smtp' is required by 'mail', see:
4242
# - https://github.com/ruby/net-protocol/issues/10
4343
# - https://stackoverflow.com/a/72474475
44-
gem 'net-smtp', require: false
44+
gem "net-smtp", require: false
4545

4646
gemspec
4747

@@ -50,4 +50,4 @@ gemspec
5050
#
5151
# We use `send` instead of calling `eval_gemfile` to work around an issue with
5252
# how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658.
53-
send(:eval_gemfile, 'Gemfile-local') if File.exist? 'Gemfile-local'
53+
send(:eval_gemfile, "Gemfile-local") if File.exist? "Gemfile-local"

Rakefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# frozen_string_literal: true
22

33
# Don't build a dummy app with solidus_bolt enabled
4-
ENV['SKIP_SOLIDUS_BOLT'] = 'true'
4+
ENV["SKIP_SOLIDUS_BOLT"] = "true"
55

6-
require 'bundler/gem_tasks'
6+
require "bundler/gem_tasks"
77

8-
require 'solidus_dev_support/rake_tasks'
8+
require "solidus_dev_support/rake_tasks"
99
SolidusDevSupport::RakeTasks.install(user_class: "Spree::User")
1010

11-
task default: 'extension:specs'
11+
task default: "extension:specs"

app/models/spree/user.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class User < Spree::Base
55
include UserMethods
66

77
devise :database_authenticatable, :registerable, :recoverable,
8-
:rememberable, :trackable, :validatable, :encryptable
8+
:rememberable, :trackable, :validatable, :encryptable
99
devise :confirmable if Spree::Auth::Config[:confirmable]
1010

1111
if defined?(Spree::SoftDeletable)
@@ -35,7 +35,7 @@ def self.admin_created?
3535
end
3636

3737
def admin?
38-
has_spree_role?('admin')
38+
has_spree_role?("admin")
3939
end
4040

4141
def confirmed?

config/initializers/devise.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
Devise.setup do |config|
66
# ==> Mailer Configuration
77
# Configure the e-mail address which will be shown in DeviseMailer.
8-
config.mailer_sender = 'please-change-me@config-initializers-devise.com'
8+
config.mailer_sender = "please-change-me@config-initializers-devise.com"
99

1010
# Configure the class responsible to send e-mails.
11-
config.mailer = 'Spree::UserMailer'
11+
config.mailer = "Spree::UserMailer"
1212

1313
# ==> ORM configuration
1414
# Load and configure the ORM. Supports :active_record (default) and
1515
# :mongoid (bson_ext recommended) by default. Other ORMs may be
1616
# available as additional gems.
17-
require 'devise/orm/active_record'
17+
require "devise/orm/active_record"
1818

1919
# ==> Configuration for any authentication mechanism
2020
# Configure which keys are used when authenticating an user. By default is
@@ -34,13 +34,13 @@
3434
# config.http_authenticatable_on_xhr = false
3535

3636
# The realm used in Http Basic Authentication
37-
config.http_authentication_realm = 'Spree Application'
37+
config.http_authentication_realm = "Spree Application"
3838

3939
# ==> Configuration for :database_authenticatable
4040
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
4141
# using other encryptors, it sets how many times you want the password re-encrypted.
4242
config.stretches = 20
43-
config.encryptor = 'authlogic_sha512'
43+
config.encryptor = "authlogic_sha512"
4444

4545
# Setup a pepper to generate the encrypted password.
4646
config.pepper = if Rails.configuration.respond_to?(:secret_token) && Rails.configuration.secret_token.present?

config/routes.rb

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,64 +3,64 @@
33
Spree::Core::Engine.routes.draw do
44
if SolidusSupport.frontend_available? && Spree::Auth::Config.draw_frontend_routes
55
devise_for(:spree_user, {
6-
class_name: 'Spree::User',
6+
class_name: "Spree::User",
77
controllers: {
8-
sessions: 'spree/user_sessions',
9-
registrations: 'spree/user_registrations',
10-
passwords: 'spree/user_passwords',
11-
confirmations: 'spree/user_confirmations'
8+
sessions: "spree/user_sessions",
9+
registrations: "spree/user_registrations",
10+
passwords: "spree/user_passwords",
11+
confirmations: "spree/user_confirmations"
1212
},
1313
skip: [:unlocks, :omniauth_callbacks],
14-
path_names: { sign_out: 'logout' },
14+
path_names: {sign_out: "logout"},
1515
path_prefix: :user,
1616
router_name: :spree
1717
})
1818

1919
resources :users, only: [:edit, :update]
2020

2121
devise_scope :spree_user do
22-
get '/login', to: 'user_sessions#new', as: :login
23-
post '/login', to: 'user_sessions#create', as: :create_new_session
24-
match '/logout', to: 'user_sessions#destroy', as: :logout, via: Devise.sign_out_via
25-
get '/signup', to: 'user_registrations#new', as: :signup
26-
post '/signup', to: 'user_registrations#create', as: :registration
27-
get '/password/recover', to: 'user_passwords#new', as: :recover_password
28-
post '/password/recover', to: 'user_passwords#create', as: :reset_password
29-
get '/password/change', to: 'user_passwords#edit', as: :edit_password
30-
put '/password/change', to: 'user_passwords#update', as: :update_password
31-
get '/confirm', to: 'user_confirmations#show', as: :confirmation if Spree::Auth::Config[:confirmable]
22+
get "/login", to: "user_sessions#new", as: :login
23+
post "/login", to: "user_sessions#create", as: :create_new_session
24+
match "/logout", to: "user_sessions#destroy", as: :logout, via: Devise.sign_out_via
25+
get "/signup", to: "user_registrations#new", as: :signup
26+
post "/signup", to: "user_registrations#create", as: :registration
27+
get "/password/recover", to: "user_passwords#new", as: :recover_password
28+
post "/password/recover", to: "user_passwords#create", as: :reset_password
29+
get "/password/change", to: "user_passwords#edit", as: :edit_password
30+
put "/password/change", to: "user_passwords#update", as: :update_password
31+
get "/confirm", to: "user_confirmations#show", as: :confirmation if Spree::Auth::Config[:confirmable]
3232
end
3333

34-
get '/checkout/registration', to: 'checkout#registration', as: :checkout_registration
35-
put '/checkout/registration', to: 'checkout#update_registration', as: :update_checkout_registration
34+
get "/checkout/registration", to: "checkout#registration", as: :checkout_registration
35+
put "/checkout/registration", to: "checkout#update_registration", as: :update_checkout_registration
3636

37-
resource :account, controller: 'users'
37+
resource :account, controller: "users"
3838
end
3939

4040
if SolidusSupport.backend_available? && Spree::Auth::Config.draw_backend_routes
4141
namespace :admin do
4242
devise_for(:spree_user, {
43-
class_name: 'Spree::User',
43+
class_name: "Spree::User",
4444
singular: :spree_user,
4545
skip: :all,
46-
path_names: { sign_out: 'logout' },
46+
path_names: {sign_out: "logout"},
4747
controllers: {
48-
sessions: 'spree/admin/user_sessions',
49-
passwords: 'spree/admin/user_passwords'
48+
sessions: "spree/admin/user_sessions",
49+
passwords: "spree/admin/user_passwords"
5050
},
5151
router_name: :spree
5252
})
5353

5454
devise_scope :spree_user do
55-
get '/authorization_failure', to: 'user_sessions#authorization_failure', as: :unauthorized
56-
get '/login', to: 'user_sessions#new', as: :login
57-
post '/login', to: 'user_sessions#create', as: :create_new_session
58-
match '/logout', to: 'user_sessions#destroy', as: :logout, via: Devise.sign_out_via
55+
get "/authorization_failure", to: "user_sessions#authorization_failure", as: :unauthorized
56+
get "/login", to: "user_sessions#new", as: :login
57+
post "/login", to: "user_sessions#create", as: :create_new_session
58+
match "/logout", to: "user_sessions#destroy", as: :logout, via: Devise.sign_out_via
5959

60-
get '/password/recover', to: 'user_passwords#new', as: :recover_password
61-
post '/password/recover', to: 'user_passwords#create', as: :reset_password
62-
get '/password/change', to: 'user_passwords#edit', as: :edit_password
63-
put '/password/change', to: 'user_passwords#update', as: :update_password
60+
get "/password/recover", to: "user_passwords#new", as: :recover_password
61+
post "/password/recover", to: "user_passwords#create", as: :reset_password
62+
get "/password/change", to: "user_passwords#edit", as: :edit_password
63+
put "/password/change", to: "user_passwords#update", as: :update_password
6464
end
6565
end
6666
end

db/default/users.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# frozen_string_literal: true
22

3-
admin_role = Spree::Role.find_or_create_by(name: 'admin')
3+
admin_role = Spree::Role.find_or_create_by(name: "admin")
44

55
if Spree::User.admin.any?
6-
puts 'No admin user created.'
6+
puts "No admin user created."
77
return
88
end
99

10-
email = ENV['ADMIN_EMAIL'] || 'admin@example.com'
11-
password = ENV['ADMIN_PASSWORD'] || 'test123'
10+
email = ENV["ADMIN_EMAIL"] || "admin@example.com"
11+
password = ENV["ADMIN_PASSWORD"] || "test123"
1212

1313
puts "Creating admin user with:"
1414
puts " - email: #{email}"
@@ -24,7 +24,7 @@
2424
password: password,
2525
password_confirmation: password,
2626
email: email,
27-
login: email,
27+
login: email
2828
)
2929

3030
if admin.save

db/migrate/20101026184949_create_users.rb

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ class CreateUsers < SolidusSupport::Migration[4.2]
44
def up
55
unless table_exists?("spree_users")
66
create_table "spree_users", force: true do |t|
7-
t.string "crypted_password", limit: 128
8-
t.string "salt", limit: 128
9-
t.string "email"
10-
t.string "remember_token"
11-
t.string "remember_token_expires_at"
12-
t.string "persistence_token"
13-
t.string "single_access_token"
14-
t.string "perishable_token"
15-
t.integer "login_count", default: 0, null: false
16-
t.integer "failed_login_count", default: 0, null: false
7+
t.string "crypted_password", limit: 128
8+
t.string "salt", limit: 128
9+
t.string "email"
10+
t.string "remember_token"
11+
t.string "remember_token_expires_at"
12+
t.string "persistence_token"
13+
t.string "single_access_token"
14+
t.string "perishable_token"
15+
t.integer "login_count", default: 0, null: false
16+
t.integer "failed_login_count", default: 0, null: false
1717
t.datetime "last_request_at"
1818
t.datetime "current_login_at"
1919
t.datetime "last_login_at"
20-
t.string "current_login_ip"
21-
t.string "last_login_ip"
22-
t.string "login"
23-
t.integer "ship_address_id"
24-
t.integer "bill_address_id"
25-
t.datetime "created_at", null: false
26-
t.datetime "updated_at", null: false
27-
t.string "openid_identifier"
20+
t.string "current_login_ip"
21+
t.string "last_login_ip"
22+
t.string "login"
23+
t.integer "ship_address_id"
24+
t.integer "bill_address_id"
25+
t.datetime "created_at", null: false
26+
t.datetime "updated_at", null: false
27+
t.string "openid_identifier"
2828
end
2929
end
3030
end

db/migrate/20190125170630_add_reset_password_token_index_to_spree_users.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class AddResetPasswordTokenIndexToSpreeUsers < SolidusSupport::Migration[4.2]
88
# standard name + "_solidus_auth_devise"; the length is 61 chars which is
99
# still OK for Sqlite, mySQL and Postgres.
1010
def custom_index_name
11-
'index_spree_users_on_reset_password_token_solidus_auth_devise'
11+
"index_spree_users_on_reset_password_token_solidus_auth_devise"
1212
end
1313

1414
def default_index_exists?
@@ -21,7 +21,7 @@ def custom_index_exists?
2121

2222
def up
2323
Spree::User.reset_column_information
24-
if Spree::User.column_names.include?('reset_password_token') && !default_index_exists? && !custom_index_exists?
24+
if Spree::User.column_names.include?("reset_password_token") && !default_index_exists? && !custom_index_exists?
2525
add_index :spree_users, :reset_password_token, unique: true, name: custom_index_name
2626
end
2727
end

db/seeds.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# frozen_string_literal: true
22

3-
require_relative 'default/users.rb'
3+
require_relative "default/users"

lib/controllers/backend/spree/admin/user_passwords_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# frozen_string_literal: true
22

33
class Spree::Admin::UserPasswordsController < Devise::PasswordsController
4-
helper 'spree/base'
4+
helper "spree/base"
55

66
include Spree::Core::ControllerHelpers::Auth
77
include Spree::Core::ControllerHelpers::Common
88
include Spree::Core::ControllerHelpers::Store
99

10-
helper 'spree/admin/navigation'
11-
layout 'spree/layouts/admin'
10+
helper "spree/admin/navigation"
11+
layout "spree/layouts/admin"
1212

1313
skip_before_action :require_no_authentication, only: [:create]
1414

0 commit comments

Comments
 (0)