From 9ae2c5961a175039d5d6e25241a9c6eb2ccefcec Mon Sep 17 00:00:00 2001 From: Eduardo Antonio Niehues Date: Thu, 11 Jul 2019 16:54:46 -0300 Subject: [PATCH 1/7] Spree 4.0, 4.1 --- Appraisals | 36 +- Rakefile | 2 +- .../spree/admin/base_controller_decorator.rb | 27 -- .../spree/admin/base_controller_decorator.rb | 36 ++ app/models/spree/ability_decorator.rb | 28 -- app/models/spree/role_decorator.rb | 18 - app/models/spree/user_decorator.rb | 5 - .../spree/ability_decorator.rb | 31 ++ .../spree/role_decorator.rb | 25 + .../spree/user_decorator.rb | 11 + gemfiles/spree_3_7.gemfile.lock | 431 ++++++++++++++++ gemfiles/spree_4_0.gemfile | 8 + gemfiles/spree_4_0.gemfile.lock | 439 +++++++++++++++++ gemfiles/spree_4_1.gemfile | 8 + gemfiles/spree_4_1.gemfile.lock | 447 +++++++++++++++++ gemfiles/spree_master.gemfile.lock | 459 ++++++++++++++++++ lib/spree/permissions.rb | 8 +- lib/spree_admin_roles_and_access/engine.rb | 3 +- spree_admin_roles_and_access.gemspec | 4 +- 19 files changed, 1919 insertions(+), 107 deletions(-) delete mode 100644 app/controllers/spree/admin/base_controller_decorator.rb create mode 100644 app/controllers/spree_admin_roles_and_access/spree/admin/base_controller_decorator.rb delete mode 100644 app/models/spree/ability_decorator.rb delete mode 100644 app/models/spree/role_decorator.rb delete mode 100644 app/models/spree/user_decorator.rb create mode 100644 app/models/spree_admin_roles_and_access/spree/ability_decorator.rb create mode 100644 app/models/spree_admin_roles_and_access/spree/role_decorator.rb create mode 100644 app/models/spree_admin_roles_and_access/spree/user_decorator.rb create mode 100644 gemfiles/spree_3_7.gemfile.lock create mode 100644 gemfiles/spree_4_0.gemfile create mode 100644 gemfiles/spree_4_0.gemfile.lock create mode 100644 gemfiles/spree_4_1.gemfile create mode 100644 gemfiles/spree_4_1.gemfile.lock create mode 100644 gemfiles/spree_master.gemfile.lock diff --git a/Appraisals b/Appraisals index 6859991..5f4fe79 100644 --- a/Appraisals +++ b/Appraisals @@ -1,31 +1,19 @@ -appraise "spree-3-2" do - gem "spree", "~> 3.2.0" - gem "spree_auth_devise", "~> 3.2.0" -end - -appraise "spree-3-3" do - gem "spree", "~> 3.3.0" - gem "spree_auth_devise", "~> 3.3.0" -end - -appraise "spree-3-4" do - gem "spree", '~> 3.4.0' - gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: 'master' -end - -appraise 'spree-3-5' do - gem 'spree', '~> 3.5.0' - gem 'spree_auth_devise', '~> 3.3.0' +appraise 'spree-3-7' do + gem 'spree', '~> 3.7.0' + gem 'spree_backend', '~> 3.7.0' + gem 'spree_auth_devise', '~> 3.5.0' end -appraise 'spree-3-6' do - gem 'spree', '~> 3.6.0' - gem 'spree_auth_devise', '~> 3.3.0' +appraise 'spree-4-0' do + gem 'spree', '~> 4.0.0' + gem 'spree_backend', '~> 4.0.0' + gem 'spree_auth_devise' end -appraise 'spree-3-7' do - gem 'spree', '~> 3.7.0' - gem 'spree_auth_devise', '~> 3.5.0' +appraise 'spree-4-1' do + gem 'spree', '~> 4.1.0' + gem 'spree_backend', '~> 4.1.0' + gem 'spree_auth_devise' end appraise 'spree-master' do diff --git a/Rakefile b/Rakefile index 693e483..5e8baa1 100644 --- a/Rakefile +++ b/Rakefile @@ -11,5 +11,5 @@ task default: [:spec] desc 'Generates a dummy app for testing' task :test_app do ENV['LIB_NAME'] = 'spree_admin_roles_and_access' - Rake::Task['extension:test_app'].invoke + Rake::Task['extension:test_app'].invoke('Spree::User') end diff --git a/app/controllers/spree/admin/base_controller_decorator.rb b/app/controllers/spree/admin/base_controller_decorator.rb deleted file mode 100644 index 990928f..0000000 --- a/app/controllers/spree/admin/base_controller_decorator.rb +++ /dev/null @@ -1,27 +0,0 @@ -Spree::Admin::BaseController.class_eval do - def authorize_admin - begin - if params[:id] - record = model_class.where(PARAM_ATTRIBUTE[controller_name] => params[:id]).first - elsif new_action? - record = model_class.new - else - record = model_class - end - raise if record.blank? - rescue - record = "#{params[:controller]}" - end - authorize! :admin, record - authorize_with_attributes! params[:action].to_sym, record, params[controller_name.singularize] - end - - private - def unauthorized - redirect_unauthorized_access - end - - def new_action? - NEW_ACTIONS.include?(params[:action].to_sym) - end -end diff --git a/app/controllers/spree_admin_roles_and_access/spree/admin/base_controller_decorator.rb b/app/controllers/spree_admin_roles_and_access/spree/admin/base_controller_decorator.rb new file mode 100644 index 0000000..1dc09b6 --- /dev/null +++ b/app/controllers/spree_admin_roles_and_access/spree/admin/base_controller_decorator.rb @@ -0,0 +1,36 @@ +module SpreeAdminRolesAndAccess + module Spree + module Admin + module BaseControllerDecorator + def authorize_admin + begin + if params[:id] + record = model_class.where(PARAM_ATTRIBUTE[controller_name] => params[:id]).first + elsif new_action? + record = model_class.new + else + record = model_class + end + raise if record.blank? + rescue + record = "#{params[:controller]}" + end + authorize! :admin, record + authorize_with_attributes! params[:action].to_sym, record, params[controller_name.singularize] + end + + private + + def unauthorized + redirect_unauthorized_access + end + + def new_action? + NEW_ACTIONS.include?(params[:action].to_sym) + end + end + end + end +end + +::Spree::Admin::BaseController.prepend SpreeAdminRolesAndAccess::Spree::Admin::BaseControllerDecorator diff --git a/app/models/spree/ability_decorator.rb b/app/models/spree/ability_decorator.rb deleted file mode 100644 index 52e9ef7..0000000 --- a/app/models/spree/ability_decorator.rb +++ /dev/null @@ -1,28 +0,0 @@ -module Spree - Ability.class_eval do - - def initialize(user) - self.clear_aliased_actions - - alias_action :edit, to: :update - alias_action :new, to: :create - alias_action :new_action, to: :create - alias_action :show, to: :read - alias_action :index, to: :read - alias_action :delete, to: :destroy - - user ||= Spree.user_class.new - - user_roles(user).map(&:permissions).flatten.uniq.map { |permission| permission.ability(self, user) } - - Ability.abilities.each do |clazz| - ability = clazz.send(:new, user) - @rules = rules + ability.send(:rules) - end - end - - def user_roles(user) - (roles = user.roles.includes(:permissions)).empty? ? Spree::Role.default_role.includes(:permissions) : roles - end - end -end diff --git a/app/models/spree/role_decorator.rb b/app/models/spree/role_decorator.rb deleted file mode 100644 index bb1f04a..0000000 --- a/app/models/spree/role_decorator.rb +++ /dev/null @@ -1,18 +0,0 @@ -Spree::Role.class_eval do - - has_many :roles_permission_sets, dependent: :destroy - has_many :permission_sets, through: :roles_permission_sets - has_many :permissions, through: :permission_sets - - # DEPRECATED: Use permission sets instead. Only here for aiding migration for existing users - has_and_belongs_to_many :legacy_permissions, join_table: 'spree_roles_permissions', class_name: 'Spree::Permission' - - validates :name, uniqueness: true, allow_blank: true - validates :permission_sets, length: { minimum: 1, too_short: :atleast_one_permission_set_is_required }, on: :update - - def has_permission?(permission_title) - permissions.pluck(:title).include?(permission_title) - end - - scope :default_role, lambda { where(is_default: true) } -end diff --git a/app/models/spree/user_decorator.rb b/app/models/spree/user_decorator.rb deleted file mode 100644 index 35b09e7..0000000 --- a/app/models/spree/user_decorator.rb +++ /dev/null @@ -1,5 +0,0 @@ -module Spree - Spree.user_class.class_eval do - alias_attribute :roles, :spree_roles - end -end diff --git a/app/models/spree_admin_roles_and_access/spree/ability_decorator.rb b/app/models/spree_admin_roles_and_access/spree/ability_decorator.rb new file mode 100644 index 0000000..355dc9d --- /dev/null +++ b/app/models/spree_admin_roles_and_access/spree/ability_decorator.rb @@ -0,0 +1,31 @@ +module SpreeAdminRolesAndAccess + module Spree + module AbilityDecorator + def initialize(user) + self.clear_aliased_actions + + alias_action :edit, to: :update + alias_action :new, to: :create + alias_action :new_action, to: :create + alias_action :show, to: :read + alias_action :index, to: :read + alias_action :delete, to: :destroy + + user ||= ::Spree.user_class.new + + user_roles(user).map(&:permissions).flatten.uniq.map { |permission| permission.ability(self, user) } + + ::Spree::Ability.abilities.each do |clazz| + ability = clazz.send(:new, user) + @rules = rules + ability.send(:rules) + end + end + + def user_roles(user) + (roles = user.roles.includes(:permissions)).empty? ? ::Spree::Role.default_role.includes(:permissions) : roles + end + end + end +end + +::Spree::Ability.prepend SpreeAdminRolesAndAccess::Spree::AbilityDecorator diff --git a/app/models/spree_admin_roles_and_access/spree/role_decorator.rb b/app/models/spree_admin_roles_and_access/spree/role_decorator.rb new file mode 100644 index 0000000..9c8a606 --- /dev/null +++ b/app/models/spree_admin_roles_and_access/spree/role_decorator.rb @@ -0,0 +1,25 @@ +module SpreeAdminRolesAndAccess + module Spree + module RoleDecorator + def self.prepended(base) + base.has_many :roles_permission_sets, dependent: :destroy + base.has_many :permission_sets, through: :roles_permission_sets + base.has_many :permissions, through: :permission_sets + + # DEPRECATED: Use permission sets instead. Only here for aiding migration for existing users + base.has_and_belongs_to_many :legacy_permissions, join_table: 'spree_roles_permissions', class_name: 'Spree::Permission' + + base.validates :name, uniqueness: true, allow_blank: true + base.validates :permission_sets, length: { minimum: 1, too_short: :atleast_one_permission_set_is_required }, on: :update + + base.scope :default_role, lambda { where(is_default: true) } + end + + def has_permission?(permission_title) + permissions.pluck(:title).include?(permission_title) + end + end + end +end + +::Spree::Role.prepend SpreeAdminRolesAndAccess::Spree::RoleDecorator diff --git a/app/models/spree_admin_roles_and_access/spree/user_decorator.rb b/app/models/spree_admin_roles_and_access/spree/user_decorator.rb new file mode 100644 index 0000000..a1ad989 --- /dev/null +++ b/app/models/spree_admin_roles_and_access/spree/user_decorator.rb @@ -0,0 +1,11 @@ +module SpreeAdminRolesAndAccess + module Spree + module UserDecorator + def self.prepended(base) + base.alias_attribute :roles, :spree_roles + end + end + end +end + +::Spree::User.prepend SpreeAdminRolesAndAccess::Spree::UserDecorator diff --git a/gemfiles/spree_3_7.gemfile.lock b/gemfiles/spree_3_7.gemfile.lock new file mode 100644 index 0000000..31d6b06 --- /dev/null +++ b/gemfiles/spree_3_7.gemfile.lock @@ -0,0 +1,431 @@ +PATH + remote: .. + specs: + spree_admin_roles_and_access (3.pre.0.pre.stable) + spree_auth_devise + spree_core (>= 3.7.0, < 5.0.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.2.4.2) + actionpack (= 5.2.4.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailer (5.2.4.2) + actionpack (= 5.2.4.2) + actionview (= 5.2.4.2) + activejob (= 5.2.4.2) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.2.4.2) + actionview (= 5.2.4.2) + activesupport (= 5.2.4.2) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.2.4.2) + activesupport (= 5.2.4.2) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.2.4.2) + activesupport (= 5.2.4.2) + globalid (>= 0.3.6) + activemerchant (1.107.1) + activesupport (>= 4.2) + builder (>= 2.1.2, < 4.0.0) + i18n (>= 0.6.9) + nokogiri (~> 1.4) + activemodel (5.2.4.2) + activesupport (= 5.2.4.2) + activerecord (5.2.4.2) + activemodel (= 5.2.4.2) + activesupport (= 5.2.4.2) + arel (>= 9.0) + activestorage (5.2.4.2) + actionpack (= 5.2.4.2) + activerecord (= 5.2.4.2) + marcel (~> 0.3.1) + activesupport (5.2.4.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + acts-as-taggable-on (6.0.0) + activerecord (~> 5.0) + acts_as_list (0.9.19) + activerecord (>= 3.0) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + appraisal (2.2.0) + bundler + rake + thor (>= 0.14.0) + arel (9.0.0) + autoprefixer-rails (9.7.6) + execjs + awesome_nested_set (3.2.0) + activerecord (>= 4.0.0, < 7.0) + bcrypt (3.1.13) + bootstrap-sass (3.4.1) + autoprefixer-rails (>= 5.2.1) + sassc (>= 2.0.0) + builder (3.2.4) + byebug (11.1.1) + camertron-eprun (1.1.1) + cancancan (2.3.0) + canonical-rails (0.2.8) + rails (>= 4.1, < 6.1) + capybara (3.32.1) + addressable + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.5) + xpath (~> 3.2) + carmen (1.0.2) + activesupport (>= 3.0.0) + childprocess (3.0.0) + cldr-plurals-runtime-rb (1.0.1) + climate_control (0.2.0) + cliver (0.3.2) + coderay (1.1.2) + coffee-rails (5.0.0) + coffee-script (>= 2.2.0) + railties (>= 5.2.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.1.6) + crass (1.0.6) + css_parser (1.7.1) + addressable + database_cleaner (1.8.4) + deface (1.5.3) + nokogiri (>= 1.6) + polyglot + rails (>= 4.1) + rainbow (>= 2.1.0) + devise (4.6.2) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0, < 6.0) + responders + warden (~> 1.2.3) + devise-encryptable (0.2.0) + devise (>= 2.1.0) + diff-lcs (1.3) + docile (1.3.2) + doorkeeper (5.3.1) + railties (>= 5) + erubi (1.9.0) + execjs (2.7.0) + factory_girl (4.9.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.9.0) + factory_girl (~> 4.9.0) + railties (>= 3.0.0) + fast_jsonapi (1.5) + activesupport (>= 4.2) + ffaker (2.14.0) + ffi (1.12.2) + friendly_id (5.2.5) + activerecord (>= 4.0.0) + globalid (0.4.2) + activesupport (>= 4.2.0) + highline (2.0.3) + htmlentities (4.3.4) + i18n (1.8.2) + concurrent-ruby (~> 1.0) + jquery-rails (4.3.5) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-ui-rails (6.0.1) + railties (>= 3.2.16) + kaminari (1.0.1) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.0.1) + kaminari-activerecord (= 1.0.1) + kaminari-core (= 1.0.1) + kaminari-actionview (1.0.1) + actionview + kaminari-core (= 1.0.1) + kaminari-activerecord (1.0.1) + activerecord + kaminari-core (= 1.0.1) + kaminari-core (1.0.1) + launchy (2.5.0) + addressable (~> 2.7) + loofah (2.5.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (1.0.0) + mime-types (3.3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2019.1009) + mimemagic (0.3.4) + mini_magick (4.9.5) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.14.0) + monetize (1.9.4) + money (~> 6.12) + money (6.13.7) + i18n (>= 0.6.4, <= 2) + nio4r (2.5.2) + nokogiri (1.10.9) + mini_portile2 (~> 2.4.0) + orm_adapter (0.5.0) + paperclip (6.1.0) + activemodel (>= 4.2.0) + activesupport (>= 4.2.0) + mime-types + mimemagic (~> 0.3.0) + terrapin (~> 0.6.0) + paranoia (2.4.2) + activerecord (>= 4.0, < 6.1) + poltergeist (1.18.1) + capybara (>= 2.1, < 4) + cliver (~> 0.3.1) + websocket-driver (>= 0.2.0) + polyglot (0.3.5) + premailer (1.11.1) + addressable + css_parser (>= 1.6.0) + htmlentities (>= 4.0.0) + premailer-rails (1.11.1) + actionmailer (>= 3) + premailer (~> 1.7, >= 1.7.9) + pry (0.13.1) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (4.0.4) + rabl (0.13.1) + activesupport (>= 2.3.14) + rack (2.2.2) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (5.2.4.2) + actioncable (= 5.2.4.2) + actionmailer (= 5.2.4.2) + actionpack (= 5.2.4.2) + actionview (= 5.2.4.2) + activejob (= 5.2.4.2) + activemodel (= 5.2.4.2) + activerecord (= 5.2.4.2) + activestorage (= 5.2.4.2) + activesupport (= 5.2.4.2) + bundler (>= 1.3.0) + railties (= 5.2.4.2) + sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.4) + actionpack (>= 5.0.1.x) + actionview (>= 5.0.1.x) + activesupport (>= 5.0.1.x) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (5.2.4.2) + actionpack (= 5.2.4.2) + activesupport (= 5.2.4.2) + method_source + rake (>= 0.8.7) + thor (>= 0.19.0, < 2.0) + rainbow (3.0.0) + rake (13.0.1) + ransack (2.1.1) + actionpack (>= 5.0) + activerecord (>= 5.0) + activesupport (>= 5.0) + i18n + regexp_parser (1.7.0) + responders (3.0.0) + actionpack (>= 5.0) + railties (>= 5.0) + rspec-activemodel-mocks (1.1.0) + activemodel (>= 3.0) + activesupport (>= 3.0) + rspec-mocks (>= 2.99, < 4.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-rails (3.5.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + rubyzip (2.3.0) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) + sassc (2.2.1) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + select2-rails (3.5.9.1) + thor (~> 0.14) + selenium-webdriver (3.142.7) + childprocess (>= 0.5, < 4.0) + rubyzip (>= 1.2.2) + shoulda-matchers (3.1.3) + activesupport (>= 4.0.0) + simplecov (0.18.5) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov-html (0.12.2) + spree (3.7.10) + spree_api (= 3.7.10) + spree_backend (= 3.7.10) + spree_cmd (= 3.7.10) + spree_core (= 3.7.10) + spree_frontend (= 3.7.10) + spree_sample (= 3.7.10) + spree_api (3.7.10) + doorkeeper (~> 5.0) + fast_jsonapi (~> 1.5) + rabl (~> 0.13.1) + spree_core (= 3.7.10) + versioncake (~> 3.4.0) + spree_auth_devise (3.5.2) + devise (>= 4.4, < 4.7) + devise-encryptable (= 0.2.0) + spree_core (>= 3.1.0, < 4.0) + spree_extension + spree_backend (3.7.10) + bootstrap-sass (~> 3.4) + jquery-rails (~> 4.3) + jquery-ui-rails (~> 6.0.1) + select2-rails (= 3.5.9.1) + spree_api (= 3.7.10) + spree_core (= 3.7.10) + spree_cmd (3.7.10) + thor (~> 0.14) + spree_core (3.7.10) + activemerchant (~> 1.67) + acts-as-taggable-on (~> 6.0.0) + acts_as_list (~> 0.8) + awesome_nested_set (~> 3.2.0) + cancancan (~> 2.0) + carmen (~> 1.0.0) + deface (~> 1.0) + ffaker (~> 2.9) + friendly_id (~> 5.2.1) + highline (~> 2.0.0) + kaminari (~> 1.0.1) + mini_magick (~> 4.9.4) + monetize (~> 1.9) + money (~> 6.13) + paperclip (~> 6.1.0) + paranoia (~> 2.4.1) + premailer-rails + rails (~> 5.2.4, >= 5.2.4) + ransack (~> 2.1.1) + responders + sprockets (~> 3.7) + sprockets-rails + state_machines-activerecord (~> 0.5) + stringex + twitter_cldr (~> 4.3) + spree_extension (0.0.9) + activerecord (>= 4.2) + spree_core + spree_frontend (3.7.10) + bootstrap-sass (~> 3.4) + canonical-rails (~> 0.2.3) + jquery-rails (~> 4.3) + spree_api (= 3.7.10) + spree_core (= 3.7.10) + spree_sample (3.7.10) + spree_core (= 3.7.10) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + state_machines (0.5.0) + state_machines-activemodel (0.7.1) + activemodel (>= 4.1) + state_machines (>= 0.5.0) + state_machines-activerecord (0.6.0) + activerecord (>= 4.1) + state_machines-activemodel (>= 0.5.0) + stringex (2.8.5) + terrapin (0.6.0) + climate_control (>= 0.0.3, < 1.0) + thor (0.20.3) + thread_safe (0.3.6) + tilt (2.0.10) + twitter_cldr (4.4.5) + camertron-eprun + cldr-plurals-runtime-rb (~> 1.0) + tzinfo + tzinfo (1.2.7) + thread_safe (~> 0.1) + versioncake (3.4.0) + actionpack (>= 3.2) + activesupport (>= 3.2) + railties (>= 3.2) + tzinfo + warden (1.2.8) + rack (>= 2.0.6) + websocket-driver (0.7.1) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.4) + xpath (3.2.0) + nokogiri (~> 1.8) + +PLATFORMS + ruby + +DEPENDENCIES + appraisal + byebug + capybara + coffee-rails + database_cleaner + factory_girl_rails + ffaker + launchy + poltergeist + pry + rails-controller-testing + rspec-activemodel-mocks + rspec-rails (~> 3.5.0) + sass-rails + selenium-webdriver + shoulda-matchers (~> 3.1) + simplecov + spree (~> 3.7.0) + spree_admin_roles_and_access! + spree_auth_devise (~> 3.5.0) + sqlite3 + +BUNDLED WITH + 2.1.4 diff --git a/gemfiles/spree_4_0.gemfile b/gemfiles/spree_4_0.gemfile new file mode 100644 index 0000000..67db5ae --- /dev/null +++ b/gemfiles/spree_4_0.gemfile @@ -0,0 +1,8 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "spree", "~> 4.0.0" +gem "spree_auth_devise" + +gemspec path: "../" diff --git a/gemfiles/spree_4_0.gemfile.lock b/gemfiles/spree_4_0.gemfile.lock new file mode 100644 index 0000000..e131853 --- /dev/null +++ b/gemfiles/spree_4_0.gemfile.lock @@ -0,0 +1,439 @@ +PATH + remote: .. + specs: + spree_admin_roles_and_access (3.pre.0.pre.stable) + spree_auth_devise + spree_core (>= 3.7.0, < 5.0.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.0.2.2) + actionpack (= 6.0.2.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + mail (>= 2.7.1) + actionmailer (6.0.2.2) + actionpack (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.0.2.2) + actionview (= 6.0.2.2) + activesupport (= 6.0.2.2) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.2.2) + actionpack (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + nokogiri (>= 1.8.5) + actionview (6.0.2.2) + activesupport (= 6.0.2.2) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.2.2) + activesupport (= 6.0.2.2) + globalid (>= 0.3.6) + activemerchant (1.107.1) + activesupport (>= 4.2) + builder (>= 2.1.2, < 4.0.0) + i18n (>= 0.6.9) + nokogiri (~> 1.4) + activemodel (6.0.2.2) + activesupport (= 6.0.2.2) + activerecord (6.0.2.2) + activemodel (= 6.0.2.2) + activesupport (= 6.0.2.2) + activestorage (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + marcel (~> 0.3.1) + activesupport (6.0.2.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2) + acts_as_list (0.9.19) + activerecord (>= 3.0) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + appraisal (2.2.0) + bundler + rake + thor (>= 0.14.0) + autoprefixer-rails (9.7.6) + execjs + awesome_nested_set (3.2.0) + activerecord (>= 4.0.0, < 7.0) + bcrypt (3.1.13) + bootstrap (4.3.1) + autoprefixer-rails (>= 9.1.0) + popper_js (>= 1.14.3, < 2) + sassc-rails (>= 2.0.0) + builder (3.2.4) + byebug (11.1.1) + camertron-eprun (1.1.1) + cancancan (3.1.0) + canonical-rails (0.2.8) + rails (>= 4.1, < 6.1) + capybara (3.32.1) + addressable + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.5) + xpath (~> 3.2) + carmen (1.1.3) + activesupport (>= 3.0.0) + childprocess (3.0.0) + cldr-plurals-runtime-rb (1.0.1) + cliver (0.3.2) + coderay (1.1.2) + coffee-rails (5.0.0) + coffee-script (>= 2.2.0) + railties (>= 5.2.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.1.6) + crass (1.0.6) + css_parser (1.7.1) + addressable + database_cleaner (1.8.4) + deface (1.5.3) + nokogiri (>= 1.6) + polyglot + rails (>= 4.1) + rainbow (>= 2.1.0) + devise (4.7.1) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0) + responders + warden (~> 1.2.3) + devise-encryptable (0.2.0) + devise (>= 2.1.0) + diff-lcs (1.3) + docile (1.3.2) + doorkeeper (5.3.1) + railties (>= 5) + erubi (1.9.0) + execjs (2.7.0) + factory_girl (4.9.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.9.0) + factory_girl (~> 4.9.0) + railties (>= 3.0.0) + fast_jsonapi (1.5) + activesupport (>= 4.2) + ffaker (2.14.0) + ffi (1.12.2) + friendly_id (5.3.0) + activerecord (>= 4.0.0) + globalid (0.4.2) + activesupport (>= 4.2.0) + glyphicons (1.0.2) + highline (2.0.3) + htmlentities (4.3.4) + i18n (1.8.2) + concurrent-ruby (~> 1.0) + image_processing (1.10.3) + mini_magick (>= 4.9.5, < 5) + ruby-vips (>= 2.0.17, < 3) + jquery-rails (4.3.5) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-ui-rails (6.0.1) + railties (>= 3.2.16) + kaminari (1.1.1) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.1.1) + kaminari-activerecord (= 1.1.1) + kaminari-core (= 1.1.1) + kaminari-actionview (1.1.1) + actionview + kaminari-core (= 1.1.1) + kaminari-activerecord (1.1.1) + activerecord + kaminari-core (= 1.1.1) + kaminari-core (1.1.1) + launchy (2.5.0) + addressable (~> 2.7) + loofah (2.5.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (1.0.0) + mimemagic (0.3.4) + mini_magick (4.9.5) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.14.0) + monetize (1.9.4) + money (~> 6.12) + money (6.13.7) + i18n (>= 0.6.4, <= 2) + nio4r (2.5.2) + nokogiri (1.10.9) + mini_portile2 (~> 2.4.0) + orm_adapter (0.5.0) + paranoia (2.4.2) + activerecord (>= 4.0, < 6.1) + poltergeist (1.18.1) + capybara (>= 2.1, < 4) + cliver (~> 0.3.1) + websocket-driver (>= 0.2.0) + polyamorous (2.3.2) + activerecord (>= 5.2.1) + polyglot (0.3.5) + popper_js (1.16.0) + premailer (1.11.1) + addressable + css_parser (>= 1.6.0) + htmlentities (>= 4.0.0) + premailer-rails (1.11.1) + actionmailer (>= 3) + premailer (~> 1.7, >= 1.7.9) + pry (0.13.1) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (4.0.4) + rabl (0.14.2) + activesupport (>= 2.3.14) + rack (2.2.2) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (6.0.2.2) + actioncable (= 6.0.2.2) + actionmailbox (= 6.0.2.2) + actionmailer (= 6.0.2.2) + actionpack (= 6.0.2.2) + actiontext (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + activemodel (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + bundler (>= 1.3.0) + railties (= 6.0.2.2) + sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.4) + actionpack (>= 5.0.1.x) + actionview (>= 5.0.1.x) + activesupport (>= 5.0.1.x) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (6.0.2.2) + actionpack (= 6.0.2.2) + activesupport (= 6.0.2.2) + method_source + rake (>= 0.8.7) + thor (>= 0.20.3, < 2.0) + rainbow (3.0.0) + rake (13.0.1) + ransack (2.3.2) + activerecord (>= 5.2.1) + activesupport (>= 5.2.1) + i18n + polyamorous (= 2.3.2) + regexp_parser (1.7.0) + responders (3.0.0) + actionpack (>= 5.0) + railties (>= 5.0) + rspec-activemodel-mocks (1.1.0) + activemodel (>= 3.0) + activesupport (>= 3.0) + rspec-mocks (>= 2.99, < 4.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-rails (3.5.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + ruby-vips (2.0.17) + ffi (~> 1.9) + rubyzip (2.3.0) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) + sassc (2.2.1) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + select2-rails (3.5.9.1) + thor (~> 0.14) + selenium-webdriver (3.142.7) + childprocess (>= 0.5, < 4.0) + rubyzip (>= 1.2.2) + shoulda-matchers (3.1.3) + activesupport (>= 4.0.0) + simplecov (0.18.5) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov-html (0.12.2) + spree (4.0.3) + spree_api (= 4.0.3) + spree_backend (= 4.0.3) + spree_cmd (= 4.0.3) + spree_core (= 4.0.3) + spree_frontend (= 4.0.3) + spree_sample (= 4.0.3) + spree_api (4.0.3) + doorkeeper (~> 5.2, >= 5.2.1) + fast_jsonapi (~> 1.5) + rabl (~> 0.14.2) + spree_core (= 4.0.3) + spree_auth_devise (4.0.0) + deface (~> 1.0) + devise (~> 4.7) + devise-encryptable (= 0.2.0) + spree_core (>= 3.1.0, < 5.0) + spree_extension + spree_backend (4.0.3) + bootstrap (~> 4.3.1) + glyphicons (~> 1.0.2) + jquery-rails (~> 4.3) + jquery-ui-rails (~> 6.0.1) + select2-rails (= 3.5.9.1) + spree_api (= 4.0.3) + spree_core (= 4.0.3) + spree_cmd (4.0.3) + thor (~> 0.14) + spree_core (4.0.3) + activemerchant (~> 1.67) + acts_as_list (~> 0.8) + awesome_nested_set (>= 3.1.4, < 3.3.0) + cancancan (~> 3.0) + carmen (>= 1.0, < 1.2) + ffaker (~> 2.9) + friendly_id (>= 5.2.1, < 5.4.0) + highline (~> 2.0.0) + image_processing (~> 1.2) + kaminari (>= 1.0.1, < 1.2.0) + mini_magick (~> 4.9.4) + monetize (~> 1.9) + money (~> 6.13) + paranoia (~> 2.4.2) + premailer-rails + rails (~> 6.0.0) + ransack (~> 2.3.0) + responders + sprockets (~> 3.7) + sprockets-rails + state_machines-activemodel (~> 0.7) + state_machines-activerecord (~> 0.6) + stringex + twitter_cldr (~> 4.3) + spree_extension (0.0.9) + activerecord (>= 4.2) + spree_core + spree_frontend (4.0.3) + bootstrap (~> 4.3.1) + canonical-rails (~> 0.2.5) + glyphicons (~> 1.0.2) + jquery-rails (~> 4.3) + spree_api (= 4.0.3) + spree_core (= 4.0.3) + spree_sample (4.0.3) + spree_core (= 4.0.3) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + state_machines (0.5.0) + state_machines-activemodel (0.7.1) + activemodel (>= 4.1) + state_machines (>= 0.5.0) + state_machines-activerecord (0.6.0) + activerecord (>= 4.1) + state_machines-activemodel (>= 0.5.0) + stringex (2.8.5) + thor (0.20.3) + thread_safe (0.3.6) + tilt (2.0.10) + twitter_cldr (4.4.5) + camertron-eprun + cldr-plurals-runtime-rb (~> 1.0) + tzinfo + tzinfo (1.2.7) + thread_safe (~> 0.1) + warden (1.2.8) + rack (>= 2.0.6) + websocket-driver (0.7.1) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.4) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.3.0) + +PLATFORMS + ruby + +DEPENDENCIES + appraisal + byebug + capybara + coffee-rails + database_cleaner + factory_girl_rails + ffaker + launchy + poltergeist + pry + rails-controller-testing + rspec-activemodel-mocks + rspec-rails (~> 3.5.0) + sass-rails + selenium-webdriver + shoulda-matchers (~> 3.1) + simplecov + spree (~> 4.0.0) + spree_admin_roles_and_access! + spree_auth_devise + sqlite3 + +BUNDLED WITH + 2.1.4 diff --git a/gemfiles/spree_4_1.gemfile b/gemfiles/spree_4_1.gemfile new file mode 100644 index 0000000..a1da1cf --- /dev/null +++ b/gemfiles/spree_4_1.gemfile @@ -0,0 +1,8 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "spree", "~> 4.1.0" +gem "spree_auth_devise" + +gemspec path: "../" diff --git a/gemfiles/spree_4_1.gemfile.lock b/gemfiles/spree_4_1.gemfile.lock new file mode 100644 index 0000000..c05c00c --- /dev/null +++ b/gemfiles/spree_4_1.gemfile.lock @@ -0,0 +1,447 @@ +PATH + remote: .. + specs: + spree_admin_roles_and_access (3.pre.0.pre.stable) + spree_auth_devise + spree_core (>= 3.7.0, < 5.0.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.0.2.2) + actionpack (= 6.0.2.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + mail (>= 2.7.1) + actionmailer (6.0.2.2) + actionpack (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.0.2.2) + actionview (= 6.0.2.2) + activesupport (= 6.0.2.2) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.2.2) + actionpack (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + nokogiri (>= 1.8.5) + actionview (6.0.2.2) + activesupport (= 6.0.2.2) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.2.2) + activesupport (= 6.0.2.2) + globalid (>= 0.3.6) + activemerchant (1.107.1) + activesupport (>= 4.2) + builder (>= 2.1.2, < 4.0.0) + i18n (>= 0.6.9) + nokogiri (~> 1.4) + activemodel (6.0.2.2) + activesupport (= 6.0.2.2) + activerecord (6.0.2.2) + activemodel (= 6.0.2.2) + activesupport (= 6.0.2.2) + activestorage (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + marcel (~> 0.3.1) + activesupport (6.0.2.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2) + acts_as_list (0.9.19) + activerecord (>= 3.0) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + appraisal (2.2.0) + bundler + rake + thor (>= 0.14.0) + autoprefixer-rails (9.7.6) + execjs + awesome_nested_set (3.2.0) + activerecord (>= 4.0.0, < 7.0) + bcrypt (3.1.13) + bootstrap (4.3.1) + autoprefixer-rails (>= 9.1.0) + popper_js (>= 1.14.3, < 2) + sassc-rails (>= 2.0.0) + builder (3.2.4) + byebug (11.1.1) + camertron-eprun (1.1.1) + cancancan (3.1.0) + canonical-rails (0.2.8) + rails (>= 4.1, < 6.1) + capybara (3.32.1) + addressable + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.5) + xpath (~> 3.2) + carmen (1.1.3) + activesupport (>= 3.0.0) + childprocess (3.0.0) + cldr-plurals-runtime-rb (1.0.1) + cliver (0.3.2) + coderay (1.1.2) + coffee-rails (5.0.0) + coffee-script (>= 2.2.0) + railties (>= 5.2.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.1.6) + crass (1.0.6) + css_parser (1.7.1) + addressable + database_cleaner (1.8.4) + deface (1.5.3) + nokogiri (>= 1.6) + polyglot + rails (>= 4.1) + rainbow (>= 2.1.0) + devise (4.7.1) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0) + responders + warden (~> 1.2.3) + devise-encryptable (0.2.0) + devise (>= 2.1.0) + diff-lcs (1.3) + docile (1.3.2) + doorkeeper (5.3.1) + railties (>= 5) + erubi (1.9.0) + execjs (2.7.0) + factory_girl (4.9.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.9.0) + factory_girl (~> 4.9.0) + railties (>= 3.0.0) + fast_jsonapi (1.5) + activesupport (>= 4.2) + ffaker (2.14.0) + ffi (1.12.2) + friendly_id (5.3.0) + activerecord (>= 4.0.0) + globalid (0.4.2) + activesupport (>= 4.2.0) + glyphicons (1.0.2) + highline (2.0.3) + htmlentities (4.3.4) + i18n (1.8.2) + concurrent-ruby (~> 1.0) + image_processing (1.10.3) + mini_magick (>= 4.9.5, < 5) + ruby-vips (>= 2.0.17, < 3) + inline_svg (1.7.1) + activesupport (>= 3.0) + nokogiri (>= 1.6) + jquery-rails (4.3.5) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-ui-rails (6.0.1) + railties (>= 3.2.16) + kaminari (1.1.1) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.1.1) + kaminari-activerecord (= 1.1.1) + kaminari-core (= 1.1.1) + kaminari-actionview (1.1.1) + actionview + kaminari-core (= 1.1.1) + kaminari-activerecord (1.1.1) + activerecord + kaminari-core (= 1.1.1) + kaminari-core (1.1.1) + launchy (2.5.0) + addressable (~> 2.7) + loofah (2.5.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (1.0.0) + mimemagic (0.3.4) + mini_magick (4.10.1) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.14.0) + monetize (1.9.4) + money (~> 6.12) + money (6.13.7) + i18n (>= 0.6.4, <= 2) + nio4r (2.5.2) + nokogiri (1.10.9) + mini_portile2 (~> 2.4.0) + orm_adapter (0.5.0) + paranoia (2.4.2) + activerecord (>= 4.0, < 6.1) + poltergeist (1.18.1) + capybara (>= 2.1, < 4) + cliver (~> 0.3.1) + websocket-driver (>= 0.2.0) + polyamorous (2.3.2) + activerecord (>= 5.2.1) + polyglot (0.3.5) + popper_js (1.16.0) + premailer (1.11.1) + addressable + css_parser (>= 1.6.0) + htmlentities (>= 4.0.0) + premailer-rails (1.11.1) + actionmailer (>= 3) + premailer (~> 1.7, >= 1.7.9) + pry (0.13.1) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (4.0.4) + rabl (0.14.2) + activesupport (>= 2.3.14) + rack (2.2.2) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (6.0.2.2) + actioncable (= 6.0.2.2) + actionmailbox (= 6.0.2.2) + actionmailer (= 6.0.2.2) + actionpack (= 6.0.2.2) + actiontext (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + activemodel (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + bundler (>= 1.3.0) + railties (= 6.0.2.2) + sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.4) + actionpack (>= 5.0.1.x) + actionview (>= 5.0.1.x) + activesupport (>= 5.0.1.x) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (6.0.2.2) + actionpack (= 6.0.2.2) + activesupport (= 6.0.2.2) + method_source + rake (>= 0.8.7) + thor (>= 0.20.3, < 2.0) + rainbow (3.0.0) + rake (13.0.1) + ransack (2.3.2) + activerecord (>= 5.2.1) + activesupport (>= 5.2.1) + i18n + polyamorous (= 2.3.2) + regexp_parser (1.7.0) + responders (3.0.0) + actionpack (>= 5.0) + railties (>= 5.0) + rspec-activemodel-mocks (1.1.0) + activemodel (>= 3.0) + activesupport (>= 3.0) + rspec-mocks (>= 2.99, < 4.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-rails (3.5.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + ruby-vips (2.0.17) + ffi (~> 1.9) + rubyzip (2.3.0) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) + sassc (2.2.1) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + select2-rails (3.5.10) + thor (~> 0.14) + selenium-webdriver (3.142.7) + childprocess (>= 0.5, < 4.0) + rubyzip (>= 1.2.2) + shoulda-matchers (3.1.3) + activesupport (>= 4.0.0) + simplecov (0.18.5) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov-html (0.12.2) + spree (4.1.5) + spree_api (= 4.1.5) + spree_backend (= 4.1.5) + spree_cmd (= 4.1.5) + spree_core (= 4.1.5) + spree_frontend (= 4.1.5) + spree_sample (= 4.1.5) + spree_api (4.1.5) + doorkeeper (~> 5.2, >= 5.2.1) + fast_jsonapi (~> 1.5) + rabl (~> 0.14.2) + spree_core (= 4.1.5) + spree_auth_devise (4.1.0) + deface (~> 1.0) + devise (~> 4.7) + devise-encryptable (= 0.2.0) + spree_core (>= 4.1.0.alpha, < 5.0) + spree_extension + spree_backend (4.1.5) + bootstrap (~> 4.3.1) + glyphicons (~> 1.0.2) + jquery-rails (~> 4.3) + jquery-ui-rails (~> 6.0.1) + select2-rails (~> 3.5.0) + spree_api (= 4.1.5) + spree_core (= 4.1.5) + spree_cmd (4.1.5) + thor (>= 0.14, < 2.0) + spree_core (4.1.5) + activemerchant (~> 1.67) + acts_as_list (~> 0.8) + awesome_nested_set (>= 3.1.4, < 3.3.0) + cancancan (~> 3.0) + carmen (>= 1.0, < 1.2) + ffaker (~> 2.9) + friendly_id (>= 5.2.1, < 5.4.0) + highline (~> 2.0.0) + image_processing (~> 1.2) + kaminari (>= 1.0.1, < 1.2.0) + mini_magick (>= 4.9.4, < 4.11.0) + monetize (~> 1.9) + money (~> 6.13) + paranoia (~> 2.4.2) + premailer-rails + rails (~> 6.0.0) + ransack (~> 2.3.0) + responders + sprockets (~> 3.7) + sprockets-rails + state_machines-activemodel (~> 0.7) + state_machines-activerecord (~> 0.6) + stringex + twitter_cldr (>= 4.3, < 6.0) + spree_extension (0.0.9) + activerecord (>= 4.2) + spree_core + spree_frontend (4.1.5) + bootstrap (~> 4.3.1) + canonical-rails (~> 0.2.5) + glyphicons (~> 1.0.2) + inline_svg (~> 1.5) + jquery-rails (~> 4.3) + spree_api (= 4.1.5) + spree_core (= 4.1.5) + turbolinks (~> 5.2.0) + spree_sample (4.1.5) + spree_core (= 4.1.5) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + state_machines (0.5.0) + state_machines-activemodel (0.7.1) + activemodel (>= 4.1) + state_machines (>= 0.5.0) + state_machines-activerecord (0.6.0) + activerecord (>= 4.1) + state_machines-activemodel (>= 0.5.0) + stringex (2.8.5) + thor (0.20.3) + thread_safe (0.3.6) + tilt (2.0.10) + turbolinks (5.2.1) + turbolinks-source (~> 5.2) + turbolinks-source (5.2.0) + twitter_cldr (5.4.0) + camertron-eprun + cldr-plurals-runtime-rb (~> 1.0) + tzinfo + tzinfo (1.2.7) + thread_safe (~> 0.1) + warden (1.2.8) + rack (>= 2.0.6) + websocket-driver (0.7.1) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.4) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.3.0) + +PLATFORMS + ruby + +DEPENDENCIES + appraisal + byebug + capybara + coffee-rails + database_cleaner + factory_girl_rails + ffaker + launchy + poltergeist + pry + rails-controller-testing + rspec-activemodel-mocks + rspec-rails (~> 3.5.0) + sass-rails + selenium-webdriver + shoulda-matchers (~> 3.1) + simplecov + spree (~> 4.1.0) + spree_admin_roles_and_access! + spree_auth_devise + sqlite3 + +BUNDLED WITH + 2.1.4 diff --git a/gemfiles/spree_master.gemfile.lock b/gemfiles/spree_master.gemfile.lock new file mode 100644 index 0000000..bd85c0b --- /dev/null +++ b/gemfiles/spree_master.gemfile.lock @@ -0,0 +1,459 @@ +GIT + remote: https://github.com/spree/spree.git + revision: 82c64b2f3e6a350938fd590c5fecc8d38c5c1c6a + branch: master + specs: + spree (4.2.0.alpha) + spree_api (= 4.2.0.alpha) + spree_backend (= 4.2.0.alpha) + spree_cmd (= 4.2.0.alpha) + spree_core (= 4.2.0.alpha) + spree_frontend (= 4.2.0.alpha) + spree_sample (= 4.2.0.alpha) + spree_api (4.2.0.alpha) + doorkeeper (~> 5.2, >= 5.2.1) + fast_jsonapi (~> 1.5) + rabl (~> 0.14.2) + spree_core (= 4.2.0.alpha) + spree_backend (4.2.0.alpha) + bootstrap (~> 4.3.1) + glyphicons (~> 1.0.2) + jquery-rails (~> 4.3) + jquery-ui-rails (~> 6.0.1) + select2-rails (~> 3.5.0) + spree_api (= 4.2.0.alpha) + spree_core (= 4.2.0.alpha) + spree_cmd (4.2.0.alpha) + thor (>= 0.14, < 2.0) + spree_core (4.2.0.alpha) + activemerchant (~> 1.67) + acts_as_list (~> 0.8) + awesome_nested_set (>= 3.1.4, < 3.3.0) + cancancan (~> 3.0) + carmen (>= 1.0, < 1.2) + ffaker (~> 2.9) + friendly_id (>= 5.2.1, < 5.4.0) + highline (~> 2.0.0) + image_processing (~> 1.2) + kaminari (>= 1.0.1, < 1.2.0) + mini_magick (>= 4.9.4, < 4.11.0) + monetize (~> 1.9) + money (~> 6.13) + paranoia (~> 2.4.2) + premailer-rails + rails (~> 6.0.0) + ransack (~> 2.3.0) + responders + sprockets (~> 3.7) + sprockets-rails + state_machines-activemodel (~> 0.7) + state_machines-activerecord (~> 0.6) + stringex + twitter_cldr (>= 4.3, < 6.0) + spree_frontend (4.2.0.alpha) + bootstrap (~> 4.3.1) + canonical-rails (~> 0.2.5) + glyphicons (~> 1.0.2) + inline_svg (~> 1.5) + jquery-rails (~> 4.3) + spree_api (= 4.2.0.alpha) + spree_core (= 4.2.0.alpha) + turbolinks (~> 5.2.0) + spree_sample (4.2.0.alpha) + spree_core (= 4.2.0.alpha) + +GIT + remote: https://github.com/spree/spree_auth_devise.git + revision: 348192110bee0b18a317322a5ebf94f7726a545b + branch: master + specs: + spree_auth_devise (4.1.0) + deface (~> 1.0) + devise (~> 4.7) + devise-encryptable (= 0.2.0) + spree_core (>= 4.1.0.alpha, < 5.0) + spree_extension + +PATH + remote: .. + specs: + spree_admin_roles_and_access (3.pre.0.pre.stable) + spree_auth_devise + spree_core (>= 3.7.0, < 5.0.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.0.2.2) + actionpack (= 6.0.2.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + mail (>= 2.7.1) + actionmailer (6.0.2.2) + actionpack (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.0.2.2) + actionview (= 6.0.2.2) + activesupport (= 6.0.2.2) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.2.2) + actionpack (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + nokogiri (>= 1.8.5) + actionview (6.0.2.2) + activesupport (= 6.0.2.2) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.2.2) + activesupport (= 6.0.2.2) + globalid (>= 0.3.6) + activemerchant (1.107.1) + activesupport (>= 4.2) + builder (>= 2.1.2, < 4.0.0) + i18n (>= 0.6.9) + nokogiri (~> 1.4) + activemodel (6.0.2.2) + activesupport (= 6.0.2.2) + activerecord (6.0.2.2) + activemodel (= 6.0.2.2) + activesupport (= 6.0.2.2) + activestorage (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + marcel (~> 0.3.1) + activesupport (6.0.2.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2) + acts_as_list (0.9.19) + activerecord (>= 3.0) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + appraisal (2.2.0) + bundler + rake + thor (>= 0.14.0) + autoprefixer-rails (9.7.6) + execjs + awesome_nested_set (3.2.0) + activerecord (>= 4.0.0, < 7.0) + bcrypt (3.1.13) + bootstrap (4.3.1) + autoprefixer-rails (>= 9.1.0) + popper_js (>= 1.14.3, < 2) + sassc-rails (>= 2.0.0) + builder (3.2.4) + byebug (11.1.1) + camertron-eprun (1.1.1) + cancancan (3.1.0) + canonical-rails (0.2.8) + rails (>= 4.1, < 6.1) + capybara (3.32.1) + addressable + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.5) + xpath (~> 3.2) + carmen (1.1.3) + activesupport (>= 3.0.0) + childprocess (3.0.0) + cldr-plurals-runtime-rb (1.0.1) + cliver (0.3.2) + coderay (1.1.2) + coffee-rails (5.0.0) + coffee-script (>= 2.2.0) + railties (>= 5.2.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.1.6) + crass (1.0.6) + css_parser (1.7.1) + addressable + database_cleaner (1.8.4) + deface (1.5.3) + nokogiri (>= 1.6) + polyglot + rails (>= 4.1) + rainbow (>= 2.1.0) + devise (4.7.1) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0) + responders + warden (~> 1.2.3) + devise-encryptable (0.2.0) + devise (>= 2.1.0) + diff-lcs (1.3) + docile (1.3.2) + doorkeeper (5.3.1) + railties (>= 5) + erubi (1.9.0) + execjs (2.7.0) + factory_girl (4.9.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.9.0) + factory_girl (~> 4.9.0) + railties (>= 3.0.0) + fast_jsonapi (1.5) + activesupport (>= 4.2) + ffaker (2.14.0) + ffi (1.12.2) + friendly_id (5.3.0) + activerecord (>= 4.0.0) + globalid (0.4.2) + activesupport (>= 4.2.0) + glyphicons (1.0.2) + highline (2.0.3) + htmlentities (4.3.4) + i18n (1.8.2) + concurrent-ruby (~> 1.0) + image_processing (1.10.3) + mini_magick (>= 4.9.5, < 5) + ruby-vips (>= 2.0.17, < 3) + inline_svg (1.7.1) + activesupport (>= 3.0) + nokogiri (>= 1.6) + jquery-rails (4.3.5) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-ui-rails (6.0.1) + railties (>= 3.2.16) + kaminari (1.1.1) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.1.1) + kaminari-activerecord (= 1.1.1) + kaminari-core (= 1.1.1) + kaminari-actionview (1.1.1) + actionview + kaminari-core (= 1.1.1) + kaminari-activerecord (1.1.1) + activerecord + kaminari-core (= 1.1.1) + kaminari-core (1.1.1) + launchy (2.5.0) + addressable (~> 2.7) + loofah (2.5.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (1.0.0) + mimemagic (0.3.4) + mini_magick (4.10.1) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.14.0) + monetize (1.9.4) + money (~> 6.12) + money (6.13.7) + i18n (>= 0.6.4, <= 2) + nio4r (2.5.2) + nokogiri (1.10.9) + mini_portile2 (~> 2.4.0) + orm_adapter (0.5.0) + paranoia (2.4.2) + activerecord (>= 4.0, < 6.1) + poltergeist (1.18.1) + capybara (>= 2.1, < 4) + cliver (~> 0.3.1) + websocket-driver (>= 0.2.0) + polyamorous (2.3.2) + activerecord (>= 5.2.1) + polyglot (0.3.5) + popper_js (1.16.0) + premailer (1.11.1) + addressable + css_parser (>= 1.6.0) + htmlentities (>= 4.0.0) + premailer-rails (1.11.1) + actionmailer (>= 3) + premailer (~> 1.7, >= 1.7.9) + pry (0.13.1) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (4.0.4) + rabl (0.14.2) + activesupport (>= 2.3.14) + rack (2.2.2) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (6.0.2.2) + actioncable (= 6.0.2.2) + actionmailbox (= 6.0.2.2) + actionmailer (= 6.0.2.2) + actionpack (= 6.0.2.2) + actiontext (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + activemodel (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + bundler (>= 1.3.0) + railties (= 6.0.2.2) + sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.4) + actionpack (>= 5.0.1.x) + actionview (>= 5.0.1.x) + activesupport (>= 5.0.1.x) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (6.0.2.2) + actionpack (= 6.0.2.2) + activesupport (= 6.0.2.2) + method_source + rake (>= 0.8.7) + thor (>= 0.20.3, < 2.0) + rainbow (3.0.0) + rake (13.0.1) + ransack (2.3.2) + activerecord (>= 5.2.1) + activesupport (>= 5.2.1) + i18n + polyamorous (= 2.3.2) + regexp_parser (1.7.0) + responders (3.0.0) + actionpack (>= 5.0) + railties (>= 5.0) + rspec-activemodel-mocks (1.1.0) + activemodel (>= 3.0) + activesupport (>= 3.0) + rspec-mocks (>= 2.99, < 4.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-rails (3.5.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + ruby-vips (2.0.17) + ffi (~> 1.9) + rubyzip (2.3.0) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) + sassc (2.2.1) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + select2-rails (3.5.10) + thor (~> 0.14) + selenium-webdriver (3.142.7) + childprocess (>= 0.5, < 4.0) + rubyzip (>= 1.2.2) + shoulda-matchers (3.1.3) + activesupport (>= 4.0.0) + simplecov (0.18.5) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov-html (0.12.2) + spree_extension (0.0.9) + activerecord (>= 4.2) + spree_core + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + state_machines (0.5.0) + state_machines-activemodel (0.7.1) + activemodel (>= 4.1) + state_machines (>= 0.5.0) + state_machines-activerecord (0.6.0) + activerecord (>= 4.1) + state_machines-activemodel (>= 0.5.0) + stringex (2.8.5) + thor (0.20.3) + thread_safe (0.3.6) + tilt (2.0.10) + turbolinks (5.2.1) + turbolinks-source (~> 5.2) + turbolinks-source (5.2.0) + twitter_cldr (5.4.0) + camertron-eprun + cldr-plurals-runtime-rb (~> 1.0) + tzinfo + tzinfo (1.2.7) + thread_safe (~> 0.1) + warden (1.2.8) + rack (>= 2.0.6) + websocket-driver (0.7.1) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.4) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.3.0) + +PLATFORMS + ruby + +DEPENDENCIES + appraisal + byebug + capybara + coffee-rails + database_cleaner + factory_girl_rails + ffaker + launchy + poltergeist + pry + rails-controller-testing + rspec-activemodel-mocks + rspec-rails (~> 3.5.0) + sass-rails + selenium-webdriver + shoulda-matchers (~> 3.1) + simplecov + spree! + spree_admin_roles_and_access! + spree_auth_devise! + sqlite3 + +BUNDLED WITH + 2.1.4 diff --git a/lib/spree/permissions.rb b/lib/spree/permissions.rb index f214d75..c13fdac 100644 --- a/lib/spree/permissions.rb +++ b/lib/spree/permissions.rb @@ -25,11 +25,11 @@ def method_missing(name, *args, &block) current_ability.can :create, Spree::Order current_ability.can :read, Spree::Order, [] do |order, token| - order.user == user || (order.guest_token && token == order.guest_token) + order.user == user || (order_token(order) && token == order_token(order)) end current_ability.can :update, Spree::Order do |order, token| - !order.completed? && (order.user == user || order.guest_token && token == order.guest_token) + !order.completed? && (order.user == user || order_token(order) && token == order_token(order)) end current_ability.can :read, Spree::Address do |address| @@ -75,5 +75,9 @@ def find_action_and_subject(name) return can.to_sym, action.to_sym, subject, attribute.try(:to_sym) end end + + def order_token(order) + order.respond_to?(:token) ? order.token : order.guest_token + end end end diff --git a/lib/spree_admin_roles_and_access/engine.rb b/lib/spree_admin_roles_and_access/engine.rb index 8bb91d0..bf32408 100644 --- a/lib/spree_admin_roles_and_access/engine.rb +++ b/lib/spree_admin_roles_and_access/engine.rb @@ -2,9 +2,10 @@ module SpreeAdminRolesAndAccess class Engine < Rails::Engine require 'spree/core' isolate_namespace Spree + isolate_namespace SpreeAdminRolesAndAccess engine_name 'spree_admin_roles_and_access' - config.autoload_paths += %W(#{config.root}/lib) + config.autoload_paths += %W(#{config.root}/lib #{config.root}/app) # use rspec for tests config.generators do |g| diff --git a/spree_admin_roles_and_access.gemspec b/spree_admin_roles_and_access.gemspec index 3cc1032..38f8a0c 100644 --- a/spree_admin_roles_and_access.gemspec +++ b/spree_admin_roles_and_access.gemspec @@ -14,11 +14,13 @@ Gem::Specification.new do |s| s.require_path = 'lib' s.requirements << 'none' - spree_version = '>= 3.2.0', '< 4.0.0' + spree_version = '>= 3.7.0', '< 5.0.0' s.add_dependency 'spree_core', spree_version s.add_dependency 'spree_auth_devise' + s.add_development_dependency 'spree', spree_version + s.add_development_dependency 'spree_auth_devise' s.add_development_dependency 'capybara' s.add_development_dependency 'ffaker' s.add_development_dependency 'rspec-rails', '~> 3.5.0' From 128fe9a9e29b992f137adeaa3b3033260e8b20c2 Mon Sep 17 00:00:00 2001 From: brunoqcx Date: Tue, 21 Sep 2021 14:19:21 -0300 Subject: [PATCH 2/7] fix: changes scope name due to active record class method conflict --- .../spree_admin_roles_and_access/spree/ability_decorator.rb | 2 +- .../spree_admin_roles_and_access/spree/role_decorator.rb | 2 +- spec/models/spree/role_decorator_spec.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/spree_admin_roles_and_access/spree/ability_decorator.rb b/app/models/spree_admin_roles_and_access/spree/ability_decorator.rb index 355dc9d..fc79f3a 100644 --- a/app/models/spree_admin_roles_and_access/spree/ability_decorator.rb +++ b/app/models/spree_admin_roles_and_access/spree/ability_decorator.rb @@ -22,7 +22,7 @@ def initialize(user) end def user_roles(user) - (roles = user.roles.includes(:permissions)).empty? ? ::Spree::Role.default_role.includes(:permissions) : roles + (roles = user.roles.includes(:permissions)).empty? ? ::Spree::Role.spree_default_role.includes(:permissions) : roles end end end diff --git a/app/models/spree_admin_roles_and_access/spree/role_decorator.rb b/app/models/spree_admin_roles_and_access/spree/role_decorator.rb index 9c8a606..4fbb111 100644 --- a/app/models/spree_admin_roles_and_access/spree/role_decorator.rb +++ b/app/models/spree_admin_roles_and_access/spree/role_decorator.rb @@ -12,7 +12,7 @@ def self.prepended(base) base.validates :name, uniqueness: true, allow_blank: true base.validates :permission_sets, length: { minimum: 1, too_short: :atleast_one_permission_set_is_required }, on: :update - base.scope :default_role, lambda { where(is_default: true) } + base.scope :spree_default_role, lambda { where(is_default: true) } end def has_permission?(permission_title) diff --git a/spec/models/spree/role_decorator_spec.rb b/spec/models/spree/role_decorator_spec.rb index 23fd3f0..e7ecd8f 100644 --- a/spec/models/spree/role_decorator_spec.rb +++ b/spec/models/spree/role_decorator_spec.rb @@ -47,9 +47,9 @@ end end - describe 'default_role scope' do + describe 'spree_default_role scope' do it "should return the role with name user" do - expect(Spree::Role.default_role).to eq([role1]) + expect(Spree::Role.spree_default_role).to eq([role1]) end end From e05796d9e067b209c538804486cb12acfba1fcef Mon Sep 17 00:00:00 2001 From: Jose C Fernandez Date: Fri, 15 Apr 2022 10:55:43 -0400 Subject: [PATCH 3/7] [CORE-102] GitLab CI - Migrate spree_admin_roles_and_access [CORE-102] GitLab CI - Migrate spree_admin_roles_and_access --- .gitignore | 3 - .rubocop.yml | 19 + .rubocop_todo.yml | 665 ++++++++++++++++++ .ruby-version | 1 + Gemfile.lock | 468 ++++++++++++ spec/dummy/.ruby-version | 1 + spec/dummy/README.md | 24 + spec/dummy/Rakefile | 6 + spec/dummy/app/assets/config/manifest.js | 2 + spec/dummy/app/assets/images/.keep | 0 .../app/assets/stylesheets/application.css | 15 + .../app/channels/application_cable/channel.rb | 4 + .../channels/application_cable/connection.rb | 4 + .../app/controllers/application_controller.rb | 2 + spec/dummy/app/controllers/concerns/.keep | 0 spec/dummy/app/helpers/application_helper.rb | 2 + spec/dummy/app/jobs/application_job.rb | 7 + spec/dummy/app/mailers/application_mailer.rb | 4 + spec/dummy/app/models/application_record.rb | 3 + spec/dummy/app/models/concerns/.keep | 0 spec/dummy/app/models/spree/dummy_model.rb | 6 + .../app/views/layouts/application.html.erb | 15 + spec/dummy/app/views/layouts/mailer.html.erb | 13 + spec/dummy/app/views/layouts/mailer.text.erb | 1 + spec/dummy/bin/rails | 4 + spec/dummy/bin/rake | 4 + spec/dummy/bin/setup | 33 + spec/dummy/config.ru | 6 + spec/dummy/config/application.rb | 45 ++ spec/dummy/config/boot.rb | 6 + spec/dummy/config/cable.yml | 10 + spec/dummy/config/credentials.yml.enc | 1 + spec/dummy/config/database.yml | 23 + spec/dummy/config/environment.rb | 5 + spec/dummy/config/environments/development.rb | 70 ++ spec/dummy/config/environments/production.rb | 93 +++ spec/dummy/config/environments/test.rb | 40 ++ spec/dummy/config/initializers/assets.rb | 12 + .../initializers/content_security_policy.rb | 26 + spec/dummy/config/initializers/devise.rb | 3 + .../initializers/filter_parameter_logging.rb | 8 + spec/dummy/config/initializers/inflections.rb | 16 + .../config/initializers/permissions_policy.rb | 11 + spec/dummy/config/initializers/spree.rb | 31 + spec/dummy/config/locales/en.yml | 33 + spec/dummy/config/master.key | 1 + spec/dummy/config/puma.rb | 43 ++ spec/dummy/config/routes.rb | 11 + spec/dummy/config/storage.yml | 34 + .../migrate/001_create_spree_dummy_models.rb | 10 + spec/dummy/db/seeds.rb | 10 + spec/dummy/lib/assets/.keep | 0 spec/dummy/log/.keep | 0 spec/dummy/log/test.log | 0 spec/dummy/public/404.html | 67 ++ spec/dummy/public/422.html | 67 ++ spec/dummy/public/500.html | 66 ++ .../public/apple-touch-icon-precomposed.png | 0 spec/dummy/public/apple-touch-icon.png | 0 spec/dummy/public/favicon.ico | 0 spec/dummy/storage/.keep | 0 spree_admin_roles_and_access.gemspec | 47 +- 62 files changed, 2079 insertions(+), 22 deletions(-) create mode 100644 .rubocop.yml create mode 100644 .rubocop_todo.yml create mode 100644 .ruby-version create mode 100644 Gemfile.lock create mode 100644 spec/dummy/.ruby-version create mode 100644 spec/dummy/README.md create mode 100644 spec/dummy/Rakefile create mode 100644 spec/dummy/app/assets/config/manifest.js create mode 100644 spec/dummy/app/assets/images/.keep create mode 100644 spec/dummy/app/assets/stylesheets/application.css create mode 100644 spec/dummy/app/channels/application_cable/channel.rb create mode 100644 spec/dummy/app/channels/application_cable/connection.rb create mode 100644 spec/dummy/app/controllers/application_controller.rb create mode 100644 spec/dummy/app/controllers/concerns/.keep create mode 100644 spec/dummy/app/helpers/application_helper.rb create mode 100644 spec/dummy/app/jobs/application_job.rb create mode 100644 spec/dummy/app/mailers/application_mailer.rb create mode 100644 spec/dummy/app/models/application_record.rb create mode 100644 spec/dummy/app/models/concerns/.keep create mode 100644 spec/dummy/app/models/spree/dummy_model.rb create mode 100644 spec/dummy/app/views/layouts/application.html.erb create mode 100644 spec/dummy/app/views/layouts/mailer.html.erb create mode 100644 spec/dummy/app/views/layouts/mailer.text.erb create mode 100755 spec/dummy/bin/rails create mode 100755 spec/dummy/bin/rake create mode 100755 spec/dummy/bin/setup create mode 100644 spec/dummy/config.ru create mode 100644 spec/dummy/config/application.rb create mode 100644 spec/dummy/config/boot.rb create mode 100644 spec/dummy/config/cable.yml create mode 100644 spec/dummy/config/credentials.yml.enc create mode 100644 spec/dummy/config/database.yml create mode 100644 spec/dummy/config/environment.rb create mode 100644 spec/dummy/config/environments/development.rb create mode 100644 spec/dummy/config/environments/production.rb create mode 100644 spec/dummy/config/environments/test.rb create mode 100644 spec/dummy/config/initializers/assets.rb create mode 100644 spec/dummy/config/initializers/content_security_policy.rb create mode 100644 spec/dummy/config/initializers/devise.rb create mode 100644 spec/dummy/config/initializers/filter_parameter_logging.rb create mode 100644 spec/dummy/config/initializers/inflections.rb create mode 100644 spec/dummy/config/initializers/permissions_policy.rb create mode 100644 spec/dummy/config/initializers/spree.rb create mode 100644 spec/dummy/config/locales/en.yml create mode 100644 spec/dummy/config/master.key create mode 100644 spec/dummy/config/puma.rb create mode 100644 spec/dummy/config/routes.rb create mode 100644 spec/dummy/config/storage.yml create mode 100644 spec/dummy/db/migrate/001_create_spree_dummy_models.rb create mode 100644 spec/dummy/db/seeds.rb create mode 100644 spec/dummy/lib/assets/.keep create mode 100644 spec/dummy/log/.keep create mode 100644 spec/dummy/log/test.log create mode 100644 spec/dummy/public/404.html create mode 100644 spec/dummy/public/422.html create mode 100644 spec/dummy/public/500.html create mode 100644 spec/dummy/public/apple-touch-icon-precomposed.png create mode 100644 spec/dummy/public/apple-touch-icon.png create mode 100644 spec/dummy/public/favicon.ico create mode 100644 spec/dummy/storage/.keep diff --git a/.gitignore b/.gitignore index a103c3a..33748e0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,11 +6,8 @@ .project .sass-cache coverage -Gemfile.lock tmp nbproject pkg *.swp -spec/dummy -.ruby-version .byebug_history diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..7b648f6 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,19 @@ +inherit_from: .rubocop_todo.yml + +require: + - rubocop-rspec + +# inherit_from: .rubocop_todo.yml + +AllCops: + NewCops: enable + TargetRubyVersion: 2.7.0 + Exclude: + - bin/* + - gemfiles/* + - tmp/**/* + - vendor/**/* + - log/**/* +Style/SignalException: + EnforcedStyle: only_raise + diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..23df905 --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,665 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2022-04-15 14:54:59 UTC using RuboCop version 1.27.0. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. +# Include: **/*.gemspec +Gemspec/OrderedDependencies: + Exclude: + - 'spree_admin_roles_and_access.gemspec' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +Layout/EmptyLineAfterGuardClause: + Exclude: + - 'config/initializers/cancan_rule.rb' + +# Offense count: 7 +# This cop supports safe auto-correction (--auto-correct). +Layout/EmptyLines: + Exclude: + - 'lib/tasks/populate.rake' + - 'spec/dummy/config/application.rb' + - 'spec/models/spree/ability_decorator_spec.rb' + - 'spec/models/spree/permission_spec.rb' + - 'spec/models/spree/role_decorator_spec.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: around, only_before +Layout/EmptyLinesAroundAccessModifier: + Exclude: + - 'app/controllers/spree/admin/roles_controller.rb' + - 'lib/spree/permissions.rb' + +# Offense count: 13 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, no_empty_lines +Layout/EmptyLinesAroundBlockBody: + Exclude: + - 'lib/spree/permissions.rb' + - 'lib/tasks/populate.rake' + - 'spec/controllers/spree/admin/roles_controller_spec.rb' + - 'spec/models/spree/ability_decorator_spec.rb' + - 'spec/models/spree/permission_set_spec.rb' + - 'spec/models/spree/permission_spec.rb' + - 'spec/models/spree/role_decorator_spec.rb' + +# Offense count: 3 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only +Layout/EmptyLinesAroundClassBody: + Exclude: + - 'app/models/spree/roles_permission.rb' + - 'lib/generators/spree_admin_roles_and_access/install/install_generator.rb' + - 'spec/dummy/config/application.rb' + +# Offense count: 17 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment. +Layout/ExtraSpacing: + Exclude: + - 'spec/dummy/config/environments/test.rb' + - 'spec/models/spree/ability_decorator_spec.rb' + - 'spec/models/spree/permission_spec.rb' + - 'spec/models/spree/role_decorator_spec.rb' + - 'spec/spec_helper.rb' + +# Offense count: 6 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: normal, indented_internal_methods +Layout/IndentationConsistency: + Exclude: + - 'app/controllers/spree/admin/roles_controller.rb' + - 'lib/spree/permissions.rb' + - 'spec/dummy/config/application.rb' + +# Offense count: 5 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: Width, IgnoredPatterns. +Layout/IndentationWidth: + Exclude: + - 'app/controllers/spree/admin/roles_controller.rb' + - 'lib/spree/permissions.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator. +# SupportedStylesForExponentOperator: space, no_space +Layout/SpaceAroundOperators: + Exclude: + - 'spec/dummy/config/environments/test.rb' + +# Offense count: 15 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: AllowForAlignment. +Layout/SpaceBeforeFirstArg: + Exclude: + - 'spec/models/spree/ability_decorator_spec.rb' + - 'spec/models/spree/permission_spec.rb' + - 'spec/models/spree/role_decorator_spec.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets. +# SupportedStyles: space, no_space, compact +# SupportedStylesForEmptyBrackets: space, no_space +Layout/SpaceInsideArrayLiteralBrackets: + Exclude: + - 'spec/dummy/config/environments/production.rb' + +# Offense count: 16 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. +# SupportedStyles: space, no_space, compact +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceInsideHashLiteralBraces: + Exclude: + - 'config/initializers/constants.rb' + - 'spec/controllers/spree/admin/roles_controller_spec.rb' + - 'spec/models/spree/ability_decorator_spec.rb' + +# Offense count: 30 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: space, no_space +Layout/SpaceInsideStringInterpolation: + Exclude: + - 'lib/tasks/populate.rake' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: final_newline, final_blank_line +Layout/TrailingEmptyLines: + Exclude: + - 'spec/dummy/config/application.rb' + - 'spec/dummy/config/initializers/devise.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: AllowInHeredoc. +Layout/TrailingWhitespace: + Exclude: + - 'lib/spree/permissions.rb' + - 'spec/constants_spec.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +Lint/AmbiguousOperator: + Exclude: + - 'lib/spree_admin_roles_and_access/engine.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +Lint/AmbiguousOperatorPrecedence: + Exclude: + - 'config/initializers/cancan_rule.rb' + - 'lib/spree/permissions.rb' + +# Offense count: 1 +# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches. +Lint/DuplicateBranch: + Exclude: + - 'lib/tasks/populate.rake' + +# Offense count: 4 +# This cop supports unsafe auto-correction (--auto-correct-all). +Lint/NonDeterministicRequireOrder: + Exclude: + - 'lib/spree_admin_roles_and_access/engine.rb' + - 'spec/dummy/config/application.rb' + - 'spec/spec_helper.rb' + +# Offense count: 2 +# This cop supports unsafe auto-correction (--auto-correct-all). +# Configuration parameters: AllowedImplicitNamespaces. +# AllowedImplicitNamespaces: Gem +Lint/RaiseException: + Exclude: + - 'config/initializers/cancan_ability.rb' + - 'config/initializers/cancan_rule.rb' + +# Offense count: 6 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. +Lint/UnusedBlockArgument: + Exclude: + - 'lib/spree/permissions.rb' + +# Offense count: 2 +Lint/UselessAssignment: + Exclude: + - 'lib/tasks/populate.rake' + +# Offense count: 7 +# Configuration parameters: IgnoredMethods, CountRepeatedAttributes. +Metrics/AbcSize: + Max: 27 + +# Offense count: 26 +# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. +# IgnoredMethods: refine +Metrics/BlockLength: + Max: 570 + +# Offense count: 4 +# Configuration parameters: IgnoredMethods. +Metrics/CyclomaticComplexity: + Max: 10 + +# Offense count: 9 +# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. +Metrics/MethodLength: + Max: 24 + +# Offense count: 2 +# Configuration parameters: IgnoredMethods. +Metrics/PerceivedComplexity: + Max: 11 + +# Offense count: 1 +# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros. +# NamePrefix: is_, has_, have_ +# ForbiddenPrefixes: is_, has_, have_ +# AllowedMethods: is_a? +# MethodDefinitionMacros: define_method, define_singleton_method +Naming/PredicateName: + Exclude: + - 'spec/**/*' + - 'app/models/spree_admin_roles_and_access/spree/role_decorator.rb' + +# Offense count: 4 +RSpec/AnyInstance: + Exclude: + - 'spec/models/spree/ability_decorator_spec.rb' + +# Offense count: 6 +# This cop supports safe auto-correction (--auto-correct). +RSpec/BeEq: + Exclude: + - 'spec/models/spree/ability_decorator_spec.rb' + - 'spec/models/spree/permission_spec.rb' + - 'spec/models/spree/role_decorator_spec.rb' + +# Offense count: 9 +# Configuration parameters: Prefixes. +# Prefixes: when, with, without +RSpec/ContextWording: + Exclude: + - 'spec/models/spree/ability_decorator_spec.rb' + +# Offense count: 46 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: SkipBlocks, EnforcedStyle. +# SupportedStyles: described_class, explicit +RSpec/DescribedClass: + Exclude: + - 'spec/controllers/spree/admin/roles_controller_spec.rb' + - 'spec/models/spree/ability_decorator_spec.rb' + - 'spec/models/spree/permission_set_spec.rb' + - 'spec/models/spree/permission_spec.rb' + - 'spec/models/spree/role_decorator_spec.rb' + +# Offense count: 3 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: AllowConsecutiveOneLiners. +RSpec/EmptyLineAfterExample: + Exclude: + - 'spec/models/spree/permission_set_spec.rb' + - 'spec/models/spree/role_decorator_spec.rb' + +# Offense count: 3 +# This cop supports safe auto-correction (--auto-correct). +RSpec/EmptyLineAfterExampleGroup: + Exclude: + - 'spec/models/spree/ability_decorator_spec.rb' + - 'spec/models/spree/permission_set_spec.rb' + - 'spec/models/spree/role_decorator_spec.rb' + +# Offense count: 3 +# This cop supports safe auto-correction (--auto-correct). +RSpec/EmptyLineAfterFinalLet: + Exclude: + - 'spec/models/spree/ability_decorator_spec.rb' + +# Offense count: 6 +# This cop supports safe auto-correction (--auto-correct). +RSpec/EmptyLineAfterHook: + Exclude: + - 'spec/models/spree/ability_decorator_spec.rb' + - 'spec/models/spree/permission_set_spec.rb' + - 'spec/models/spree/role_decorator_spec.rb' + +# Offense count: 6 +# This cop supports safe auto-correction (--auto-correct). +RSpec/EmptyLineAfterSubject: + Exclude: + - 'spec/models/spree/permission_set_spec.rb' + - 'spec/models/spree/permission_spec.rb' + - 'spec/models/spree/role_decorator_spec.rb' + +# Offense count: 106 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: CustomTransform, IgnoredWords. +RSpec/ExampleWording: + Exclude: + - 'spec/constants_spec.rb' + - 'spec/controllers/spree/admin/roles_controller_spec.rb' + - 'spec/models/spree/ability_decorator_spec.rb' + - 'spec/models/spree/permission_spec.rb' + - 'spec/models/spree/role_decorator_spec.rb' + +# Offense count: 46 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: implicit, each, example +RSpec/HookArgument: + Exclude: + - 'spec/controllers/spree/admin/roles_controller_spec.rb' + - 'spec/models/spree/ability_decorator_spec.rb' + - 'spec/models/spree/permission_spec.rb' + - 'spec/models/spree/role_decorator_spec.rb' + - 'spec/spec_helper.rb' + +# Offense count: 10 +# Configuration parameters: AssignmentOnly. +RSpec/InstanceVariable: + Exclude: + - 'spec/controllers/spree/admin/roles_controller_spec.rb' + +# Offense count: 23 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: it_behaves_like, it_should_behave_like +RSpec/ItBehavesLike: + Exclude: + - 'spec/controllers/spree/admin/roles_controller_spec.rb' + - 'spec/models/spree/ability_decorator_spec.rb' + +# Offense count: 13 +# This cop supports safe auto-correction (--auto-correct). +RSpec/LeadingSubject: + Exclude: + - 'spec/models/spree/ability_decorator_spec.rb' + +# Offense count: 67 +# Configuration parameters: . +# SupportedStyles: have_received, receive +RSpec/MessageSpies: + EnforcedStyle: receive + +# Offense count: 1 +RSpec/MultipleExpectations: + Max: 2 + +# Offense count: 96 +# Configuration parameters: AllowSubject. +RSpec/MultipleMemoizedHelpers: + Max: 33 + +# Offense count: 29 +# Configuration parameters: IgnoreSharedExamples. +RSpec/NamedSubject: + Exclude: + - 'spec/models/spree/ability_decorator_spec.rb' + - 'spec/models/spree/permission_spec.rb' + - 'spec/models/spree/role_decorator_spec.rb' + - 'spec/models/spree/user_decorator_spec.rb' + +# Offense count: 31 +RSpec/NestedGroups: + Max: 5 + +# Offense count: 33 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: not_to, to_not +RSpec/NotToNot: + Exclude: + - 'spec/controllers/spree/admin/roles_controller_spec.rb' + - 'spec/models/spree/ability_decorator_spec.rb' + - 'spec/models/spree/permission_set_spec.rb' + - 'spec/models/spree/permission_spec.rb' + - 'spec/models/spree/role_decorator_spec.rb' + +# Offense count: 10 +RSpec/RepeatedDescription: + Exclude: + - 'spec/controllers/spree/admin/roles_controller_spec.rb' + - 'spec/models/spree/ability_decorator_spec.rb' + +# Offense count: 6 +RSpec/RepeatedExampleGroupDescription: + Exclude: + - 'spec/controllers/spree/admin/roles_controller_spec.rb' + - 'spec/models/spree/ability_decorator_spec.rb' + - 'spec/models/spree/permission_spec.rb' + +# Offense count: 52 +RSpec/StubbedMock: + Exclude: + - 'spec/controllers/spree/admin/roles_controller_spec.rb' + - 'spec/models/spree/ability_decorator_spec.rb' + - 'spec/models/spree/permission_spec.rb' + +# Offense count: 1 +# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames. +RSpec/VerifiedDoubles: + Exclude: + - 'spec/controllers/spree/admin/roles_controller_spec.rb' + +# Offense count: 3 +# Configuration parameters: EnforcedStyle, AllowModifiersOnSymbols. +# SupportedStyles: inline, group +Style/AccessModifierDeclarations: + Exclude: + - 'app/controllers/spree/admin/default_admin_dashboards_controller.rb' + - 'app/controllers/spree/admin/permission_sets_controller.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: prefer_alias, prefer_alias_method +Style/Alias: + Exclude: + - 'config/initializers/auth.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: nested, compact +Style/ClassAndModuleChildren: + Exclude: + - 'app/controllers/spree/admin/default_admin_dashboards_controller.rb' + - 'config/initializers/auth.rb' + +# Offense count: 6 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: is_a?, kind_of? +Style/ClassCheck: + Exclude: + - 'config/initializers/cancan_rule.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: IgnoredMethods. +# IgnoredMethods: ==, equal?, eql? +Style/ClassEqualityComparison: + Exclude: + - 'config/initializers/cancan_rule.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. +# SupportedStyles: assign_to_condition, assign_inside_condition +Style/ConditionalAssignment: + Exclude: + - 'app/controllers/spree_admin_roles_and_access/spree/admin/base_controller_decorator.rb' + +# Offense count: 23 +# Configuration parameters: AllowedConstants. +Style/Documentation: + Enabled: false + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: compact, expanded +Style/EmptyMethod: + Exclude: + - 'app/controllers/spree/admin/default_admin_dashboards_controller.rb' + +# Offense count: 3 +# This cop supports safe auto-correction (--auto-correct). +Style/ExpandPathArguments: + Exclude: + - 'spec/dummy/config/application.rb' + - 'spec/dummy/config/boot.rb' + - 'spec/spec_helper.rb' + +# Offense count: 76 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, always_true, never +Style/FrozenStringLiteralComment: + Enabled: false + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +Style/GlobalStdStream: + Exclude: + - 'spec/dummy/config/environments/production.rb' + +# Offense count: 1 +# Configuration parameters: MinBodyLength. +Style/GuardClause: + Exclude: + - 'lib/spree/permissions.rb' + +# Offense count: 4 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: braces, no_braces +Style/HashAsLastArrayItem: + Exclude: + - 'spec/models/spree/ability_decorator_spec.rb' + +# Offense count: 6 +# This cop supports safe auto-correction (--auto-correct). +Style/IfUnlessModifier: + Exclude: + - 'config/initializers/cancan_ability.rb' + - 'lib/tasks/populate.rake' + - 'spec/dummy/config/initializers/devise.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: line_count_dependent, lambda, literal +Style/Lambda: + Exclude: + - 'app/models/spree/permission.rb' + - 'app/models/spree_admin_roles_and_access/spree/role_decorator.rb' + +# Offense count: 1 +Style/MissingRespondToMissing: + Exclude: + - 'lib/spree/permissions.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: literals, strict +Style/MutableConstant: + Exclude: + - 'config/initializers/constants.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: AllowedMethods. +# AllowedMethods: be, be_a, be_an, be_between, be_falsey, be_kind_of, be_instance_of, be_truthy, be_within, eq, eql, end_with, include, match, raise_error, respond_to, start_with +Style/NestedParenthesizedCalls: + Exclude: + - 'lib/generators/spree_admin_roles_and_access/install/install_generator.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: PreferredDelimiters. +Style/PercentLiteralDelimiters: + Exclude: + - 'lib/spree_admin_roles_and_access/engine.rb' + - 'spec/dummy/config/application.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +Style/Proc: + Exclude: + - 'spec/models/spree/ability_decorator_spec.rb' + +# Offense count: 2 +# This cop supports unsafe auto-correction (--auto-correct-all). +# Configuration parameters: SafeForConstants. +Style/RedundantFetchBlock: + Exclude: + - 'spec/dummy/config/puma.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +Style/RedundantInterpolation: + Exclude: + - 'app/controllers/spree_admin_roles_and_access/spree/admin/base_controller_decorator.rb' + +# Offense count: 3 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: AllowMultipleReturnValues. +Style/RedundantReturn: + Exclude: + - 'lib/spree/permissions.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +Style/RedundantSelf: + Exclude: + - 'app/models/spree_admin_roles_and_access/spree/ability_decorator.rb' + - 'lib/spree/permissions.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle, AllowInnerSlashes. +# SupportedStyles: slashes, percent_r, mixed +Style/RegexpLiteral: + Exclude: + - 'lib/generators/spree_admin_roles_and_access/install/install_generator.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: implicit, explicit +Style/RescueStandardError: + Exclude: + - 'app/controllers/spree_admin_roles_and_access/spree/admin/base_controller_decorator.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength. +# AllowedMethods: present?, blank?, presence, try, try! +Style/SafeNavigation: + Exclude: + - 'config/initializers/auth.rb' + +# Offense count: 3 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: AllowAsExpressionSeparator. +Style/Semicolon: + Exclude: + - 'spec/models/spree/permission_set_spec.rb' + - 'spec/models/spree/role_decorator_spec.rb' + +# Offense count: 100 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiterals: + Enabled: false + +# Offense count: 93 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: MinSize. +# SupportedStyles: percent, brackets +Style/SymbolArray: + EnforcedStyle: brackets + +# Offense count: 1 +# This cop supports unsafe auto-correction (--auto-correct-all). +# Configuration parameters: AllowMethodsWithArguments, IgnoredMethods. +# IgnoredMethods: respond_to, define_method +Style/SymbolProc: + Exclude: + - 'app/controllers/spree/admin/default_admin_dashboards_controller.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInArrayLiteral: + Exclude: + - 'lib/tasks/populate.rake' + +# Offense count: 31 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# URISchemes: http, https +Layout/LineLength: + Max: 229 diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..2eb2fe9 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +ruby-2.7.2 diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..b20801f --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,468 @@ +PATH + remote: . + specs: + spree_admin_roles_and_access (3.pre.0.pre.stable) + spree_auth_devise + spree_core (>= 3.7.0, < 5.0.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.0.2.3) + actionpack (= 7.0.2.3) + activesupport (= 7.0.2.3) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (7.0.2.3) + actionpack (= 7.0.2.3) + activejob (= 7.0.2.3) + activerecord (= 7.0.2.3) + activestorage (= 7.0.2.3) + activesupport (= 7.0.2.3) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.0.2.3) + actionpack (= 7.0.2.3) + actionview (= 7.0.2.3) + activejob (= 7.0.2.3) + activesupport (= 7.0.2.3) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.0) + actionpack (7.0.2.3) + actionview (= 7.0.2.3) + activesupport (= 7.0.2.3) + rack (~> 2.0, >= 2.2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (7.0.2.3) + actionpack (= 7.0.2.3) + activerecord (= 7.0.2.3) + activestorage (= 7.0.2.3) + activesupport (= 7.0.2.3) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.0.2.3) + activesupport (= 7.0.2.3) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + active_storage_validations (0.9.5) + rails (>= 5.2.0) + activejob (7.0.2.3) + activesupport (= 7.0.2.3) + globalid (>= 0.3.6) + activemerchant (1.125.0) + activesupport (>= 4.2) + builder (>= 2.1.2, < 4.0.0) + i18n (>= 0.6.9) + nokogiri (~> 1.4) + activemodel (7.0.2.3) + activesupport (= 7.0.2.3) + activerecord (7.0.2.3) + activemodel (= 7.0.2.3) + activesupport (= 7.0.2.3) + activerecord-typedstore (1.4.0) + activerecord (>= 5.2) + activestorage (7.0.2.3) + actionpack (= 7.0.2.3) + activejob (= 7.0.2.3) + activerecord (= 7.0.2.3) + activesupport (= 7.0.2.3) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (7.0.2.3) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + acts_as_list (1.0.4) + activerecord (>= 4.2) + addressable (2.8.0) + public_suffix (>= 2.0.2, < 5.0) + appraisal (2.4.1) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + auto_strip_attributes (2.6.0) + activerecord (>= 4.0) + awesome_nested_set (3.5.0) + activerecord (>= 4.0.0, < 7.1) + bcrypt (3.1.17) + brakeman (5.2.2) + builder (3.2.4) + bundler-audit (0.9.0.1) + bundler (>= 1.2.0, < 3) + thor (~> 1.0) + byebug (11.1.3) + cancancan (3.3.0) + capybara (3.36.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + carmen (1.1.3) + activesupport (>= 3.0.0) + childprocess (4.1.0) + cliver (0.3.2) + coderay (1.1.3) + coffee-rails (5.0.0) + coffee-script (>= 2.2.0) + railties (>= 5.2.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.1.10) + crass (1.0.6) + database_cleaner (2.0.1) + database_cleaner-active_record (~> 2.0.0) + database_cleaner-active_record (2.0.1) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0.0) + database_cleaner-core (2.0.1) + devise (4.8.1) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0) + responders + warden (~> 1.2.3) + devise-encryptable (0.2.0) + devise (>= 2.1.0) + diff-lcs (1.5.0) + digest (3.1.0) + docile (1.4.0) + doorkeeper (5.5.4) + railties (>= 5) + erubi (1.10.0) + execjs (2.8.1) + factory_girl (4.9.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.9.0) + factory_girl (~> 4.9.0) + railties (>= 3.0.0) + ffaker (2.21.0) + ffi (1.15.5) + friendly_id (5.4.2) + activerecord (>= 4.0.0) + globalid (1.0.0) + activesupport (>= 5.0) + highline (2.0.3) + i18n (1.10.0) + concurrent-ruby (~> 1.0) + image_processing (1.12.2) + mini_magick (>= 4.9.5, < 5) + ruby-vips (>= 2.0.17, < 3) + jsonapi-serializer (2.2.0) + activesupport (>= 4.2) + kaminari (1.2.2) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.2.2) + kaminari-activerecord (= 1.2.2) + kaminari-core (= 1.2.2) + kaminari-actionview (1.2.2) + actionview + kaminari-core (= 1.2.2) + kaminari-activerecord (1.2.2) + activerecord + kaminari-core (= 1.2.2) + kaminari-core (1.2.2) + launchy (2.5.0) + addressable (~> 2.7) + loofah (2.16.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (1.0.2) + matrix (0.4.2) + method_source (1.0.0) + mini_magick (4.11.0) + mini_mime (1.1.2) + mini_portile2 (2.8.0) + minitest (5.15.0) + monetize (1.12.0) + money (~> 6.12) + money (6.16.0) + i18n (>= 0.6.4, <= 2) + net-imap (0.2.3) + digest + net-protocol + strscan + net-pop (0.1.1) + digest + net-protocol + timeout + net-protocol (0.1.3) + timeout + net-smtp (0.3.1) + digest + net-protocol + timeout + nio4r (2.5.8) + nokogiri (1.13.4) + mini_portile2 (~> 2.8.0) + racc (~> 1.4) + orm_adapter (0.5.0) + parallel (1.22.1) + paranoia (2.6.0) + activerecord (>= 5.1, < 7.1) + parser (3.1.2.0) + ast (~> 2.4.1) + pg (1.3.5) + poltergeist (1.18.1) + capybara (>= 2.1, < 4) + cliver (~> 0.3.1) + websocket-driver (>= 0.2.0) + pry (0.14.1) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (4.0.7) + rabl (0.15.0) + activesupport (>= 2.3.14) + racc (1.6.0) + rack (2.2.3) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (7.0.2.3) + actioncable (= 7.0.2.3) + actionmailbox (= 7.0.2.3) + actionmailer (= 7.0.2.3) + actionpack (= 7.0.2.3) + actiontext (= 7.0.2.3) + actionview (= 7.0.2.3) + activejob (= 7.0.2.3) + activemodel (= 7.0.2.3) + activerecord (= 7.0.2.3) + activestorage (= 7.0.2.3) + activesupport (= 7.0.2.3) + bundler (>= 1.15.0) + railties (= 7.0.2.3) + rails-controller-testing (1.0.5) + actionpack (>= 5.0.1.rc1) + actionview (>= 5.0.1.rc1) + activesupport (>= 5.0.1.rc1) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.4.2) + loofah (~> 2.3) + railties (7.0.2.3) + actionpack (= 7.0.2.3) + activesupport (= 7.0.2.3) + method_source + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) + rainbow (3.1.1) + rake (13.0.6) + ransack (2.6.0) + activerecord (>= 6.0.4) + activesupport (>= 6.0.4) + i18n + redis (4.6.0) + regexp_parser (2.3.0) + responders (3.0.1) + actionpack (>= 5.0) + railties (>= 5.0) + rexml (3.2.5) + rspec-activemodel-mocks (1.1.0) + activemodel (>= 3.0) + activesupport (>= 3.0) + rspec-mocks (>= 2.99, < 4.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-rails (3.5.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + rubocop (1.27.0) + parallel (~> 1.10) + parser (>= 3.1.0.0) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml + rubocop-ast (>= 1.16.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.17.0) + parser (>= 3.1.1.0) + rubocop-rspec (2.9.0) + rubocop (~> 1.19) + ruby-progressbar (1.11.0) + ruby-vips (2.1.4) + ffi (~> 1.12) + rubyzip (2.3.2) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) + sassc (2.4.0) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + selenium-webdriver (4.1.0) + childprocess (>= 0.5, < 5.0) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2) + semaphore_cucumber_booster_config (1.4.2) + thor (>= 0.19.1, < 2.0) + semaphore_test_boosters (2.7.1) + semaphore_cucumber_booster_config (~> 1.4.2) + shoulda-matchers (3.1.3) + activesupport (>= 4.0.0) + simplecov (0.21.2) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-cobertura (2.1.0) + rexml + simplecov (~> 0.19) + simplecov-html (0.12.3) + simplecov_json_formatter (0.1.4) + spree (4.4.0) + spree_api (= 4.4.0) + spree_cli (= 4.4.0) + spree_core (= 4.4.0) + spree_api (4.4.0) + bcrypt (~> 3.1) + doorkeeper (~> 5.3) + jsonapi-serializer (~> 2.1) + rabl (~> 0.14, >= 0.14.2) + responders + spree_core (= 4.4.0) + spree_auth_devise (4.4.2) + devise (~> 4.7) + devise-encryptable (= 0.2.0) + spree_core (>= 4.3.0.rc1) + spree_extension + spree_cli (4.4.0) + thor (~> 1.0) + spree_core (4.4.0) + actionpack (>= 5.2) + actionview (>= 5.2) + active_storage_validations (~> 0.9, <= 0.9.5) + activejob (>= 5.2) + activemerchant (~> 1.67) + activemodel (>= 5.2) + activerecord (>= 5.2) + activerecord-typedstore + activestorage (>= 5.2) + activesupport (>= 5.2) + acts_as_list (>= 0.8) + auto_strip_attributes (~> 2.6) + awesome_nested_set (~> 3.3, >= 3.3.1) + cancancan (~> 3.2) + carmen (>= 1.0) + friendly_id (~> 5.2, >= 5.2.1) + highline (~> 2.0) + image_processing (~> 1.2) + kaminari (~> 1.2) + mini_magick (~> 4.9, >= 4.9.4) + monetize (~> 1.9) + money (~> 6.13) + paranoia (~> 2.4) + railties (>= 5.2) + ransack (~> 2.3) + rexml + state_machines-activemodel (~> 0.7) + state_machines-activerecord (~> 0.6) + stringex + validates_zipcode + spree_extension (0.0.9) + activerecord (>= 4.2) + spree_core + sprockets (4.0.3) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + state_machines (0.5.0) + state_machines-activemodel (0.8.0) + activemodel (>= 5.1) + state_machines (>= 0.5.0) + state_machines-activerecord (0.8.0) + activerecord (>= 5.1) + state_machines-activemodel (>= 0.8.0) + stringex (2.8.5) + strscan (3.0.1) + thor (1.2.1) + tilt (2.0.10) + timeout (0.2.0) + tzinfo (2.0.4) + concurrent-ruby (~> 1.0) + unicode-display_width (2.1.0) + validates_zipcode (0.5.0) + activemodel (>= 4.2.0) + warden (1.2.9) + rack (>= 2.0.9) + websocket-driver (0.7.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.5.4) + +PLATFORMS + ruby + +DEPENDENCIES + appraisal + brakeman + bundler-audit + byebug + capybara + coffee-rails + database_cleaner + factory_girl_rails + ffaker + launchy + pg + poltergeist + pry + rails-controller-testing + redis + rspec-activemodel-mocks + rspec-rails (~> 3.5.0) + rubocop + rubocop-rspec + sass-rails + selenium-webdriver + semaphore_test_boosters + shoulda-matchers (~> 3.1) + simplecov (= 0.21.2) + simplecov-cobertura + spree (>= 3.7.0, < 5.0.0) + spree_admin_roles_and_access! + spree_auth_devise + sqlite3 + +BUNDLED WITH + 2.1.4 diff --git a/spec/dummy/.ruby-version b/spec/dummy/.ruby-version new file mode 100644 index 0000000..2eb2fe9 --- /dev/null +++ b/spec/dummy/.ruby-version @@ -0,0 +1 @@ +ruby-2.7.2 diff --git a/spec/dummy/README.md b/spec/dummy/README.md new file mode 100644 index 0000000..7db80e4 --- /dev/null +++ b/spec/dummy/README.md @@ -0,0 +1,24 @@ +# README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... diff --git a/spec/dummy/Rakefile b/spec/dummy/Rakefile new file mode 100644 index 0000000..9a5ea73 --- /dev/null +++ b/spec/dummy/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative "config/application" + +Rails.application.load_tasks diff --git a/spec/dummy/app/assets/config/manifest.js b/spec/dummy/app/assets/config/manifest.js new file mode 100644 index 0000000..5918193 --- /dev/null +++ b/spec/dummy/app/assets/config/manifest.js @@ -0,0 +1,2 @@ +//= link_tree ../images +//= link_directory ../stylesheets .css diff --git a/spec/dummy/app/assets/images/.keep b/spec/dummy/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/app/assets/stylesheets/application.css b/spec/dummy/app/assets/stylesheets/application.css new file mode 100644 index 0000000..288b9ab --- /dev/null +++ b/spec/dummy/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's + * vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/spec/dummy/app/channels/application_cable/channel.rb b/spec/dummy/app/channels/application_cable/channel.rb new file mode 100644 index 0000000..d672697 --- /dev/null +++ b/spec/dummy/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/spec/dummy/app/channels/application_cable/connection.rb b/spec/dummy/app/channels/application_cable/connection.rb new file mode 100644 index 0000000..0ff5442 --- /dev/null +++ b/spec/dummy/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/spec/dummy/app/controllers/application_controller.rb b/spec/dummy/app/controllers/application_controller.rb new file mode 100644 index 0000000..09705d1 --- /dev/null +++ b/spec/dummy/app/controllers/application_controller.rb @@ -0,0 +1,2 @@ +class ApplicationController < ActionController::Base +end diff --git a/spec/dummy/app/controllers/concerns/.keep b/spec/dummy/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/app/helpers/application_helper.rb b/spec/dummy/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/spec/dummy/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/spec/dummy/app/jobs/application_job.rb b/spec/dummy/app/jobs/application_job.rb new file mode 100644 index 0000000..d394c3d --- /dev/null +++ b/spec/dummy/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/spec/dummy/app/mailers/application_mailer.rb b/spec/dummy/app/mailers/application_mailer.rb new file mode 100644 index 0000000..3c34c81 --- /dev/null +++ b/spec/dummy/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: "from@example.com" + layout "mailer" +end diff --git a/spec/dummy/app/models/application_record.rb b/spec/dummy/app/models/application_record.rb new file mode 100644 index 0000000..b63caeb --- /dev/null +++ b/spec/dummy/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + primary_abstract_class +end diff --git a/spec/dummy/app/models/concerns/.keep b/spec/dummy/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/app/models/spree/dummy_model.rb b/spec/dummy/app/models/spree/dummy_model.rb new file mode 100644 index 0000000..099ad2c --- /dev/null +++ b/spec/dummy/app/models/spree/dummy_model.rb @@ -0,0 +1,6 @@ +module Spree + class DummyModel < Spree::Base + acts_as_list + validates :name, presence: true + end +end diff --git a/spec/dummy/app/views/layouts/application.html.erb b/spec/dummy/app/views/layouts/application.html.erb new file mode 100644 index 0000000..f72b4ef --- /dev/null +++ b/spec/dummy/app/views/layouts/application.html.erb @@ -0,0 +1,15 @@ + + + + Dummy + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= stylesheet_link_tag "application" %> + + + + <%= yield %> + + diff --git a/spec/dummy/app/views/layouts/mailer.html.erb b/spec/dummy/app/views/layouts/mailer.html.erb new file mode 100644 index 0000000..cbd34d2 --- /dev/null +++ b/spec/dummy/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/spec/dummy/app/views/layouts/mailer.text.erb b/spec/dummy/app/views/layouts/mailer.text.erb new file mode 100644 index 0000000..37f0bdd --- /dev/null +++ b/spec/dummy/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/spec/dummy/bin/rails b/spec/dummy/bin/rails new file mode 100755 index 0000000..efc0377 --- /dev/null +++ b/spec/dummy/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/spec/dummy/bin/rake b/spec/dummy/bin/rake new file mode 100755 index 0000000..4fbf10b --- /dev/null +++ b/spec/dummy/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/spec/dummy/bin/setup b/spec/dummy/bin/setup new file mode 100755 index 0000000..ec47b79 --- /dev/null +++ b/spec/dummy/bin/setup @@ -0,0 +1,33 @@ +#!/usr/bin/env ruby +require "fileutils" + +# path to your application root. +APP_ROOT = File.expand_path("..", __dir__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. + # Add necessary setup steps to this file. + + puts "== Installing dependencies ==" + system! "gem install bundler --conservative" + system("bundle check") || system!("bundle install") + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # FileUtils.cp "config/database.yml.sample", "config/database.yml" + # end + + puts "\n== Preparing database ==" + system! "bin/rails db:prepare" + + puts "\n== Removing old logs and tempfiles ==" + system! "bin/rails log:clear tmp:clear" + + puts "\n== Restarting application server ==" + system! "bin/rails restart" +end diff --git a/spec/dummy/config.ru b/spec/dummy/config.ru new file mode 100644 index 0000000..4a3c09a --- /dev/null +++ b/spec/dummy/config.ru @@ -0,0 +1,6 @@ +# This file is used by Rack-based servers to start the application. + +require_relative "config/environment" + +run Rails.application +Rails.application.load_server diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb new file mode 100644 index 0000000..0a2cacb --- /dev/null +++ b/spec/dummy/config/application.rb @@ -0,0 +1,45 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +Bundler.require(*Rails.groups(assets: %w(development test))) + + +begin + require 'spree_api' +rescue LoadError + # spree_api is not available. +end + require 'spree_admin_roles_and_access' + +module Dummy + class Application < Rails::Application + + config.to_prepare do + # Load application's model / class decorators + Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c| + Rails.configuration.cache_classes ? require(c) : load(c) + end + + # Load application's view overrides + Dir.glob(File.join(File.dirname(__FILE__), "../app/overrides/*.rb")) do |c| + Rails.configuration.cache_classes ? require(c) : load(c) + end + end + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 7.0 + + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # + # config.time_zone = "Central Time (US & Canada)" + # config.eager_load_paths << Rails.root.join("extras") + + # Don't generate system test files. + config.generators.system_tests = nil + end +end + + diff --git a/spec/dummy/config/boot.rb b/spec/dummy/config/boot.rb new file mode 100644 index 0000000..074f555 --- /dev/null +++ b/spec/dummy/config/boot.rb @@ -0,0 +1,6 @@ +require 'rubygems' +gemfile = File.expand_path("../../../../Gemfile", __FILE__) + +ENV['BUNDLE_GEMFILE'] = gemfile +require 'bundler' +Bundler.setup diff --git a/spec/dummy/config/cable.yml b/spec/dummy/config/cable.yml new file mode 100644 index 0000000..98367f8 --- /dev/null +++ b/spec/dummy/config/cable.yml @@ -0,0 +1,10 @@ +development: + adapter: async + +test: + adapter: test + +production: + adapter: redis + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: dummy_production diff --git a/spec/dummy/config/credentials.yml.enc b/spec/dummy/config/credentials.yml.enc new file mode 100644 index 0000000..98c0340 --- /dev/null +++ b/spec/dummy/config/credentials.yml.enc @@ -0,0 +1 @@ +XKzJWmaE0x0Q65cRkOZeYMcDgM8jPtkSFdeRNze0DVjhTn+QLYDfW4KJB/yLXc8krihrij8cSoniWYSeCZK4c98YVoLNPaWfe3LjnP6Td8fZ9vpNhIVqasJo1pmWvBh8PtQ4RI4q1hI6AdFs8qtCX/ZYpZ6VgYo76mcrhuw4iRrMo+xt5pCKxnh4OKO00aLXqiJmxlJzrd1N0EDQ+MPqTqUWSc6CVDHn8Txq0UJtU0MYgeB6EfxTQkERBjmgJ0RuUUrrnycadPPkppQai2lybEu6CvRUq+aEYBzvDErM808LpeekjNADYYSV5ghoXJrjZwyyjtmCqiEO148+mPrGIt9dZ0I6je8av0dCR/ofTZfziCCK3S1s4xmpiIGzkClWFV7u1RxPqzJGqoVzJsga+ngbosQAXE1dn/1L--c11RvYeKpQDhrfwY--A1i3KcVw4M7PmTgZ9nGnrA== \ No newline at end of file diff --git a/spec/dummy/config/database.yml b/spec/dummy/config/database.yml new file mode 100644 index 0000000..4361cb5 --- /dev/null +++ b/spec/dummy/config/database.yml @@ -0,0 +1,23 @@ + + + + + + +postgres: &postgres + adapter: postgresql + + + + min_messages: warning + +development: + <<: *postgres + database: spree_admin_roles_and_access_spree_development +test: + <<: *postgres + database: spree_admin_roles_and_access_spree_test +production: + <<: *postgres + database: spree_admin_roles_and_access_spree_production + diff --git a/spec/dummy/config/environment.rb b/spec/dummy/config/environment.rb new file mode 100644 index 0000000..cac5315 --- /dev/null +++ b/spec/dummy/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative "application" + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/spec/dummy/config/environments/development.rb b/spec/dummy/config/environments/development.rb new file mode 100644 index 0000000..8500f45 --- /dev/null +++ b/spec/dummy/config/environments/development.rb @@ -0,0 +1,70 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded any time + # it changes. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable server timing + config.server_timing = true + + # Enable/disable caching. By default caching is disabled. + # Run rails dev:cache to toggle caching. + if Rails.root.join("tmp/caching-dev.txt").exist? + config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{2.days.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + config.action_mailer.perform_caching = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true +end diff --git a/spec/dummy/config/environments/production.rb b/spec/dummy/config/environments/production.rb new file mode 100644 index 0000000..8e989b5 --- /dev/null +++ b/spec/dummy/config/environments/production.rb @@ -0,0 +1,93 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] + # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). + # config.require_master_key = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? + + # Compress CSS using a preprocessor. + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.asset_host = "http://assets.example.com" + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache + # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Mount Action Cable outside main process or domain. + # config.action_cable.mount_path = nil + # config.action_cable.url = "wss://example.com/cable" + # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Include generic and useful information about system operation, but avoid logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). + config.log_level = :info + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment). + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "dummy_production" + + config.action_mailer.perform_caching = false + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Use a different logger for distributed setups. + # require "syslog/logger" + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/spec/dummy/config/environments/test.rb b/spec/dummy/config/environments/test.rb new file mode 100644 index 0000000..486b3a5 --- /dev/null +++ b/spec/dummy/config/environments/test.rb @@ -0,0 +1,40 @@ +Dummy::Application.configure do + # Settings specified here will take precedence over those in config/application.rb + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Configure static asset server for tests with Cache-Control for performance + config.public_file_server.enabled = true + config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' } + + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + config.eager_load = false + + # Raise exceptions instead of rendering exception templates + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + ActionMailer::Base.default from: "spree@example.com" + # Store uploaded files on the local file system in a temporary directory + config.active_storage.service = :test + + # Print deprecation notices to the stderr + config.active_support.deprecation = :stderr + + config.active_job.queue_adapter = :test + + config.cache_store = :redis_cache_store +end diff --git a/spec/dummy/config/initializers/assets.rb b/spec/dummy/config/initializers/assets.rb new file mode 100644 index 0000000..2eeef96 --- /dev/null +++ b/spec/dummy/config/initializers/assets.rb @@ -0,0 +1,12 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = "1.0" + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/spec/dummy/config/initializers/content_security_policy.rb b/spec/dummy/config/initializers/content_security_policy.rb new file mode 100644 index 0000000..3621f97 --- /dev/null +++ b/spec/dummy/config/initializers/content_security_policy.rb @@ -0,0 +1,26 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy +# For further information see the following documentation +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy + +# Rails.application.configure do +# config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end +# +# # Generate session nonces for permitted importmap and inline scripts +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_directives = %w(script-src) +# +# # Report CSP violations to a specified URI. See: +# # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only +# # config.content_security_policy_report_only = true +# end diff --git a/spec/dummy/config/initializers/devise.rb b/spec/dummy/config/initializers/devise.rb new file mode 100644 index 0000000..853a21c --- /dev/null +++ b/spec/dummy/config/initializers/devise.rb @@ -0,0 +1,3 @@ +if Object.const_defined?("Devise") + Devise.secret_key = "c471d7fda8676c12930b29754062258b8924ef972cff8fff746105d4cb9b1d490b1b75be0821109bedc3d7e626008dfa17e3" +end \ No newline at end of file diff --git a/spec/dummy/config/initializers/filter_parameter_logging.rb b/spec/dummy/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..adc6568 --- /dev/null +++ b/spec/dummy/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# Configure parameters to be filtered from the log file. Use this to limit dissemination of +# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported +# notations and behaviors. +Rails.application.config.filter_parameters += [ + :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +] diff --git a/spec/dummy/config/initializers/inflections.rb b/spec/dummy/config/initializers/inflections.rb new file mode 100644 index 0000000..3860f65 --- /dev/null +++ b/spec/dummy/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym "RESTful" +# end diff --git a/spec/dummy/config/initializers/permissions_policy.rb b/spec/dummy/config/initializers/permissions_policy.rb new file mode 100644 index 0000000..00f64d7 --- /dev/null +++ b/spec/dummy/config/initializers/permissions_policy.rb @@ -0,0 +1,11 @@ +# Define an application-wide HTTP permissions policy. For further +# information see https://developers.google.com/web/updates/2018/06/feature-policy +# +# Rails.application.config.permissions_policy do |f| +# f.camera :none +# f.gyroscope :none +# f.microphone :none +# f.usb :none +# f.fullscreen :self +# f.payment :self, "https://secure.example.com" +# end diff --git a/spec/dummy/config/initializers/spree.rb b/spec/dummy/config/initializers/spree.rb new file mode 100644 index 0000000..dce1205 --- /dev/null +++ b/spec/dummy/config/initializers/spree.rb @@ -0,0 +1,31 @@ +# Configure Spree Preferences +# +# Note: Initializing preferences available within the Admin will overwrite any changes that were made through the user interface when you restart. +# If you would like users to be able to update a setting with the Admin it should NOT be set here. +# +# Note: If a preference is set here it will be stored within the cache & database upon initialization. +# Just removing an entry from this initializer will not make the preference value go away. +# Instead you must either set a new value or remove entry, clear cache, and remove database entry. +# +# In order to initialize a setting do: +# config.setting_name = 'new value' +Spree.config do |config| + # Example: + # Uncomment to stop tracking inventory levels in the application + # config.track_inventory_levels = false +end + +# Configure Spree Dependencies +# +# Note: If a dependency is set here it will NOT be stored within the cache & database upon initialization. +# Just removing an entry from this initializer will make the dependency value go away. +# +Spree.dependencies do |dependencies| + # Example: + # Uncomment to change the default Service handling adding Items to Cart + # dependencies.cart_add_item_service = 'MyNewAwesomeService' +end + +# Spree::Api::Dependencies.storefront_cart_serializer = 'MyRailsApp::CartSerializer' + +Spree.user_class = "Spree::User" diff --git a/spec/dummy/config/locales/en.yml b/spec/dummy/config/locales/en.yml new file mode 100644 index 0000000..8ca56fc --- /dev/null +++ b/spec/dummy/config/locales/en.yml @@ -0,0 +1,33 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t "hello" +# +# In views, this is aliased to just `t`: +# +# <%= t("hello") %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# The following keys must be escaped otherwise they will not be retrieved by +# the default I18n backend: +# +# true, false, on, off, yes, no +# +# Instead, surround them with single quotes. +# +# en: +# "true": "foo" +# +# To learn more, please read the Rails Internationalization guide +# available at https://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/spec/dummy/config/master.key b/spec/dummy/config/master.key new file mode 100644 index 0000000..bd790f0 --- /dev/null +++ b/spec/dummy/config/master.key @@ -0,0 +1 @@ +aa6d52c2bf0325b35b9990873c9d3169 \ No newline at end of file diff --git a/spec/dummy/config/puma.rb b/spec/dummy/config/puma.rb new file mode 100644 index 0000000..daaf036 --- /dev/null +++ b/spec/dummy/config/puma.rb @@ -0,0 +1,43 @@ +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers: a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum; this matches the default thread size of Active Record. +# +max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } +threads min_threads_count, max_threads_count + +# Specifies the `worker_timeout` threshold that Puma will use to wait before +# terminating a worker in development environments. +# +worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +# +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +# +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the `pidfile` that Puma will use. +pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } + +# Specifies the number of `workers` to boot in clustered mode. +# Workers are forked web server processes. If using threads and workers together +# the concurrency of the application would be max `threads` * `workers`. +# Workers do not work on JRuby or Windows (both of which do not support +# processes). +# +# workers ENV.fetch("WEB_CONCURRENCY") { 2 } + +# Use the `preload_app!` method when specifying a `workers` number. +# This directive tells Puma to first boot the application and load code +# before forking the application. This takes advantage of Copy On Write +# process behavior so workers use less memory. +# +# preload_app! + +# Allow puma to be restarted by `bin/rails restart` command. +plugin :tmp_restart diff --git a/spec/dummy/config/routes.rb b/spec/dummy/config/routes.rb new file mode 100644 index 0000000..d0de0b3 --- /dev/null +++ b/spec/dummy/config/routes.rb @@ -0,0 +1,11 @@ +Rails.application.routes.draw do + # This line mounts Spree's routes at the root of your application. + # This means, any requests to URLs such as /products, will go to + # Spree::ProductsController. + # If you would like to change where this engine is mounted, simply change the + # :at option to something different. + # + # We ask that you don't use the :as option here, as Spree relies on it being + # the default of "spree". + mount Spree::Core::Engine, at: '/' +end diff --git a/spec/dummy/config/storage.yml b/spec/dummy/config/storage.yml new file mode 100644 index 0000000..4942ab6 --- /dev/null +++ b/spec/dummy/config/storage.yml @@ -0,0 +1,34 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) +# amazon: +# service: S3 +# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> +# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> +# region: us-east-1 +# bucket: your_own_bucket-<%= Rails.env %> + +# Remember not to checkin your GCS keyfile to a repository +# google: +# service: GCS +# project: your_project +# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> +# bucket: your_own_bucket-<%= Rails.env %> + +# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) +# microsoft: +# service: AzureStorage +# storage_account_name: your_account_name +# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> +# container: your_container_name-<%= Rails.env %> + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] diff --git a/spec/dummy/db/migrate/001_create_spree_dummy_models.rb b/spec/dummy/db/migrate/001_create_spree_dummy_models.rb new file mode 100644 index 0000000..98df831 --- /dev/null +++ b/spec/dummy/db/migrate/001_create_spree_dummy_models.rb @@ -0,0 +1,10 @@ +class CreateSpreeDummyModels < ActiveRecord::Migration[5.1] + def change + create_table :spree_dummy_models do |t| + t.string :name + t.integer :position + + t.timestamps + end + end +end diff --git a/spec/dummy/db/seeds.rb b/spec/dummy/db/seeds.rb new file mode 100644 index 0000000..72b132b --- /dev/null +++ b/spec/dummy/db/seeds.rb @@ -0,0 +1,10 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). +# +# Examples: +# +# movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }]) +# Character.create(name: "Luke", movie: movies.first) + +Spree::Core::Engine.load_seed if defined?(Spree::Core) +Spree::Auth::Engine.load_seed if defined?(Spree::Auth) diff --git a/spec/dummy/lib/assets/.keep b/spec/dummy/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/log/.keep b/spec/dummy/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/log/test.log b/spec/dummy/log/test.log new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/public/404.html b/spec/dummy/public/404.html new file mode 100644 index 0000000..2be3af2 --- /dev/null +++ b/spec/dummy/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
+
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/spec/dummy/public/422.html b/spec/dummy/public/422.html new file mode 100644 index 0000000..c08eac0 --- /dev/null +++ b/spec/dummy/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
+
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/spec/dummy/public/500.html b/spec/dummy/public/500.html new file mode 100644 index 0000000..78a030a --- /dev/null +++ b/spec/dummy/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
+
+

We're sorry, but something went wrong.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/spec/dummy/public/apple-touch-icon-precomposed.png b/spec/dummy/public/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/public/apple-touch-icon.png b/spec/dummy/public/apple-touch-icon.png new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/public/favicon.ico b/spec/dummy/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/storage/.keep b/spec/dummy/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spree_admin_roles_and_access.gemspec b/spree_admin_roles_and_access.gemspec index 38f8a0c..529323d 100644 --- a/spree_admin_roles_and_access.gemspec +++ b/spree_admin_roles_and_access.gemspec @@ -1,13 +1,14 @@ -# encoding: UTF-8 +# frozen_string_literal: true + Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = 'spree_admin_roles_and_access' s.version = '3-0-stable' s.summary = 'Dynamically defines roles and grants it permissions' - s.required_ruby_version = '>= 2.2.0' + s.required_ruby_version = '>= 2.7.2' s.files = Dir['LICENSE', 'README.md', 'app/**/*', 'config/**/*', 'lib/**/*', 'db/**/*'] - s.author = ["Nishant 'CyRo' Tuteja", "Akhil Bansal", "Nimish Mehta"] + s.author = ["Nishant 'CyRo' Tuteja", 'Akhil Bansal', 'Nimish Mehta'] s.email = 'info@vinsol.com' s.homepage = 'http://vinsol.com' @@ -16,28 +17,36 @@ Gem::Specification.new do |s| spree_version = '>= 3.7.0', '< 5.0.0' - s.add_dependency 'spree_core', spree_version s.add_dependency 'spree_auth_devise' + s.add_dependency 'spree_core', spree_version - s.add_development_dependency 'spree', spree_version - s.add_development_dependency 'spree_auth_devise' + s.add_development_dependency 'appraisal' + s.add_development_dependency 'brakeman' + s.add_development_dependency 'bundler-audit' + s.add_development_dependency 'byebug' s.add_development_dependency 'capybara' - s.add_development_dependency 'ffaker' - s.add_development_dependency 'rspec-rails', '~> 3.5.0' - s.add_development_dependency 'shoulda-matchers', '~> 3.1' - s.add_development_dependency 'rspec-activemodel-mocks' - s.add_development_dependency 'rails-controller-testing' - s.add_development_dependency 'sqlite3' - s.add_development_dependency 'factory_girl_rails' + s.add_development_dependency 'coffee-rails' s.add_development_dependency 'database_cleaner' + s.add_development_dependency 'factory_girl_rails' + s.add_development_dependency 'ffaker' s.add_development_dependency 'launchy' + s.add_development_dependency 'poltergeist' s.add_development_dependency 'pry' + s.add_development_dependency 'pg' + s.add_development_dependency 'rails-controller-testing' + s.add_development_dependency 'redis' + s.add_development_dependency 'rspec-activemodel-mocks' + s.add_development_dependency 'rspec-rails', '~> 3.5.0' + s.add_development_dependency 'rubocop' + s.add_development_dependency 'rubocop-rspec' s.add_development_dependency 'sass-rails' - s.add_development_dependency 'coffee-rails' - s.add_development_dependency 'poltergeist' s.add_development_dependency 'selenium-webdriver' - s.add_development_dependency 'simplecov' - s.add_development_dependency 'byebug' - s.add_development_dependency 'appraisal' - + s.add_development_dependency 'semaphore_test_boosters' + s.add_development_dependency 'shoulda-matchers', '~> 3.1' + s.add_development_dependency 'simplecov', '0.21.2' + s.add_development_dependency 'simplecov-cobertura' + s.add_development_dependency 'spree', spree_version + s.add_development_dependency 'spree_auth_devise' + s.add_development_dependency 'sqlite3' + s.metadata['rubygems_mfa_required'] = 'true' end From e4a05ff49baf27a1e3cdd3bc4871d5d936cdc0ad Mon Sep 17 00:00:00 2001 From: Jose C Fernandez Date: Fri, 15 Apr 2022 11:55:00 -0400 Subject: [PATCH 4/7] Delete dummy --- spec/dummy/README.md | 24 ----- spec/dummy/Rakefile | 6 -- spec/dummy/app/assets/config/manifest.js | 2 - spec/dummy/app/assets/images/.keep | 0 .../app/assets/stylesheets/application.css | 15 --- .../app/channels/application_cable/channel.rb | 4 - .../channels/application_cable/connection.rb | 4 - .../app/controllers/application_controller.rb | 2 - spec/dummy/app/controllers/concerns/.keep | 0 spec/dummy/app/helpers/application_helper.rb | 2 - spec/dummy/app/jobs/application_job.rb | 7 -- spec/dummy/app/mailers/application_mailer.rb | 4 - spec/dummy/app/models/application_record.rb | 3 - spec/dummy/app/models/concerns/.keep | 0 spec/dummy/app/models/spree/dummy_model.rb | 6 -- .../app/views/layouts/application.html.erb | 15 --- spec/dummy/app/views/layouts/mailer.html.erb | 13 --- spec/dummy/app/views/layouts/mailer.text.erb | 1 - spec/dummy/bin/rails | 4 - spec/dummy/bin/rake | 4 - spec/dummy/bin/setup | 33 ------- spec/dummy/config.ru | 6 -- spec/dummy/config/application.rb | 45 --------- spec/dummy/config/boot.rb | 6 -- spec/dummy/config/cable.yml | 10 -- spec/dummy/config/credentials.yml.enc | 1 - spec/dummy/config/database.yml | 23 ----- spec/dummy/config/environment.rb | 5 - spec/dummy/config/environments/development.rb | 70 -------------- spec/dummy/config/environments/production.rb | 93 ------------------- spec/dummy/config/environments/test.rb | 40 -------- spec/dummy/config/initializers/assets.rb | 12 --- .../initializers/content_security_policy.rb | 26 ------ spec/dummy/config/initializers/devise.rb | 3 - .../initializers/filter_parameter_logging.rb | 8 -- spec/dummy/config/initializers/inflections.rb | 16 ---- .../config/initializers/permissions_policy.rb | 11 --- spec/dummy/config/initializers/spree.rb | 31 ------- spec/dummy/config/locales/en.yml | 33 ------- spec/dummy/config/master.key | 1 - spec/dummy/config/puma.rb | 43 --------- spec/dummy/config/routes.rb | 11 --- spec/dummy/config/storage.yml | 34 ------- .../migrate/001_create_spree_dummy_models.rb | 10 -- spec/dummy/db/seeds.rb | 10 -- spec/dummy/lib/assets/.keep | 0 spec/dummy/log/.keep | 0 spec/dummy/log/test.log | 0 spec/dummy/public/404.html | 67 ------------- spec/dummy/public/422.html | 67 ------------- spec/dummy/public/500.html | 66 ------------- .../public/apple-touch-icon-precomposed.png | 0 spec/dummy/public/apple-touch-icon.png | 0 spec/dummy/public/favicon.ico | 0 spec/dummy/storage/.keep | 0 55 files changed, 897 deletions(-) delete mode 100644 spec/dummy/README.md delete mode 100644 spec/dummy/Rakefile delete mode 100644 spec/dummy/app/assets/config/manifest.js delete mode 100644 spec/dummy/app/assets/images/.keep delete mode 100644 spec/dummy/app/assets/stylesheets/application.css delete mode 100644 spec/dummy/app/channels/application_cable/channel.rb delete mode 100644 spec/dummy/app/channels/application_cable/connection.rb delete mode 100644 spec/dummy/app/controllers/application_controller.rb delete mode 100644 spec/dummy/app/controllers/concerns/.keep delete mode 100644 spec/dummy/app/helpers/application_helper.rb delete mode 100644 spec/dummy/app/jobs/application_job.rb delete mode 100644 spec/dummy/app/mailers/application_mailer.rb delete mode 100644 spec/dummy/app/models/application_record.rb delete mode 100644 spec/dummy/app/models/concerns/.keep delete mode 100644 spec/dummy/app/models/spree/dummy_model.rb delete mode 100644 spec/dummy/app/views/layouts/application.html.erb delete mode 100644 spec/dummy/app/views/layouts/mailer.html.erb delete mode 100644 spec/dummy/app/views/layouts/mailer.text.erb delete mode 100755 spec/dummy/bin/rails delete mode 100755 spec/dummy/bin/rake delete mode 100755 spec/dummy/bin/setup delete mode 100644 spec/dummy/config.ru delete mode 100644 spec/dummy/config/application.rb delete mode 100644 spec/dummy/config/boot.rb delete mode 100644 spec/dummy/config/cable.yml delete mode 100644 spec/dummy/config/credentials.yml.enc delete mode 100644 spec/dummy/config/database.yml delete mode 100644 spec/dummy/config/environment.rb delete mode 100644 spec/dummy/config/environments/development.rb delete mode 100644 spec/dummy/config/environments/production.rb delete mode 100644 spec/dummy/config/environments/test.rb delete mode 100644 spec/dummy/config/initializers/assets.rb delete mode 100644 spec/dummy/config/initializers/content_security_policy.rb delete mode 100644 spec/dummy/config/initializers/devise.rb delete mode 100644 spec/dummy/config/initializers/filter_parameter_logging.rb delete mode 100644 spec/dummy/config/initializers/inflections.rb delete mode 100644 spec/dummy/config/initializers/permissions_policy.rb delete mode 100644 spec/dummy/config/initializers/spree.rb delete mode 100644 spec/dummy/config/locales/en.yml delete mode 100644 spec/dummy/config/master.key delete mode 100644 spec/dummy/config/puma.rb delete mode 100644 spec/dummy/config/routes.rb delete mode 100644 spec/dummy/config/storage.yml delete mode 100644 spec/dummy/db/migrate/001_create_spree_dummy_models.rb delete mode 100644 spec/dummy/db/seeds.rb delete mode 100644 spec/dummy/lib/assets/.keep delete mode 100644 spec/dummy/log/.keep delete mode 100644 spec/dummy/log/test.log delete mode 100644 spec/dummy/public/404.html delete mode 100644 spec/dummy/public/422.html delete mode 100644 spec/dummy/public/500.html delete mode 100644 spec/dummy/public/apple-touch-icon-precomposed.png delete mode 100644 spec/dummy/public/apple-touch-icon.png delete mode 100644 spec/dummy/public/favicon.ico delete mode 100644 spec/dummy/storage/.keep diff --git a/spec/dummy/README.md b/spec/dummy/README.md deleted file mode 100644 index 7db80e4..0000000 --- a/spec/dummy/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# README - -This README would normally document whatever steps are necessary to get the -application up and running. - -Things you may want to cover: - -* Ruby version - -* System dependencies - -* Configuration - -* Database creation - -* Database initialization - -* How to run the test suite - -* Services (job queues, cache servers, search engines, etc.) - -* Deployment instructions - -* ... diff --git a/spec/dummy/Rakefile b/spec/dummy/Rakefile deleted file mode 100644 index 9a5ea73..0000000 --- a/spec/dummy/Rakefile +++ /dev/null @@ -1,6 +0,0 @@ -# Add your own tasks in files placed in lib/tasks ending in .rake, -# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. - -require_relative "config/application" - -Rails.application.load_tasks diff --git a/spec/dummy/app/assets/config/manifest.js b/spec/dummy/app/assets/config/manifest.js deleted file mode 100644 index 5918193..0000000 --- a/spec/dummy/app/assets/config/manifest.js +++ /dev/null @@ -1,2 +0,0 @@ -//= link_tree ../images -//= link_directory ../stylesheets .css diff --git a/spec/dummy/app/assets/images/.keep b/spec/dummy/app/assets/images/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/app/assets/stylesheets/application.css b/spec/dummy/app/assets/stylesheets/application.css deleted file mode 100644 index 288b9ab..0000000 --- a/spec/dummy/app/assets/stylesheets/application.css +++ /dev/null @@ -1,15 +0,0 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's - * vendor/assets/stylesheets directory can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the bottom of the - * compiled file so the styles you add here take precedence over styles defined in any other CSS - * files in this directory. Styles in this file should be added after the last require_* statement. - * It is generally better to create a new file per style scope. - * - *= require_tree . - *= require_self - */ diff --git a/spec/dummy/app/channels/application_cable/channel.rb b/spec/dummy/app/channels/application_cable/channel.rb deleted file mode 100644 index d672697..0000000 --- a/spec/dummy/app/channels/application_cable/channel.rb +++ /dev/null @@ -1,4 +0,0 @@ -module ApplicationCable - class Channel < ActionCable::Channel::Base - end -end diff --git a/spec/dummy/app/channels/application_cable/connection.rb b/spec/dummy/app/channels/application_cable/connection.rb deleted file mode 100644 index 0ff5442..0000000 --- a/spec/dummy/app/channels/application_cable/connection.rb +++ /dev/null @@ -1,4 +0,0 @@ -module ApplicationCable - class Connection < ActionCable::Connection::Base - end -end diff --git a/spec/dummy/app/controllers/application_controller.rb b/spec/dummy/app/controllers/application_controller.rb deleted file mode 100644 index 09705d1..0000000 --- a/spec/dummy/app/controllers/application_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class ApplicationController < ActionController::Base -end diff --git a/spec/dummy/app/controllers/concerns/.keep b/spec/dummy/app/controllers/concerns/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/app/helpers/application_helper.rb b/spec/dummy/app/helpers/application_helper.rb deleted file mode 100644 index de6be79..0000000 --- a/spec/dummy/app/helpers/application_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module ApplicationHelper -end diff --git a/spec/dummy/app/jobs/application_job.rb b/spec/dummy/app/jobs/application_job.rb deleted file mode 100644 index d394c3d..0000000 --- a/spec/dummy/app/jobs/application_job.rb +++ /dev/null @@ -1,7 +0,0 @@ -class ApplicationJob < ActiveJob::Base - # Automatically retry jobs that encountered a deadlock - # retry_on ActiveRecord::Deadlocked - - # Most jobs are safe to ignore if the underlying records are no longer available - # discard_on ActiveJob::DeserializationError -end diff --git a/spec/dummy/app/mailers/application_mailer.rb b/spec/dummy/app/mailers/application_mailer.rb deleted file mode 100644 index 3c34c81..0000000 --- a/spec/dummy/app/mailers/application_mailer.rb +++ /dev/null @@ -1,4 +0,0 @@ -class ApplicationMailer < ActionMailer::Base - default from: "from@example.com" - layout "mailer" -end diff --git a/spec/dummy/app/models/application_record.rb b/spec/dummy/app/models/application_record.rb deleted file mode 100644 index b63caeb..0000000 --- a/spec/dummy/app/models/application_record.rb +++ /dev/null @@ -1,3 +0,0 @@ -class ApplicationRecord < ActiveRecord::Base - primary_abstract_class -end diff --git a/spec/dummy/app/models/concerns/.keep b/spec/dummy/app/models/concerns/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/app/models/spree/dummy_model.rb b/spec/dummy/app/models/spree/dummy_model.rb deleted file mode 100644 index 099ad2c..0000000 --- a/spec/dummy/app/models/spree/dummy_model.rb +++ /dev/null @@ -1,6 +0,0 @@ -module Spree - class DummyModel < Spree::Base - acts_as_list - validates :name, presence: true - end -end diff --git a/spec/dummy/app/views/layouts/application.html.erb b/spec/dummy/app/views/layouts/application.html.erb deleted file mode 100644 index f72b4ef..0000000 --- a/spec/dummy/app/views/layouts/application.html.erb +++ /dev/null @@ -1,15 +0,0 @@ - - - - Dummy - - <%= csrf_meta_tags %> - <%= csp_meta_tag %> - - <%= stylesheet_link_tag "application" %> - - - - <%= yield %> - - diff --git a/spec/dummy/app/views/layouts/mailer.html.erb b/spec/dummy/app/views/layouts/mailer.html.erb deleted file mode 100644 index cbd34d2..0000000 --- a/spec/dummy/app/views/layouts/mailer.html.erb +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - <%= yield %> - - diff --git a/spec/dummy/app/views/layouts/mailer.text.erb b/spec/dummy/app/views/layouts/mailer.text.erb deleted file mode 100644 index 37f0bdd..0000000 --- a/spec/dummy/app/views/layouts/mailer.text.erb +++ /dev/null @@ -1 +0,0 @@ -<%= yield %> diff --git a/spec/dummy/bin/rails b/spec/dummy/bin/rails deleted file mode 100755 index efc0377..0000000 --- a/spec/dummy/bin/rails +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -APP_PATH = File.expand_path("../config/application", __dir__) -require_relative "../config/boot" -require "rails/commands" diff --git a/spec/dummy/bin/rake b/spec/dummy/bin/rake deleted file mode 100755 index 4fbf10b..0000000 --- a/spec/dummy/bin/rake +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -require_relative "../config/boot" -require "rake" -Rake.application.run diff --git a/spec/dummy/bin/setup b/spec/dummy/bin/setup deleted file mode 100755 index ec47b79..0000000 --- a/spec/dummy/bin/setup +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env ruby -require "fileutils" - -# path to your application root. -APP_ROOT = File.expand_path("..", __dir__) - -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") -end - -FileUtils.chdir APP_ROOT do - # This script is a way to set up or update your development environment automatically. - # This script is idempotent, so that you can run it at any time and get an expectable outcome. - # Add necessary setup steps to this file. - - puts "== Installing dependencies ==" - system! "gem install bundler --conservative" - system("bundle check") || system!("bundle install") - - # puts "\n== Copying sample files ==" - # unless File.exist?("config/database.yml") - # FileUtils.cp "config/database.yml.sample", "config/database.yml" - # end - - puts "\n== Preparing database ==" - system! "bin/rails db:prepare" - - puts "\n== Removing old logs and tempfiles ==" - system! "bin/rails log:clear tmp:clear" - - puts "\n== Restarting application server ==" - system! "bin/rails restart" -end diff --git a/spec/dummy/config.ru b/spec/dummy/config.ru deleted file mode 100644 index 4a3c09a..0000000 --- a/spec/dummy/config.ru +++ /dev/null @@ -1,6 +0,0 @@ -# This file is used by Rack-based servers to start the application. - -require_relative "config/environment" - -run Rails.application -Rails.application.load_server diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb deleted file mode 100644 index 0a2cacb..0000000 --- a/spec/dummy/config/application.rb +++ /dev/null @@ -1,45 +0,0 @@ -require File.expand_path('../boot', __FILE__) - -require 'rails/all' - -Bundler.require(*Rails.groups(assets: %w(development test))) - - -begin - require 'spree_api' -rescue LoadError - # spree_api is not available. -end - require 'spree_admin_roles_and_access' - -module Dummy - class Application < Rails::Application - - config.to_prepare do - # Load application's model / class decorators - Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c| - Rails.configuration.cache_classes ? require(c) : load(c) - end - - # Load application's view overrides - Dir.glob(File.join(File.dirname(__FILE__), "../app/overrides/*.rb")) do |c| - Rails.configuration.cache_classes ? require(c) : load(c) - end - end - # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.0 - - # Configuration for the application, engines, and railties goes here. - # - # These settings can be overridden in specific environments using the files - # in config/environments, which are processed later. - # - # config.time_zone = "Central Time (US & Canada)" - # config.eager_load_paths << Rails.root.join("extras") - - # Don't generate system test files. - config.generators.system_tests = nil - end -end - - diff --git a/spec/dummy/config/boot.rb b/spec/dummy/config/boot.rb deleted file mode 100644 index 074f555..0000000 --- a/spec/dummy/config/boot.rb +++ /dev/null @@ -1,6 +0,0 @@ -require 'rubygems' -gemfile = File.expand_path("../../../../Gemfile", __FILE__) - -ENV['BUNDLE_GEMFILE'] = gemfile -require 'bundler' -Bundler.setup diff --git a/spec/dummy/config/cable.yml b/spec/dummy/config/cable.yml deleted file mode 100644 index 98367f8..0000000 --- a/spec/dummy/config/cable.yml +++ /dev/null @@ -1,10 +0,0 @@ -development: - adapter: async - -test: - adapter: test - -production: - adapter: redis - url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> - channel_prefix: dummy_production diff --git a/spec/dummy/config/credentials.yml.enc b/spec/dummy/config/credentials.yml.enc deleted file mode 100644 index 98c0340..0000000 --- a/spec/dummy/config/credentials.yml.enc +++ /dev/null @@ -1 +0,0 @@ -XKzJWmaE0x0Q65cRkOZeYMcDgM8jPtkSFdeRNze0DVjhTn+QLYDfW4KJB/yLXc8krihrij8cSoniWYSeCZK4c98YVoLNPaWfe3LjnP6Td8fZ9vpNhIVqasJo1pmWvBh8PtQ4RI4q1hI6AdFs8qtCX/ZYpZ6VgYo76mcrhuw4iRrMo+xt5pCKxnh4OKO00aLXqiJmxlJzrd1N0EDQ+MPqTqUWSc6CVDHn8Txq0UJtU0MYgeB6EfxTQkERBjmgJ0RuUUrrnycadPPkppQai2lybEu6CvRUq+aEYBzvDErM808LpeekjNADYYSV5ghoXJrjZwyyjtmCqiEO148+mPrGIt9dZ0I6je8av0dCR/ofTZfziCCK3S1s4xmpiIGzkClWFV7u1RxPqzJGqoVzJsga+ngbosQAXE1dn/1L--c11RvYeKpQDhrfwY--A1i3KcVw4M7PmTgZ9nGnrA== \ No newline at end of file diff --git a/spec/dummy/config/database.yml b/spec/dummy/config/database.yml deleted file mode 100644 index 4361cb5..0000000 --- a/spec/dummy/config/database.yml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - -postgres: &postgres - adapter: postgresql - - - - min_messages: warning - -development: - <<: *postgres - database: spree_admin_roles_and_access_spree_development -test: - <<: *postgres - database: spree_admin_roles_and_access_spree_test -production: - <<: *postgres - database: spree_admin_roles_and_access_spree_production - diff --git a/spec/dummy/config/environment.rb b/spec/dummy/config/environment.rb deleted file mode 100644 index cac5315..0000000 --- a/spec/dummy/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the Rails application. -require_relative "application" - -# Initialize the Rails application. -Rails.application.initialize! diff --git a/spec/dummy/config/environments/development.rb b/spec/dummy/config/environments/development.rb deleted file mode 100644 index 8500f45..0000000 --- a/spec/dummy/config/environments/development.rb +++ /dev/null @@ -1,70 +0,0 @@ -require "active_support/core_ext/integer/time" - -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # In the development environment your application's code is reloaded any time - # it changes. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. - config.cache_classes = false - - # Do not eager load code on boot. - config.eager_load = false - - # Show full error reports. - config.consider_all_requests_local = true - - # Enable server timing - config.server_timing = true - - # Enable/disable caching. By default caching is disabled. - # Run rails dev:cache to toggle caching. - if Rails.root.join("tmp/caching-dev.txt").exist? - config.action_controller.perform_caching = true - config.action_controller.enable_fragment_cache_logging = true - - config.cache_store = :memory_store - config.public_file_server.headers = { - "Cache-Control" => "public, max-age=#{2.days.to_i}" - } - else - config.action_controller.perform_caching = false - - config.cache_store = :null_store - end - - # Store uploaded files on the local file system (see config/storage.yml for options). - config.active_storage.service = :local - - # Don't care if the mailer can't send. - config.action_mailer.raise_delivery_errors = false - - config.action_mailer.perform_caching = false - - # Print deprecation notices to the Rails logger. - config.active_support.deprecation = :log - - # Raise exceptions for disallowed deprecations. - config.active_support.disallowed_deprecation = :raise - - # Tell Active Support which deprecation messages to disallow. - config.active_support.disallowed_deprecation_warnings = [] - - # Raise an error on page load if there are pending migrations. - config.active_record.migration_error = :page_load - - # Highlight code that triggered database queries in logs. - config.active_record.verbose_query_logs = true - - # Suppress logger output for asset requests. - config.assets.quiet = true - - # Raises error for missing translations. - # config.i18n.raise_on_missing_translations = true - - # Annotate rendered view with file names. - # config.action_view.annotate_rendered_view_with_filenames = true - - # Uncomment if you wish to allow Action Cable access from any origin. - # config.action_cable.disable_request_forgery_protection = true -end diff --git a/spec/dummy/config/environments/production.rb b/spec/dummy/config/environments/production.rb deleted file mode 100644 index 8e989b5..0000000 --- a/spec/dummy/config/environments/production.rb +++ /dev/null @@ -1,93 +0,0 @@ -require "active_support/core_ext/integer/time" - -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # Code is not reloaded between requests. - config.cache_classes = true - - # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both threaded web servers - # and those relying on copy on write to perform better. - # Rake tasks automatically ignore this option for performance. - config.eager_load = true - - # Full error reports are disabled and caching is turned on. - config.consider_all_requests_local = false - config.action_controller.perform_caching = true - - # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] - # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). - # config.require_master_key = true - - # Disable serving static files from the `/public` folder by default since - # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? - - # Compress CSS using a preprocessor. - # config.assets.css_compressor = :sass - - # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false - - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.asset_host = "http://assets.example.com" - - # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache - # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX - - # Store uploaded files on the local file system (see config/storage.yml for options). - config.active_storage.service = :local - - # Mount Action Cable outside main process or domain. - # config.action_cable.mount_path = nil - # config.action_cable.url = "wss://example.com/cable" - # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true - - # Include generic and useful information about system operation, but avoid logging too much - # information to avoid inadvertent exposure of personally identifiable information (PII). - config.log_level = :info - - # Prepend all log lines with the following tags. - config.log_tags = [ :request_id ] - - # Use a different cache store in production. - # config.cache_store = :mem_cache_store - - # Use a real queuing backend for Active Job (and separate queues per environment). - # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "dummy_production" - - config.action_mailer.perform_caching = false - - # Ignore bad email addresses and do not raise email delivery errors. - # Set this to true and configure the email server for immediate delivery to raise delivery errors. - # config.action_mailer.raise_delivery_errors = false - - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation cannot be found). - config.i18n.fallbacks = true - - # Don't log any deprecations. - config.active_support.report_deprecations = false - - # Use default logging formatter so that PID and timestamp are not suppressed. - config.log_formatter = ::Logger::Formatter.new - - # Use a different logger for distributed setups. - # require "syslog/logger" - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") - - if ENV["RAILS_LOG_TO_STDOUT"].present? - logger = ActiveSupport::Logger.new(STDOUT) - logger.formatter = config.log_formatter - config.logger = ActiveSupport::TaggedLogging.new(logger) - end - - # Do not dump schema after migrations. - config.active_record.dump_schema_after_migration = false -end diff --git a/spec/dummy/config/environments/test.rb b/spec/dummy/config/environments/test.rb deleted file mode 100644 index 486b3a5..0000000 --- a/spec/dummy/config/environments/test.rb +++ /dev/null @@ -1,40 +0,0 @@ -Dummy::Application.configure do - # Settings specified here will take precedence over those in config/application.rb - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Configure static asset server for tests with Cache-Control for performance - config.public_file_server.enabled = true - config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' } - - # Show full error reports and disable caching - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - config.eager_load = false - - # Raise exceptions instead of rendering exception templates - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment - config.action_controller.allow_forgery_protection = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - ActionMailer::Base.default from: "spree@example.com" - # Store uploaded files on the local file system in a temporary directory - config.active_storage.service = :test - - # Print deprecation notices to the stderr - config.active_support.deprecation = :stderr - - config.active_job.queue_adapter = :test - - config.cache_store = :redis_cache_store -end diff --git a/spec/dummy/config/initializers/assets.rb b/spec/dummy/config/initializers/assets.rb deleted file mode 100644 index 2eeef96..0000000 --- a/spec/dummy/config/initializers/assets.rb +++ /dev/null @@ -1,12 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Version of your assets, change this if you want to expire all your assets. -Rails.application.config.assets.version = "1.0" - -# Add additional assets to the asset load path. -# Rails.application.config.assets.paths << Emoji.images_path - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in the app/assets -# folder are already added. -# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/spec/dummy/config/initializers/content_security_policy.rb b/spec/dummy/config/initializers/content_security_policy.rb deleted file mode 100644 index 3621f97..0000000 --- a/spec/dummy/config/initializers/content_security_policy.rb +++ /dev/null @@ -1,26 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Define an application-wide content security policy -# For further information see the following documentation -# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy - -# Rails.application.configure do -# config.content_security_policy do |policy| -# policy.default_src :self, :https -# policy.font_src :self, :https, :data -# policy.img_src :self, :https, :data -# policy.object_src :none -# policy.script_src :self, :https -# policy.style_src :self, :https -# # Specify URI for violation reports -# # policy.report_uri "/csp-violation-report-endpoint" -# end -# -# # Generate session nonces for permitted importmap and inline scripts -# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } -# config.content_security_policy_nonce_directives = %w(script-src) -# -# # Report CSP violations to a specified URI. See: -# # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only -# # config.content_security_policy_report_only = true -# end diff --git a/spec/dummy/config/initializers/devise.rb b/spec/dummy/config/initializers/devise.rb deleted file mode 100644 index 853a21c..0000000 --- a/spec/dummy/config/initializers/devise.rb +++ /dev/null @@ -1,3 +0,0 @@ -if Object.const_defined?("Devise") - Devise.secret_key = "c471d7fda8676c12930b29754062258b8924ef972cff8fff746105d4cb9b1d490b1b75be0821109bedc3d7e626008dfa17e3" -end \ No newline at end of file diff --git a/spec/dummy/config/initializers/filter_parameter_logging.rb b/spec/dummy/config/initializers/filter_parameter_logging.rb deleted file mode 100644 index adc6568..0000000 --- a/spec/dummy/config/initializers/filter_parameter_logging.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Configure parameters to be filtered from the log file. Use this to limit dissemination of -# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported -# notations and behaviors. -Rails.application.config.filter_parameters += [ - :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn -] diff --git a/spec/dummy/config/initializers/inflections.rb b/spec/dummy/config/initializers/inflections.rb deleted file mode 100644 index 3860f65..0000000 --- a/spec/dummy/config/initializers/inflections.rb +++ /dev/null @@ -1,16 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format. Inflections -# are locale specific, and you may define rules for as many different -# locales as you wish. All of these examples are active by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, "\\1en" -# inflect.singular /^(ox)en/i, "\\1" -# inflect.irregular "person", "people" -# inflect.uncountable %w( fish sheep ) -# end - -# These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym "RESTful" -# end diff --git a/spec/dummy/config/initializers/permissions_policy.rb b/spec/dummy/config/initializers/permissions_policy.rb deleted file mode 100644 index 00f64d7..0000000 --- a/spec/dummy/config/initializers/permissions_policy.rb +++ /dev/null @@ -1,11 +0,0 @@ -# Define an application-wide HTTP permissions policy. For further -# information see https://developers.google.com/web/updates/2018/06/feature-policy -# -# Rails.application.config.permissions_policy do |f| -# f.camera :none -# f.gyroscope :none -# f.microphone :none -# f.usb :none -# f.fullscreen :self -# f.payment :self, "https://secure.example.com" -# end diff --git a/spec/dummy/config/initializers/spree.rb b/spec/dummy/config/initializers/spree.rb deleted file mode 100644 index dce1205..0000000 --- a/spec/dummy/config/initializers/spree.rb +++ /dev/null @@ -1,31 +0,0 @@ -# Configure Spree Preferences -# -# Note: Initializing preferences available within the Admin will overwrite any changes that were made through the user interface when you restart. -# If you would like users to be able to update a setting with the Admin it should NOT be set here. -# -# Note: If a preference is set here it will be stored within the cache & database upon initialization. -# Just removing an entry from this initializer will not make the preference value go away. -# Instead you must either set a new value or remove entry, clear cache, and remove database entry. -# -# In order to initialize a setting do: -# config.setting_name = 'new value' -Spree.config do |config| - # Example: - # Uncomment to stop tracking inventory levels in the application - # config.track_inventory_levels = false -end - -# Configure Spree Dependencies -# -# Note: If a dependency is set here it will NOT be stored within the cache & database upon initialization. -# Just removing an entry from this initializer will make the dependency value go away. -# -Spree.dependencies do |dependencies| - # Example: - # Uncomment to change the default Service handling adding Items to Cart - # dependencies.cart_add_item_service = 'MyNewAwesomeService' -end - -# Spree::Api::Dependencies.storefront_cart_serializer = 'MyRailsApp::CartSerializer' - -Spree.user_class = "Spree::User" diff --git a/spec/dummy/config/locales/en.yml b/spec/dummy/config/locales/en.yml deleted file mode 100644 index 8ca56fc..0000000 --- a/spec/dummy/config/locales/en.yml +++ /dev/null @@ -1,33 +0,0 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t "hello" -# -# In views, this is aliased to just `t`: -# -# <%= t("hello") %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# The following keys must be escaped otherwise they will not be retrieved by -# the default I18n backend: -# -# true, false, on, off, yes, no -# -# Instead, surround them with single quotes. -# -# en: -# "true": "foo" -# -# To learn more, please read the Rails Internationalization guide -# available at https://guides.rubyonrails.org/i18n.html. - -en: - hello: "Hello world" diff --git a/spec/dummy/config/master.key b/spec/dummy/config/master.key deleted file mode 100644 index bd790f0..0000000 --- a/spec/dummy/config/master.key +++ /dev/null @@ -1 +0,0 @@ -aa6d52c2bf0325b35b9990873c9d3169 \ No newline at end of file diff --git a/spec/dummy/config/puma.rb b/spec/dummy/config/puma.rb deleted file mode 100644 index daaf036..0000000 --- a/spec/dummy/config/puma.rb +++ /dev/null @@ -1,43 +0,0 @@ -# Puma can serve each request in a thread from an internal thread pool. -# The `threads` method setting takes two numbers: a minimum and maximum. -# Any libraries that use thread pools should be configured to match -# the maximum value specified for Puma. Default is set to 5 threads for minimum -# and maximum; this matches the default thread size of Active Record. -# -max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } -min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } -threads min_threads_count, max_threads_count - -# Specifies the `worker_timeout` threshold that Puma will use to wait before -# terminating a worker in development environments. -# -worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" - -# Specifies the `port` that Puma will listen on to receive requests; default is 3000. -# -port ENV.fetch("PORT") { 3000 } - -# Specifies the `environment` that Puma will run in. -# -environment ENV.fetch("RAILS_ENV") { "development" } - -# Specifies the `pidfile` that Puma will use. -pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } - -# Specifies the number of `workers` to boot in clustered mode. -# Workers are forked web server processes. If using threads and workers together -# the concurrency of the application would be max `threads` * `workers`. -# Workers do not work on JRuby or Windows (both of which do not support -# processes). -# -# workers ENV.fetch("WEB_CONCURRENCY") { 2 } - -# Use the `preload_app!` method when specifying a `workers` number. -# This directive tells Puma to first boot the application and load code -# before forking the application. This takes advantage of Copy On Write -# process behavior so workers use less memory. -# -# preload_app! - -# Allow puma to be restarted by `bin/rails restart` command. -plugin :tmp_restart diff --git a/spec/dummy/config/routes.rb b/spec/dummy/config/routes.rb deleted file mode 100644 index d0de0b3..0000000 --- a/spec/dummy/config/routes.rb +++ /dev/null @@ -1,11 +0,0 @@ -Rails.application.routes.draw do - # This line mounts Spree's routes at the root of your application. - # This means, any requests to URLs such as /products, will go to - # Spree::ProductsController. - # If you would like to change where this engine is mounted, simply change the - # :at option to something different. - # - # We ask that you don't use the :as option here, as Spree relies on it being - # the default of "spree". - mount Spree::Core::Engine, at: '/' -end diff --git a/spec/dummy/config/storage.yml b/spec/dummy/config/storage.yml deleted file mode 100644 index 4942ab6..0000000 --- a/spec/dummy/config/storage.yml +++ /dev/null @@ -1,34 +0,0 @@ -test: - service: Disk - root: <%= Rails.root.join("tmp/storage") %> - -local: - service: Disk - root: <%= Rails.root.join("storage") %> - -# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) -# amazon: -# service: S3 -# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> -# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> -# region: us-east-1 -# bucket: your_own_bucket-<%= Rails.env %> - -# Remember not to checkin your GCS keyfile to a repository -# google: -# service: GCS -# project: your_project -# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> -# bucket: your_own_bucket-<%= Rails.env %> - -# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) -# microsoft: -# service: AzureStorage -# storage_account_name: your_account_name -# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> -# container: your_container_name-<%= Rails.env %> - -# mirror: -# service: Mirror -# primary: local -# mirrors: [ amazon, google, microsoft ] diff --git a/spec/dummy/db/migrate/001_create_spree_dummy_models.rb b/spec/dummy/db/migrate/001_create_spree_dummy_models.rb deleted file mode 100644 index 98df831..0000000 --- a/spec/dummy/db/migrate/001_create_spree_dummy_models.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateSpreeDummyModels < ActiveRecord::Migration[5.1] - def change - create_table :spree_dummy_models do |t| - t.string :name - t.integer :position - - t.timestamps - end - end -end diff --git a/spec/dummy/db/seeds.rb b/spec/dummy/db/seeds.rb deleted file mode 100644 index 72b132b..0000000 --- a/spec/dummy/db/seeds.rb +++ /dev/null @@ -1,10 +0,0 @@ -# This file should contain all the record creation needed to seed the database with its default values. -# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). -# -# Examples: -# -# movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }]) -# Character.create(name: "Luke", movie: movies.first) - -Spree::Core::Engine.load_seed if defined?(Spree::Core) -Spree::Auth::Engine.load_seed if defined?(Spree::Auth) diff --git a/spec/dummy/lib/assets/.keep b/spec/dummy/lib/assets/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/log/.keep b/spec/dummy/log/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/log/test.log b/spec/dummy/log/test.log deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/public/404.html b/spec/dummy/public/404.html deleted file mode 100644 index 2be3af2..0000000 --- a/spec/dummy/public/404.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - The page you were looking for doesn't exist (404) - - - - - - -
-
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
-

