diff --git a/.ruby-version b/.ruby-version index 860487ca1..94ff29cc4 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.1 +3.1.1 diff --git a/Gemfile b/Gemfile index fc430ff65..d30cfef95 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ # frozen_string_literal: true -ruby '2.7.1' +ruby '3.1.1' source 'https://rubygems.org' @@ -17,6 +17,9 @@ gem 'sidekiq', '>= 5.2.7' # Integrations gem 'http' +gem 'net-smtp' +gem 'net-pop' +gem 'net-imap' gem 'multipart-post' gem 'mailchimp-api', require: 'mailchimp' gem 'mailgun-ruby' @@ -101,7 +104,7 @@ gem 'icalendar' group :development do # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. - gem 'listen', '~> 3.2.0' + gem 'listen' gem 'web-console', '>= 3.7.0' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' diff --git a/Gemfile.lock b/Gemfile.lock index 16b893ef5..a205d5650 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,9 +45,9 @@ GEM erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - active_model_serializers (0.10.10) - actionpack (>= 4.1, < 6.1) - activemodel (>= 4.1, < 6.1) + active_model_serializers (0.10.13) + actionpack (>= 4.1, < 7.1) + activemodel (>= 4.1, < 7.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) activejob (6.0.4.6) @@ -73,8 +73,8 @@ GEM minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2, >= 2.2.2) - acts-as-taggable-on (6.5.0) - activerecord (>= 5.0, < 6.1) + acts-as-taggable-on (9.0.1) + activerecord (>= 6.0, < 7.1) addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) airbrussh (1.4.0) @@ -137,6 +137,7 @@ GEM responders warden (~> 1.2.3) diff-lcs (1.5.0) + digest (3.1.0) docile (1.4.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) @@ -211,9 +212,10 @@ GEM icalendar (2.7.1) ice_cube (~> 0.16) ice_cube (0.16.4) - image_processing (1.10.0) + image_processing (1.12.1) mini_magick (>= 4.9.5, < 5) - ruby-vips (>= 2.0.13, < 3) + ruby-vips (>= 2.0.17, < 3) + io-wait (0.2.1) ipaddress (0.8.3) jbuilder (2.11.5) actionview (>= 5.0.0) @@ -237,7 +239,7 @@ GEM addressable (~> 2.7) letter_opener (1.7.0) launchy (~> 2.2) - listen (3.2.0) + listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) llhttp-ffi (0.4.0) @@ -268,8 +270,23 @@ GEM multi_json (1.15.0) multi_xml (0.6.0) multipart-post (2.1.1) + net-imap (0.2.3) + digest + net-protocol + strscan + net-pop (0.1.1) + digest + net-protocol + timeout + net-protocol (0.1.2) + io-wait + timeout net-scp (3.0.0) net-ssh (>= 2.6.5, < 7.0.0) + net-smtp (0.3.1) + digest + net-protocol + timeout net-ssh (6.1.0) netrc (0.11.0) newrelic_rpm (8.5.0) @@ -320,8 +337,6 @@ GEM method_source (~> 1.0) pry-rails (0.3.9) pry (>= 0.10.4) - psych (4.0.3) - stringio public_suffix (2.0.5) puma (5.6.2) nio4r (~> 2.0) @@ -370,11 +385,10 @@ GEM thor (>= 0.20.3, < 2.0) rainbow (3.1.1) rake (13.0.6) - rb-fsevent (0.10.3) + rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) - rdoc (6.4.0) - psych (>= 4.0.0) + rdoc (6.3.3) redcarpet (3.5.1) redis (4.6.0) regexp_parser (2.2.1) @@ -448,8 +462,8 @@ GEM sprockets (> 3.0) sprockets-rails tilt - sdoc (1.0.0) - rdoc (>= 5.0) + sdoc (2.3.1) + rdoc (>= 5.0, < 6.4.0) semantic_range (3.0.0) shoulda-matchers (5.1.0) activesupport (>= 5.2.0) @@ -491,12 +505,13 @@ GEM net-scp (>= 1.1.2) net-ssh (>= 2.8.0) ssrf_filter (1.0.7) - stringio (3.0.1) + strscan (3.0.1) temple (0.8.2) test-prof (1.0.7) thor (1.2.1) thread_safe (0.3.6) tilt (2.0.10) + timeout (0.2.0) tzinfo (1.2.9) thread_safe (~> 0.1) uglifier (4.2.0) @@ -508,11 +523,11 @@ GEM unicode-display_width (2.1.0) warden (1.2.9) rack (>= 2.0.9) - web-console (3.7.0) - actionview (>= 5.0) - activemodel (>= 5.0) + web-console (4.2.0) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) bindex (>= 0.4.0) - railties (>= 5.0) + railties (>= 6.0.0) webmock (3.14.0) addressable (>= 2.8.0) crack (>= 0.3.2) @@ -563,11 +578,14 @@ DEPENDENCIES jwt kaminari (>= 1.2.1) letter_opener - listen (~> 3.2.0) + listen mailchimp-api mailgun-ruby meta-tags (>= 2.13.0) multipart-post + net-imap + net-pop + net-smtp newrelic_rpm oj omniauth (>= 1.9.0) @@ -617,7 +635,7 @@ DEPENDENCIES webpacker RUBY VERSION - ruby 2.7.1p83 + ruby 3.1.1p18 BUNDLED WITH 2.3.8 diff --git a/app/decorators/event_decorator.rb b/app/decorators/event_decorator.rb index a2694281b..6ffc5f8a8 100644 --- a/app/decorators/event_decorator.rb +++ b/app/decorators/event_decorator.rb @@ -83,7 +83,7 @@ def time_distance def link_to_place base = 'http://maps.yandex.ru/?text=' - h.link_to URI.encode(base + object.place), target: '_blank', itemprop: 'location', itemscope: true, itemtype: 'http://schema.org/Place', rel: 'noopener' do + h.link_to CGI.escape(base + object.place), target: '_blank', itemprop: 'location', itemscope: true, itemtype: 'http://schema.org/Place', rel: 'noopener' do link_arr = [h.content_tag(:span, object.place, itemprop: 'address')] if object.address_comment.present? link_arr << h.content_tag(:span, object.address_comment, itemprop: 'name') diff --git a/config/database.yml b/config/database.yml index 3d6d25c79..f37d78f07 100644 --- a/config/database.yml +++ b/config/database.yml @@ -13,11 +13,11 @@ development: username: postgres password: postgres pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> - host: postgres + host: localhost timeout: 5000 database: it52_rails_dev -development: +test: adapter: postgresql encoding: unicode username: postgres diff --git a/docker/Dockerfile b/docker/Dockerfile index 7cdf95af5..ba7980d45 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.7.1-alpine +FROM ruby:3.1.1-alpine RUN apk add --no-cache build-base \ postgresql-dev \ diff --git a/docker/Dockerfile.production b/docker/Dockerfile.production index 58da752ef..a5ea7127a 100644 --- a/docker/Dockerfile.production +++ b/docker/Dockerfile.production @@ -1,4 +1,4 @@ -FROM ruby:2.7.1-alpine +FROM ruby:3.1.1-alpine RUN apk add --no-cache build-base \ postgresql-dev \ diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 094a05858..d318efe14 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -6,12 +6,15 @@ services: - postgres:/var/lib/postgresql/data env_file: - '../.env' + ports: + - '5432:5432' redis: image: redis:alpine volumes: - 'redis:/data' - + ports: + - '6379:6379' rails: image: ${COMPOSE_PROJECT_NAME}/rails:latest build: