Skip to content

Commit

Permalink
Switch to rails-omakase
Browse files Browse the repository at this point in the history
  • Loading branch information
vitallium committed Apr 28, 2024
1 parent 4cbf7e9 commit 745405e
Show file tree
Hide file tree
Showing 55 changed files with 162 additions and 145 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
inherit_gem:
rubocop-rails-omakase: rubocop.yml
14 changes: 7 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ ruby "2.7.8"
gem "active_link_to"
gem "autoprefixer-rails"
gem "bourbon", "7.3.0"
gem "cancancan"
gem "carrierwave", "~> 2.2.6"
gem "carrierwave-base64"
gem "cancancan"
gem "config", "~> 2"
gem "devise"
gem "geocoder", "1.6.1"
Expand All @@ -25,8 +25,8 @@ gem "normalize-rails", "~> 4.1.1"
gem "omniauth"
gem "omniauth-github"
gem "omniauth-google-oauth2"
gem "omniauth-vkontakte"
gem "omniauth-rails_csrf_protection"
gem "omniauth-vkontakte"
gem "pg"
gem "phony_rails"
gem "puma"
Expand Down Expand Up @@ -54,8 +54,8 @@ gem "stackprof", require: false, platform: :mri

source "https://rails-assets.org" do
gem "rails-assets-cropper", "~> 2.3"
gem "rails-assets-smartcrop", "~> 1.1"
gem "rails-assets-listjs", "~> 1.5"
gem "rails-assets-smartcrop", "~> 1.1"
end

group :development do
Expand All @@ -65,25 +65,25 @@ end

group :development, :test do
gem "awesome_print"
gem "brakeman", require: false
gem "bullet"
gem "bundler-audit", ">= 0.5.0", require: false
gem "brakeman", require: false
gem "dotenv-rails"
gem "faker"
gem "factory_bot_rails"
gem "faker"
gem "pry-byebug"
gem "pry-rails"
gem "rails-controller-testing"
gem "rspec-rails"
gem "standard"
gem "rubocop-rails-omakase", require: false
end

group :test do
gem "formulaic"
gem "fuubar"
gem "launchy"
gem "shoulda-matchers"
gem "shoulda-callback-matchers"
gem "shoulda-matchers"
gem "simplecov", require: false
gem "timecop"
gem "webmock"
Expand Down
53 changes: 36 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ GEM
zeitwerk (~> 2.3)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.0)
ast (2.4.2)
autoprefixer-rails (9.6.1.1)
execjs
awesome_print (1.8.0)
Expand All @@ -93,13 +93,14 @@ GEM
thor (~> 1.0)
byebug (11.1.3)
cancancan (3.5.0)
capybara (3.27.0)
capybara (3.39.2)
addressable
matrix
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
carrierwave (2.2.6)
activemodel (>= 5.0.0)
Expand Down Expand Up @@ -231,6 +232,7 @@ GEM
json (2.7.2)
jwt (2.8.1)
base64
language_server-protocol (3.17.0.3)
launchy (2.4.3)
addressable (~> 2.3)
listen (3.2.0)
Expand All @@ -245,6 +247,7 @@ GEM
net-pop
net-smtp
marcel (1.0.4)
matrix (0.4.2)
memoist (0.16.2)
memory_profiler (0.9.14)
meta-tags (2.20.0)
Expand Down Expand Up @@ -311,9 +314,10 @@ GEM
omniauth-oauth2 (>= 1.5, <= 1.8.0)
orm_adapter (0.5.0)
os (1.0.1)
parallel (1.19.1)
parser (2.7.0.1)
ast (~> 2.4.0)
parallel (1.24.0)
parser (3.3.1.0)
ast (~> 2.4.1)
racc
pg (1.5.6)
phony (2.18.5)
phony_rails (0.14.13)
Expand Down Expand Up @@ -379,7 +383,7 @@ GEM
method_source
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.0.0)
rainbow (3.1.1)
rake (13.2.1)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
Expand All @@ -388,7 +392,7 @@ GEM
mail
redcarpet (3.5.1)
redis (3.3.3)
regexp_parser (1.6.0)
regexp_parser (2.9.0)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
Expand All @@ -415,15 +419,33 @@ GEM
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.13.1)
rubocop (0.83.0)
rubocop (1.63.3)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 2.7.0.1)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
rexml
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
rubocop-minitest (0.9.0)
rubocop (>= 0.74)
rubocop-performance (1.5.2)
rubocop (>= 0.71.0)
rubocop-rails (2.23.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rails-omakase (1.0.0)
rubocop
rubocop-minitest
rubocop-performance
rubocop-rails
ruby-progressbar (1.10.1)
ruby-vips (2.2.1)
ffi (~> 1.12)
Expand Down Expand Up @@ -479,9 +501,6 @@ GEM
sprockets (>= 3.0.0)
ssrf_filter (1.1.2)
stackprof (0.2.13)
standard (0.4.6)
rubocop (~> 0.83.0)
rubocop-performance (~> 1.5.2)
temple (0.10.3)
thor (1.3.1)
tilt (2.3.0)
Expand All @@ -494,7 +513,7 @@ GEM
uber (0.1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.6.0)
unicode-display_width (2.5.0)
uniform_notifier (1.16.0)
version_gem (1.1.4)
warden (1.2.9)
Expand Down Expand Up @@ -577,6 +596,7 @@ DEPENDENCIES
redis
responders
rspec-rails
rubocop-rails-omakase
russian
sass-rails (~> 6.0)
shoulda-callback-matchers
Expand All @@ -585,7 +605,6 @@ DEPENDENCIES
slim-rails
sprockets (>= 3.0.0)
stackprof
standard
timecop
toastr-rails
uglifier
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require File.expand_path("../config/application", __FILE__)

Rails.application.load_tasks
task(:default).clear
task default: [:spec]
task default: [ :spec ]

if defined? RSpec
task(:spec).clear
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/places_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def place_params
:address,
:title,
:latitude,
:longitude,
:longitude
]
params.require(:place).permit(*attributes)
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def user_params
:first_name,
:last_name,
:phone,
:role,
:role
]
params.require(:user).permit(*attributes)
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/events/attendees_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Events::AttendeesController < ApplicationController
respond_to :html
respond_to :csv, only: [:index]
respond_to :csv, only: [ :index ]
load_and_authorize_resource :event
authorize_resource class: false
skip_authorize_resource only: :index
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/events_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class EventsController < ApplicationController
respond_to :json, only: [:create]
respond_to :json, only: [ :create ]
respond_to :ics, only: :ics
respond_to :rss, only: :feed

