Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
SMTP_USERNAME: ${{ secrets.SMTP_USERNAME }}
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}

- name: Run RuboCop linting
run: bundle exec rubocop

- name: Run tests
run: bundle exec rspec
env:
Expand Down
48 changes: 34 additions & 14 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,46 @@
Encoding:
Enabled: false
# Inherit Shopify's Ruby style guide
inherit_gem:
rubocop-shopify: rubocop.yml

# Load RuboCop extensions as plugins
plugins:
- rubocop-capybara
- rubocop-factory_bot
- rubocop-rails
- rubocop-rspec
- rubocop-rspec_rails

# Custom project-specific overrides
AllCops:
Exclude:
- "bin/**/*"
- "db/**/*"
- "config/**/*"
- "vendor/**/*"
- "node_modules/**/*"

# Disable some rules that might be too strict for legacy code
Metrics/AbcSize:
Max: 30

Documentation:
Metrics/MethodLength:
Enabled: false

ClassAndModuleChildren:
Metrics/ClassLength:
Enabled: false

ClassLength:
Style/Documentation:
Enabled: false

MethodLength:
Style/ClassAndModuleChildren:
Enabled: false

AbcSize:
Max: 30
# RSPEC
RSpec/MultipleExpectations:
Enabled: false

DoubleNegation:
RSpec/ExampleLength:
Enabled: false

AllCops:
Exclude:
- "bin/**/*"
- "db/**/*"
- "config/**/*"
Style/ClassMethodsDefinitions:
Enabled: false
12 changes: 7 additions & 5 deletions Capfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# frozen_string_literal: true

# Load DSL and set up stages
require 'capistrano/setup'
require "capistrano/setup"

# Include default deployment tasks
require 'capistrano/deploy'
require 'capistrano/bundler'
require 'capistrano/rails'
require "capistrano/deploy"
require "capistrano/bundler"
require "capistrano/rails"

# Include tasks from other gems included in your Gemfile
#
Expand All @@ -26,4 +28,4 @@ require 'capistrano/rails'
# require 'capistrano/passenger'

# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
95 changes: 51 additions & 44 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
source 'https://rubygems.org'
# frozen_string_literal: true

source "https://rubygems.org"

ruby "3.3.8"

gem "rails", "~> 6.1.7"

gem 'sprockets-rails', '~> 3.2.2'
gem 'mysql2', '~> 0.5.0'
gem 'bootstrap-sass'
gem "sprockets-rails", "~> 3.2.2"
gem "mysql2", "~> 0.5.0"
gem "bootstrap-sass"
gem "sassc-rails", ">= 2.1.2"
gem 'uglifier'
gem 'coffee-rails'
gem "uglifier"
gem "coffee-rails"
gem "feature_flipper"

gem 'jquery-rails'
gem 'jbuilder', '~> 2.0'
gem "jquery-rails"
gem "jbuilder", "~> 2.0"

gem 'devise', '~> 4.7.3'
gem 'neat', '1.7.1'
gem 'bourbon', '~> 4.2.2'
gem 'draper'
gem "devise", "~> 4.7.3"
gem "neat", "1.7.1"
gem "bourbon", "~> 4.2.2"
gem "draper"
gem "kt-paperclip", "~> 6.4", ">= 6.4.1"
gem 'aws-sdk-s3'
gem 'rails_admin','~> 2.2.1'
gem "aws-sdk-s3"
gem "rails_admin", "~> 2.2.1"
# gem 'rails_admin', git: 'https://github.com/enmand/rails_admin.git'
# rails_admin 1.1.1 has a transitive dependency on haml (~> 4.0). haml 4.0.7 in
# turn has a transitive dependency on tile and does not specify a version range.
Expand All @@ -30,42 +32,47 @@ gem 'rails_admin','~> 2.2.1'
# with haml 4.0.7. We can remove this as soon we get upgrade to a newer version
# of rails_admin that should pull in a newer version of haml, breaking this
# dependency chain.
gem 'tilt', '~> 2.4.0'

gem "tilt", "~> 2.4.0"

gem 'puma', '~> 5.6' # Add Puma as the web server
gem "puma", "~> 5.6" # Add Puma as the web server

gem 'cocoon', '~> 1.2.6'
gem "cocoon", "~> 1.2.6"

gem 'font-awesome-rails'
gem 'wicked'
gem 'search_cop', '~> 1.0.6'
gem 'mandrill_mailer'
gem 'jwt', '~> 1.2.1'
gem 'httparty'
gem 'will_paginate', '~> 3.1.7'
gem 'bootstrap-will_paginate'
gem 'apipie-rails', '~> 0.5.0'
gem 'rack-cors', :require => 'rack/cors'
gem 'ckeditor', '~> 4.3.0'
gem "font-awesome-rails"
gem "wicked"
gem "search_cop", "~> 1.0.6"
gem "mandrill_mailer"
gem "jwt", "~> 1.2.1"
gem "httparty"
gem "will_paginate", "~> 3.1.7"
gem "bootstrap-will_paginate"
gem "apipie-rails", "~> 0.5.0"
gem "rack-cors", require: "rack/cors"
gem "ckeditor", "~> 4.3.0"
gem "binding_of_caller"
gem 'image_processing'
gem 'foundation_emails'
gem 'inky-rb', require: 'inky'
gem "image_processing"
gem "foundation_emails"
gem "inky-rb", require: "inky"
# Stylesheet inlining for email
gem 'premailer-rails'
gem "bcrypt", '3.1.16'
gem "premailer-rails"
gem "bcrypt", "3.1.16"
gem "json", ">= 2.6", "< 3" # or simply: gem "json", "~> 2.7"