If you are the application owner check the logs for more information.

-
- - diff --git a/spec/dummy/public/422.html b/spec/dummy/public/422.html deleted file mode 100644 index c08eac0..0000000 --- a/spec/dummy/public/422.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - The change you wanted was rejected (422) - - - - - - -
-
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

-
-

If you are the application owner check the logs for more information.

-
- - diff --git a/spec/dummy/public/500.html b/spec/dummy/public/500.html deleted file mode 100644 index 78a030a..0000000 --- a/spec/dummy/public/500.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - We're sorry, but something went wrong (500) - - - - - - -
-
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

-
- - diff --git a/spec/dummy/public/apple-touch-icon-precomposed.png b/spec/dummy/public/apple-touch-icon-precomposed.png deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/public/apple-touch-icon.png b/spec/dummy/public/apple-touch-icon.png deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/public/favicon.ico b/spec/dummy/public/favicon.ico deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/storage/.keep b/spec/dummy/storage/.keep deleted file mode 100644 index e69de29..0000000 From 8a9cc5ae7a216f246139c452a294a02b0c925a0e Mon Sep 17 00:00:00 2001 From: Jose C Fernandez Date: Fri, 15 Apr 2022 13:22:20 -0400 Subject: [PATCH 5/7] Fix --- spec/dummy/README.md | 24 +++++ spec/dummy/Rakefile | 6 ++ spec/dummy/app/assets/config/manifest.js | 2 + spec/dummy/app/assets/images/.keep | 0 .../app/assets/stylesheets/application.css | 15 +++ .../app/channels/application_cable/channel.rb | 4 + .../channels/application_cable/connection.rb | 4 + .../app/controllers/application_controller.rb | 2 + spec/dummy/app/controllers/concerns/.keep | 0 spec/dummy/app/helpers/application_helper.rb | 2 + spec/dummy/app/jobs/application_job.rb | 7 ++ spec/dummy/app/mailers/application_mailer.rb | 4 + spec/dummy/app/models/application_record.rb | 3 + spec/dummy/app/models/concerns/.keep | 0 spec/dummy/app/models/spree/dummy_model.rb | 6 ++ .../app/views/layouts/application.html.erb | 15 +++ spec/dummy/app/views/layouts/mailer.html.erb | 13 +++ spec/dummy/app/views/layouts/mailer.text.erb | 1 + spec/dummy/bin/rails | 4 + spec/dummy/bin/rake | 4 + spec/dummy/bin/setup | 33 +++++++ spec/dummy/config.ru | 6 ++ spec/dummy/config/application.rb | 45 +++++++++ spec/dummy/config/boot.rb | 6 ++ spec/dummy/config/cable.yml | 10 ++ spec/dummy/config/credentials.yml.enc | 1 + spec/dummy/config/database.yml | 23 +++++ spec/dummy/config/environment.rb | 5 + spec/dummy/config/environments/development.rb | 70 ++++++++++++++ spec/dummy/config/environments/production.rb | 93 +++++++++++++++++++ spec/dummy/config/environments/test.rb | 40 ++++++++ spec/dummy/config/initializers/assets.rb | 12 +++ .../initializers/content_security_policy.rb | 26 ++++++ spec/dummy/config/initializers/devise.rb | 3 + .../initializers/filter_parameter_logging.rb | 8 ++ spec/dummy/config/initializers/inflections.rb | 16 ++++ .../config/initializers/permissions_policy.rb | 11 +++ spec/dummy/config/initializers/spree.rb | 31 +++++++ spec/dummy/config/locales/en.yml | 33 +++++++ spec/dummy/config/master.key | 1 + spec/dummy/config/puma.rb | 43 +++++++++ spec/dummy/config/routes.rb | 11 +++ spec/dummy/config/storage.yml | 34 +++++++ .../migrate/001_create_spree_dummy_models.rb | 10 ++ spec/dummy/db/seeds.rb | 10 ++ spec/dummy/lib/assets/.keep | 0 spec/dummy/log/.keep | 0 spec/dummy/log/test.log | 0 spec/dummy/public/404.html | 67 +++++++++++++ spec/dummy/public/422.html | 67 +++++++++++++ spec/dummy/public/500.html | 66 +++++++++++++ .../public/apple-touch-icon-precomposed.png | 0 spec/dummy/public/apple-touch-icon.png | 0 spec/dummy/public/favicon.ico | 0 spec/dummy/storage/.keep | 0 55 files changed, 897 insertions(+) create mode 100644 spec/dummy/README.md create mode 100644 spec/dummy/Rakefile create mode 100644 spec/dummy/app/assets/config/manifest.js create mode 100644 spec/dummy/app/assets/images/.keep create mode 100644 spec/dummy/app/assets/stylesheets/application.css create mode 100644 spec/dummy/app/channels/application_cable/channel.rb create mode 100644 spec/dummy/app/channels/application_cable/connection.rb create mode 100644 spec/dummy/app/controllers/application_controller.rb create mode 100644 spec/dummy/app/controllers/concerns/.keep create mode 100644 spec/dummy/app/helpers/application_helper.rb create mode 100644 spec/dummy/app/jobs/application_job.rb create mode 100644 spec/dummy/app/mailers/application_mailer.rb create mode 100644 spec/dummy/app/models/application_record.rb create mode 100644 spec/dummy/app/models/concerns/.keep create mode 100644 spec/dummy/app/models/spree/dummy_model.rb create mode 100644 spec/dummy/app/views/layouts/application.html.erb create mode 100644 spec/dummy/app/views/layouts/mailer.html.erb create mode 100644 spec/dummy/app/views/layouts/mailer.text.erb create mode 100755 spec/dummy/bin/rails create mode 100755 spec/dummy/bin/rake create mode 100755 spec/dummy/bin/setup create mode 100644 spec/dummy/config.ru create mode 100644 spec/dummy/config/application.rb create mode 100644 spec/dummy/config/boot.rb create mode 100644 spec/dummy/config/cable.yml create mode 100644 spec/dummy/config/credentials.yml.enc create mode 100644 spec/dummy/config/database.yml create mode 100644 spec/dummy/config/environment.rb create mode 100644 spec/dummy/config/environments/development.rb create mode 100644 spec/dummy/config/environments/production.rb create mode 100644 spec/dummy/config/environments/test.rb create mode 100644 spec/dummy/config/initializers/assets.rb create mode 100644 spec/dummy/config/initializers/content_security_policy.rb create mode 100644 spec/dummy/config/initializers/devise.rb create mode 100644 spec/dummy/config/initializers/filter_parameter_logging.rb create mode 100644 spec/dummy/config/initializers/inflections.rb create mode 100644 spec/dummy/config/initializers/permissions_policy.rb create mode 100644 spec/dummy/config/initializers/spree.rb create mode 100644 spec/dummy/config/locales/en.yml create mode 100644 spec/dummy/config/master.key create mode 100644 spec/dummy/config/puma.rb create mode 100644 spec/dummy/config/routes.rb create mode 100644 spec/dummy/config/storage.yml create mode 100644 spec/dummy/db/migrate/001_create_spree_dummy_models.rb create mode 100644 spec/dummy/db/seeds.rb create mode 100644 spec/dummy/lib/assets/.keep create mode 100644 spec/dummy/log/.keep create mode 100644 spec/dummy/log/test.log create mode 100644 spec/dummy/public/404.html create mode 100644 spec/dummy/public/422.html create mode 100644 spec/dummy/public/500.html create mode 100644 spec/dummy/public/apple-touch-icon-precomposed.png create mode 100644 spec/dummy/public/apple-touch-icon.png create mode 100644 spec/dummy/public/favicon.ico create mode 100644 spec/dummy/storage/.keep diff --git a/spec/dummy/README.md b/spec/dummy/README.md new file mode 100644 index 0000000..7db80e4 --- /dev/null +++ b/spec/dummy/README.md @@ -0,0 +1,24 @@ +# README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... diff --git a/spec/dummy/Rakefile b/spec/dummy/Rakefile new file mode 100644 index 0000000..9a5ea73 --- /dev/null +++ b/spec/dummy/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative "config/application" + +Rails.application.load_tasks diff --git a/spec/dummy/app/assets/config/manifest.js b/spec/dummy/app/assets/config/manifest.js new file mode 100644 index 0000000..5918193 --- /dev/null +++ b/spec/dummy/app/assets/config/manifest.js @@ -0,0 +1,2 @@ +//= link_tree ../images +//= link_directory ../stylesheets .css diff --git a/spec/dummy/app/assets/images/.keep b/spec/dummy/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/app/assets/stylesheets/application.css b/spec/dummy/app/assets/stylesheets/application.css new file mode 100644 index 0000000..288b9ab --- /dev/null +++ b/spec/dummy/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's + * vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/spec/dummy/app/channels/application_cable/channel.rb b/spec/dummy/app/channels/application_cable/channel.rb new file mode 100644 index 0000000..d672697 --- /dev/null +++ b/spec/dummy/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/spec/dummy/app/channels/application_cable/connection.rb b/spec/dummy/app/channels/application_cable/connection.rb new file mode 100644 index 0000000..0ff5442 --- /dev/null +++ b/spec/dummy/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/spec/dummy/app/controllers/application_controller.rb b/spec/dummy/app/controllers/application_controller.rb new file mode 100644 index 0000000..09705d1 --- /dev/null +++ b/spec/dummy/app/controllers/application_controller.rb @@ -0,0 +1,2 @@ +class ApplicationController < ActionController::Base +end diff --git a/spec/dummy/app/controllers/concerns/.keep b/spec/dummy/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/app/helpers/application_helper.rb b/spec/dummy/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/spec/dummy/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/spec/dummy/app/jobs/application_job.rb b/spec/dummy/app/jobs/application_job.rb new file mode 100644 index 0000000..d394c3d --- /dev/null +++ b/spec/dummy/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/spec/dummy/app/mailers/application_mailer.rb b/spec/dummy/app/mailers/application_mailer.rb new file mode 100644 index 0000000..3c34c81 --- /dev/null +++ b/spec/dummy/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: "from@example.com" + layout "mailer" +end diff --git a/spec/dummy/app/models/application_record.rb b/spec/dummy/app/models/application_record.rb new file mode 100644 index 0000000..b63caeb --- /dev/null +++ b/spec/dummy/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + primary_abstract_class +end diff --git a/spec/dummy/app/models/concerns/.keep b/spec/dummy/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/app/models/spree/dummy_model.rb b/spec/dummy/app/models/spree/dummy_model.rb new file mode 100644 index 0000000..099ad2c --- /dev/null +++ b/spec/dummy/app/models/spree/dummy_model.rb @@ -0,0 +1,6 @@ +module Spree + class DummyModel < Spree::Base + acts_as_list + validates :name, presence: true + end +end diff --git a/spec/dummy/app/views/layouts/application.html.erb b/spec/dummy/app/views/layouts/application.html.erb new file mode 100644 index 0000000..f72b4ef --- /dev/null +++ b/spec/dummy/app/views/layouts/application.html.erb @@ -0,0 +1,15 @@ + + + + Dummy + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= stylesheet_link_tag "application" %> + + + + <%= yield %> + + diff --git a/spec/dummy/app/views/layouts/mailer.html.erb b/spec/dummy/app/views/layouts/mailer.html.erb new file mode 100644 index 0000000..cbd34d2 --- /dev/null +++ b/spec/dummy/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/spec/dummy/app/views/layouts/mailer.text.erb b/spec/dummy/app/views/layouts/mailer.text.erb new file mode 100644 index 0000000..37f0bdd --- /dev/null +++ b/spec/dummy/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/spec/dummy/bin/rails b/spec/dummy/bin/rails new file mode 100755 index 0000000..efc0377 --- /dev/null +++ b/spec/dummy/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/spec/dummy/bin/rake b/spec/dummy/bin/rake new file mode 100755 index 0000000..4fbf10b --- /dev/null +++ b/spec/dummy/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/spec/dummy/bin/setup b/spec/dummy/bin/setup new file mode 100755 index 0000000..ec47b79 --- /dev/null +++ b/spec/dummy/bin/setup @@ -0,0 +1,33 @@ +#!/usr/bin/env ruby +require "fileutils" + +# path to your application root. +APP_ROOT = File.expand_path("..", __dir__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. + # Add necessary setup steps to this file. + + puts "== Installing dependencies ==" + system! "gem install bundler --conservative" + system("bundle check") || system!("bundle install") + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # FileUtils.cp "config/database.yml.sample", "config/database.yml" + # end + + puts "\n== Preparing database ==" + system! "bin/rails db:prepare" + + puts "\n== Removing old logs and tempfiles ==" + system! "bin/rails log:clear tmp:clear" + + puts "\n== Restarting application server ==" + system! "bin/rails restart" +end diff --git a/spec/dummy/config.ru b/spec/dummy/config.ru new file mode 100644 index 0000000..4a3c09a --- /dev/null +++ b/spec/dummy/config.ru @@ -0,0 +1,6 @@ +# This file is used by Rack-based servers to start the application. + +require_relative "config/environment" + +run Rails.application +Rails.application.load_server diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb new file mode 100644 index 0000000..0a2cacb --- /dev/null +++ b/spec/dummy/config/application.rb @@ -0,0 +1,45 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +Bundler.require(*Rails.groups(assets: %w(development test))) + + +begin + require 'spree_api' +rescue LoadError + # spree_api is not available. +end + require 'spree_admin_roles_and_access' + +module Dummy + class Application < Rails::Application + + config.to_prepare do + # Load application's model / class decorators + Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c| + Rails.configuration.cache_classes ? require(c) : load(c) + end + + # Load application's view overrides + Dir.glob(File.join(File.dirname(__FILE__), "../app/overrides/*.rb")) do |c| + Rails.configuration.cache_classes ? require(c) : load(c) + end + end + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 7.0 + + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # + # config.time_zone = "Central Time (US & Canada)" + # config.eager_load_paths << Rails.root.join("extras") + + # Don't generate system test files. + config.generators.system_tests = nil + end +end + + diff --git a/spec/dummy/config/boot.rb b/spec/dummy/config/boot.rb new file mode 100644 index 0000000..074f555 --- /dev/null +++ b/spec/dummy/config/boot.rb @@ -0,0 +1,6 @@ +require 'rubygems' +gemfile = File.expand_path("../../../../Gemfile", __FILE__) + +ENV['BUNDLE_GEMFILE'] = gemfile +require 'bundler' +Bundler.setup diff --git a/spec/dummy/config/cable.yml b/spec/dummy/config/cable.yml new file mode 100644 index 0000000..98367f8 --- /dev/null +++ b/spec/dummy/config/cable.yml @@ -0,0 +1,10 @@ +development: + adapter: async + +test: + adapter: test + +production: + adapter: redis + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: dummy_production diff --git a/spec/dummy/config/credentials.yml.enc b/spec/dummy/config/credentials.yml.enc new file mode 100644 index 0000000..42fe3c4 --- /dev/null +++ b/spec/dummy/config/credentials.yml.enc @@ -0,0 +1 @@ +5KQ+mpJHU0JeOGrCqHpG12engq8b/AoTTms7IA35Z+tMoMLLDtjD4unCUK0CCL+M65zZNu8UvFyIyK37oD9z/qlTwCVw7ndHOUW6ZgjwI2H2ynr++wr0P8aZP5SN3II+zIPn3PAl4adXMHx3t9eBZmk9OlvIn/c4ATJivuT03CzdJoXvuVlkLPxHyyzGfcVaSYCW10ZGKRGXExADZ/uimmx/h90km2Lbq900FlBIGALkGCbr4vD/5pvuQCnjLS7CSihqRoGzXCpdmXrA1vApJoYjiklgZhf4y3C9Ghe6RmDkVXLfJ7NZgxNy1iAnKyYDiJ4FV8ng32bZR/lgQMZzKguLryBZzVP38ZdI8RvL75sJV6u8jWZR1Hl+VWW/vR4+L2B8WYbOMq1IPOisogKFl+S63fL7LwQyfCbS--0uzAsAQGlq0GgbCv--eqLq/rTzUCw5kc6pGygfgw== \ No newline at end of file diff --git a/spec/dummy/config/database.yml b/spec/dummy/config/database.yml new file mode 100644 index 0000000..4361cb5 --- /dev/null +++ b/spec/dummy/config/database.yml @@ -0,0 +1,23 @@ + + + + + + +postgres: &postgres + adapter: postgresql + + + + min_messages: warning + +development: + <<: *postgres + database: spree_admin_roles_and_access_spree_development +test: + <<: *postgres + database: spree_admin_roles_and_access_spree_test +production: + <<: *postgres + database: spree_admin_roles_and_access_spree_production + diff --git a/spec/dummy/config/environment.rb b/spec/dummy/config/environment.rb new file mode 100644 index 0000000..cac5315 --- /dev/null +++ b/spec/dummy/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative "application" + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/spec/dummy/config/environments/development.rb b/spec/dummy/config/environments/development.rb new file mode 100644 index 0000000..8500f45 --- /dev/null +++ b/spec/dummy/config/environments/development.rb @@ -0,0 +1,70 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded any time + # it changes. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable server timing + config.server_timing = true + + # Enable/disable caching. By default caching is disabled. + # Run rails dev:cache to toggle caching. + if Rails.root.join("tmp/caching-dev.txt").exist? + config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{2.days.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + config.action_mailer.perform_caching = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true +end diff --git a/spec/dummy/config/environments/production.rb b/spec/dummy/config/environments/production.rb new file mode 100644 index 0000000..8e989b5 --- /dev/null +++ b/spec/dummy/config/environments/production.rb @@ -0,0 +1,93 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] + # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). + # config.require_master_key = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? + + # Compress CSS using a preprocessor. + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.asset_host = "http://assets.example.com" + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache + # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Mount Action Cable outside main process or domain. + # config.action_cable.mount_path = nil + # config.action_cable.url = "wss://example.com/cable" + # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Include generic and useful information about system operation, but avoid logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). + config.log_level = :info + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment). + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "dummy_production" + + config.action_mailer.perform_caching = false + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Use a different logger for distributed setups. + # require "syslog/logger" + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/spec/dummy/config/environments/test.rb b/spec/dummy/config/environments/test.rb new file mode 100644 index 0000000..486b3a5 --- /dev/null +++ b/spec/dummy/config/environments/test.rb @@ -0,0 +1,40 @@ +Dummy::Application.configure do + # Settings specified here will take precedence over those in config/application.rb + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Configure static asset server for tests with Cache-Control for performance + config.public_file_server.enabled = true + config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' } + + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + config.eager_load = false + + # Raise exceptions instead of rendering exception templates + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + ActionMailer::Base.default from: "spree@example.com" + # Store uploaded files on the local file system in a temporary directory + config.active_storage.service = :test + + # Print deprecation notices to the stderr + config.active_support.deprecation = :stderr + + config.active_job.queue_adapter = :test + + config.cache_store = :redis_cache_store +end diff --git a/spec/dummy/config/initializers/assets.rb b/spec/dummy/config/initializers/assets.rb new file mode 100644 index 0000000..2eeef96 --- /dev/null +++ b/spec/dummy/config/initializers/assets.rb @@ -0,0 +1,12 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = "1.0" + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/spec/dummy/config/initializers/content_security_policy.rb b/spec/dummy/config/initializers/content_security_policy.rb new file mode 100644 index 0000000..3621f97 --- /dev/null +++ b/spec/dummy/config/initializers/content_security_policy.rb @@ -0,0 +1,26 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy +# For further information see the following documentation +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy + +# Rails.application.configure do +# config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end +# +# # Generate session nonces for permitted importmap and inline scripts +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_directives = %w(script-src) +# +# # Report CSP violations to a specified URI. See: +# # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only +# # config.content_security_policy_report_only = true +# end diff --git a/spec/dummy/config/initializers/devise.rb b/spec/dummy/config/initializers/devise.rb new file mode 100644 index 0000000..06fc3f7 --- /dev/null +++ b/spec/dummy/config/initializers/devise.rb @@ -0,0 +1,3 @@ +if Object.const_defined?("Devise") + Devise.secret_key = "cb189b45832f38f3a2aa0b02860da712a7cfc1e70ad27b63b7258b110956068b46d6c9bb07a3dc34cee00bcff5cb8e507668" +end \ No newline at end of file diff --git a/spec/dummy/config/initializers/filter_parameter_logging.rb b/spec/dummy/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..adc6568 --- /dev/null +++ b/spec/dummy/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# Configure parameters to be filtered from the log file. Use this to limit dissemination of +# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported +# notations and behaviors. +Rails.application.config.filter_parameters += [ + :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +] diff --git a/spec/dummy/config/initializers/inflections.rb b/spec/dummy/config/initializers/inflections.rb new file mode 100644 index 0000000..3860f65 --- /dev/null +++ b/spec/dummy/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym "RESTful" +# end diff --git a/spec/dummy/config/initializers/permissions_policy.rb b/spec/dummy/config/initializers/permissions_policy.rb new file mode 100644 index 0000000..00f64d7 --- /dev/null +++ b/spec/dummy/config/initializers/permissions_policy.rb @@ -0,0 +1,11 @@ +# Define an application-wide HTTP permissions policy. For further +# information see https://developers.google.com/web/updates/2018/06/feature-policy +# +# Rails.application.config.permissions_policy do |f| +# f.camera :none +# f.gyroscope :none +# f.microphone :none +# f.usb :none +# f.fullscreen :self +# f.payment :self, "https://secure.example.com" +# end diff --git a/spec/dummy/config/initializers/spree.rb b/spec/dummy/config/initializers/spree.rb new file mode 100644 index 0000000..dce1205 --- /dev/null +++ b/spec/dummy/config/initializers/spree.rb @@ -0,0 +1,31 @@ +# Configure Spree Preferences +# +# Note: Initializing preferences available within the Admin will overwrite any changes that were made through the user interface when you restart. +# If you would like users to be able to update a setting with the Admin it should NOT be set here. +# +# Note: If a preference is set here it will be stored within the cache & database upon initialization. +# Just removing an entry from this initializer will not make the preference value go away. +# Instead you must either set a new value or remove entry, clear cache, and remove database entry. +# +# In order to initialize a setting do: +# config.setting_name = 'new value' +Spree.config do |config| + # Example: + # Uncomment to stop tracking inventory levels in the application + # config.track_inventory_levels = false +end + +# Configure Spree Dependencies +# +# Note: If a dependency is set here it will NOT be stored within the cache & database upon initialization. +# Just removing an entry from this initializer will make the dependency value go away. +# +Spree.dependencies do |dependencies| + # Example: + # Uncomment to change the default Service handling adding Items to Cart + # dependencies.cart_add_item_service = 'MyNewAwesomeService' +end + +# Spree::Api::Dependencies.storefront_cart_serializer = 'MyRailsApp::CartSerializer' + +Spree.user_class = "Spree::User" diff --git a/spec/dummy/config/locales/en.yml b/spec/dummy/config/locales/en.yml new file mode 100644 index 0000000..8ca56fc --- /dev/null +++ b/spec/dummy/config/locales/en.yml @@ -0,0 +1,33 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t "hello" +# +# In views, this is aliased to just `t`: +# +# <%= t("hello") %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# The following keys must be escaped otherwise they will not be retrieved by +# the default I18n backend: +# +# true, false, on, off, yes, no +# +# Instead, surround them with single quotes. +# +# en: +# "true": "foo" +# +# To learn more, please read the Rails Internationalization guide +# available at https://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/spec/dummy/config/master.key b/spec/dummy/config/master.key new file mode 100644 index 0000000..325e7ea --- /dev/null +++ b/spec/dummy/config/master.key @@ -0,0 +1 @@ +a3db7e1ad6737af87dfddc512e99a50a \ No newline at end of file diff --git a/spec/dummy/config/puma.rb b/spec/dummy/config/puma.rb new file mode 100644 index 0000000..daaf036 --- /dev/null +++ b/spec/dummy/config/puma.rb @@ -0,0 +1,43 @@ +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers: a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum; this matches the default thread size of Active Record. +# +max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } +threads min_threads_count, max_threads_count + +# Specifies the `worker_timeout` threshold that Puma will use to wait before +# terminating a worker in development environments. +# +worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +# +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +# +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the `pidfile` that Puma will use. +pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } + +# Specifies the number of `workers` to boot in clustered mode. +# Workers are forked web server processes. If using threads and workers together +# the concurrency of the application would be max `threads` * `workers`. +# Workers do not work on JRuby or Windows (both of which do not support +# processes). +# +# workers ENV.fetch("WEB_CONCURRENCY") { 2 } + +# Use the `preload_app!` method when specifying a `workers` number. +# This directive tells Puma to first boot the application and load code +# before forking the application. This takes advantage of Copy On Write +# process behavior so workers use less memory. +# +# preload_app! + +# Allow puma to be restarted by `bin/rails restart` command. +plugin :tmp_restart diff --git a/spec/dummy/config/routes.rb b/spec/dummy/config/routes.rb new file mode 100644 index 0000000..d0de0b3 --- /dev/null +++ b/spec/dummy/config/routes.rb @@ -0,0 +1,11 @@ +Rails.application.routes.draw do + # This line mounts Spree's routes at the root of your application. + # This means, any requests to URLs such as /products, will go to + # Spree::ProductsController. + # If you would like to change where this engine is mounted, simply change the + # :at option to something different. + # + # We ask that you don't use the :as option here, as Spree relies on it being + # the default of "spree". + mount Spree::Core::Engine, at: '/' +end diff --git a/spec/dummy/config/storage.yml b/spec/dummy/config/storage.yml new file mode 100644 index 0000000..4942ab6 --- /dev/null +++ b/spec/dummy/config/storage.yml @@ -0,0 +1,34 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) +# amazon: +# service: S3 +# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> +# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> +# region: us-east-1 +# bucket: your_own_bucket-<%= Rails.env %> + +# Remember not to checkin your GCS keyfile to a repository +# google: +# service: GCS +# project: your_project +# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> +# bucket: your_own_bucket-<%= Rails.env %> + +# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) +# microsoft: +# service: AzureStorage +# storage_account_name: your_account_name +# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> +# container: your_container_name-<%= Rails.env %> + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] diff --git a/spec/dummy/db/migrate/001_create_spree_dummy_models.rb b/spec/dummy/db/migrate/001_create_spree_dummy_models.rb new file mode 100644 index 0000000..98df831 --- /dev/null +++ b/spec/dummy/db/migrate/001_create_spree_dummy_models.rb @@ -0,0 +1,10 @@ +class CreateSpreeDummyModels < ActiveRecord::Migration[5.1] + def change + create_table :spree_dummy_models do |t| + t.string :name + t.integer :position + + t.timestamps + end + end +end diff --git a/spec/dummy/db/seeds.rb b/spec/dummy/db/seeds.rb new file mode 100644 index 0000000..72b132b --- /dev/null +++ b/spec/dummy/db/seeds.rb @@ -0,0 +1,10 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). +# +# Examples: +# +# movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }]) +# Character.create(name: "Luke", movie: movies.first) + +Spree::Core::Engine.load_seed if defined?(Spree::Core) +Spree::Auth::Engine.load_seed if defined?(Spree::Auth) diff --git a/spec/dummy/lib/assets/.keep b/spec/dummy/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/log/.keep b/spec/dummy/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/log/test.log b/spec/dummy/log/test.log new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/public/404.html b/spec/dummy/public/404.html new file mode 100644 index 0000000..2be3af2 --- /dev/null +++ b/spec/dummy/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
+
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/spec/dummy/public/422.html b/spec/dummy/public/422.html new file mode 100644 index 0000000..c08eac0 --- /dev/null +++ b/spec/dummy/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
+
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/spec/dummy/public/500.html b/spec/dummy/public/500.html new file mode 100644 index 0000000..78a030a --- /dev/null +++ b/spec/dummy/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
+
+