Expand Down Expand Up @@ -144,10 +144,10 @@ def whitelisted
:title,
:address,
:latitude,
:longitude,
:longitude
],
has_attendees_limit: [],
attendees_limit: [],
attendees_limit: []
]
end
end
4 changes: 2 additions & 2 deletions app/controllers/places_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def find
def to_yandex_geoobject(place)
{
addressLine: place.address,
coordinates: [place.latitude, place.longitude],
coordinates: [ place.latitude, place.longitude ],
place_title: place.title,
id: place.id,
id: place.id
}
end
end
2 changes: 1 addition & 1 deletion app/controllers/users/avatars_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Users
class AvatarsController < ApplicationController
before_action :authenticate_user!
before_action :set_user, only: [:create, :update, :destroy]
before_action :set_user, only: [ :create, :update, :destroy ]
before_action :check_if_same_user_or_admin

def create
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/users/profile_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Users
class ProfileController < ApplicationController
before_action :authenticate_user!, except: [:sign_in]
before_action :set_user, only: [:profile, :settings, :settings_update, :edit]
before_action :authenticate_user!, except: [ :sign_in ]
before_action :set_user, only: [ :profile, :settings, :settings_update, :edit ]

authorize_resource class: User, except: [:sign_in, :sign_up_complete]
authorize_resource class: User, except: [ :sign_in, :sign_up_complete ]

def sign_in; end

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class UsersController < ApplicationController
before_action :authenticate_user!, only: [:edit, :destroy]
before_action :authenticate_user!, only: [ :edit, :destroy ]

respond_to :html
load_and_authorize_resource
Expand Down Expand Up @@ -57,7 +57,7 @@ def user_params
:email,
:phone,
:hash_tag,
:bio,
:bio
]

params.require(:user).permit(*user_attributes)
Expand Down
9 changes: 4 additions & 5 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
module ApplicationHelper

def default_meta_image
{
_: asset_url("share.png"),
width: 1200,
height: 630,
height: 630
}
end

Expand All @@ -22,15 +21,15 @@ def default_meta_tags
url: root_url,
locale: "ru_RU",
type: "website",
image: default_meta_image,
image: default_meta_image
},
twitter: {
image: asset_url("share.png"),
card: "summary_large_image",
site: "it_rostov",
title: :title,
description: :description,
},
description: :description
}
}
end

Expand Down
6 changes: 3 additions & 3 deletions app/helpers/events_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ def events_fit_on_one_page?(events)
end

def quoted_title(event)
["&laquo;", event.title, "&raquo;"].join
[ "&laquo;", event.title, "&raquo;" ].join
end

def summary_info(event)
[quoted_title(event), event.place.full_address, l(event.started_at, format: :date_time_full)].compact.join("<br>")
[ quoted_title(event), event.place.full_address, l(event.started_at, format: :date_time_full) ].compact.join("<br>")
end

def make_global(link)
Expand Down Expand Up @@ -37,7 +37,7 @@ def remove_from_event_link(event)
def to_yandex_location(place)
{
addressLine: place.full_address,
coordinates: [place.latitude, place.longitude],
coordinates: [ place.latitude, place.longitude ]
}.to_json
end
end
Loading

0 comments on commit 745405e

Please sign in to comment.