group :development, :test do
gem 'better_errors'
gem 'capybara', '~> 3.36'
gem 'dotenv-rails'
gem 'faker'
gem 'factory_bot_rails'
gem 'listen'
gem 'pry-rails'
gem 'rspec-rails'
gem 'selenium-webdriver'
gem 'shoulda-matchers', require: false
gem "better_errors"
gem "capybara", "~> 3.36"
gem "dotenv-rails"
gem "faker"
gem "factory_bot_rails"
gem "listen"
gem "pry-rails"
gem "rspec-rails"
gem "rubocop-capybara", require: false
gem "rubocop-factory_bot", require: false
gem "rubocop-rails", require: false
gem "rubocop-rspec", require: false
gem "rubocop-rspec_rails", require: false
gem "rubocop-shopify", require: false
gem "selenium-webdriver"
gem "shoulda-matchers", require: false
end
54 changes: 54 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ GEM
public_suffix (>= 2.0.2, < 7.0)
apipie-rails (0.5.20)
rails (>= 4.1)
ast (2.4.3)
autoprefixer-rails (10.4.21.0)
execjs (~> 2)
aws-eventstream (1.4.0)
Expand Down Expand Up @@ -216,6 +217,8 @@ GEM
mime-types
mimemagic (~> 0.3.0)
terrapin (~> 0.6.0)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
Expand Down Expand Up @@ -272,6 +275,10 @@ GEM
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
orm_adapter (0.5.0)
parallel (1.27.0)
parser (3.3.9.0)
ast (~> 2.4.1)
racc
polyglot (0.3.5)
premailer (1.22.0)
addressable
Expand All @@ -281,6 +288,7 @@ GEM
actionmailer (>= 3)
net-smtp
premailer (~> 1.7, >= 1.7.9)
prism (1.4.0)
pry (0.15.2)
coderay (~> 1.1)
method_source (~> 1.0)
Expand Down Expand Up @@ -338,6 +346,7 @@ GEM
method_source
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
rake (13.3.0)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
Expand Down Expand Up @@ -368,6 +377,42 @@ GEM
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.13.4)
rubocop (1.80.2)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.46.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.46.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-capybara (2.22.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-factory_bot (2.27.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rails (2.33.3)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
rubocop-rspec (3.7.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rspec_rails (2.31.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rspec (~> 3.5)
rubocop-shopify (2.17.1)
rubocop (~> 1.62)
ruby-progressbar (1.13.0)
ruby-vips (2.2.4)
ffi (~> 1.12)
logger
Expand Down Expand Up @@ -414,6 +459,9 @@ GEM
concurrent-ruby (~> 1.0)
uglifier (4.2.1)
execjs (>= 0.3.0, < 3)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.1.0)
warden (1.2.9)
rack (>= 2.0.9)
websocket (1.2.11)
Expand Down Expand Up @@ -471,6 +519,12 @@ DEPENDENCIES
rails (~> 6.1.7)
rails_admin (~> 2.2.1)
rspec-rails
rubocop-capybara
rubocop-factory_bot
rubocop-rails
rubocop-rspec
rubocop-rspec_rails
rubocop-shopify
sassc-rails (>= 2.1.2)
search_cop (~> 1.0.6)
selenium-webdriver
Expand Down
10 changes: 6 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# frozen_string_literal: true

# Add your own tasks in files placed in lib/tasks ending in .rake,
require File.expand_path('../config/application', __FILE__)
require File.expand_path("../config/application", __FILE__)

Rails.application.load_tasks

desc "Build local docker image"
task "build:docker" do |t, args|
sh "docker build --no-cache -t awbw-portal ."
end
task "build:docker" => :environment do |_t, _args|
sh "docker build --no-cache -t awbw-portal ."
end
8 changes: 5 additions & 3 deletions app/controllers/admins/base_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class Admins::BaseController < ActionController::Base
# frozen_string_literal: true

class Admins::BaseController < ApplicationController
before_action :authenticate_admin!
def show
redirect_to rails_admin_path
redirect_to(rails_admin_path)
end
end
end
6 changes: 4 additions & 2 deletions app/controllers/admins/sessions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
class Admins::SessionsController < ::Devise::SessionsController
end
# frozen_string_literal: true

class Admins::SessionsController < Devise::SessionsController
end
Loading