We're sorry, but something went wrong.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/spec/dummy/public/apple-touch-icon-precomposed.png b/spec/dummy/public/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/public/apple-touch-icon.png b/spec/dummy/public/apple-touch-icon.png new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/public/favicon.ico b/spec/dummy/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/spec/dummy/storage/.keep b/spec/dummy/storage/.keep new file mode 100644 index 0000000..e69de29 From 2e1c5a37af630f04886892f77a626c8a92a5e2a2 Mon Sep 17 00:00:00 2001 From: Jose C Fernandez Date: Fri, 15 Apr 2022 14:02:09 -0400 Subject: [PATCH 6/7] Add .gilab-ci --- .gitlab-ci.yml | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..b719bc4 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,56 @@ +--- +# ------------------------------------------------------------- +# Stages +# ------------------------------------------------------------- + +stages: + - prepare + - lint + - test + - post-test + - review + - deploy + +# ------------------------------------------------------------- +# Includes +# ------------------------------------------------------------- + +include: + - project: everlywell/projects/gitlab/ci-templates + ref: gl-code-quality-test-coverage + file: + - cache.gitlab-ci.yml + - code-quality.gitlab-ci.yml + - coverage.gitlab-ci.yml + - deploy.gitlab-ci.yml + - frontend.gitlab-ci.yml + - global.gitlab-ci.yml + - rails.gitlab-ci.yml + - rules.gitlab-ci.yml + - static-analysis.gitlab-ci.yml + - workflow.gitlab-ci.yml + +# ------------------------------------------------------------- +# Override included configurations +# ------------------------------------------------------------- + +variables: + APPLICATION: 'spree_admin_roles_and_access' + CI_DEFAULT_IMAGE: 'ruby-2.7.2-bundler-2.1.4-mysql-8.0.28-chrome-100-node-14.16-yarn-1.22-cctestreporter-latest' + RUN_YARN_TESTS: 'false' + USE_WEBPACKER_COMPILE: 'false' + SETUP_DB: 'false' + SETUP_PARALLEL: 'false' + +rspec: + script: + - run_timed_command "bundle exec rake test_app" + - run_timed_command "bundle exec rspec" + +brakeman: + script: + - run_timed_command "bundle exec brakeman $BRAKEMAN_CONFIDENCE_LEVEL --force" + +# ------------------------------------------------------------- +# Application-specific jobs +# ------------------------------------------------------------- From 65c64a365424fd601994de589a310964b54b54fb Mon Sep 17 00:00:00 2001 From: Jose C Fernandez Date: Fri, 15 Apr 2022 14:58:35 -0400 Subject: [PATCH 7/7] Add sample.env --- sample.env | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 sample.env diff --git a/sample.env b/sample.env new file mode 100644 index 0000000..e69de29