Skip to content

Commit

Permalink
Merge pull request #5074 from consul/ruby3.0
Browse files Browse the repository at this point in the history
Upgrade Ruby to version 3.0.6
  • Loading branch information
javierm committed Apr 13, 2023
2 parents 8e0acb8 + f298715 commit 03a12ea
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ stages:
- lint

tests:
image: "ruby:2.7.7"
image: "ruby:3.0.6"
stage: test
services:
- postgres:10.10
Expand Down Expand Up @@ -34,7 +34,7 @@ tests:
# PRONTO_GITLAB_API_PRIVATE_TOKEN to your repository CI/CD settings
# giving it the value of the Personal Access Token
linters:
image: "ruby:2.7.7"
image: "ruby:3.0.6"
stage: lint
cache:
key: consul
Expand Down
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ Style/FileWrite:
Style/HashConversion:
Enabled: true

Style/HashExcept:
Enabled: true

Style/HashSyntax:
Enabled: true

Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.7
3.0.6
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.7.7-buster
FROM ruby:3.0.6-buster

ENV DEBIAN_FRONTEND noninteractive

Expand Down
11 changes: 7 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
specs:
rails-assets-leaflet (1.5.1)
rails-assets-markdown-it (9.0.1)

GEM
remote: https://rubygems.org/
specs:
actioncable (6.0.6.1)
actionpack (= 6.0.6.1)
Expand Down Expand Up @@ -457,8 +462,6 @@ GEM
bundler (>= 1.3.0)
railties (= 6.0.6.1)
sprockets-rails (>= 2.0.0)
rails-assets-leaflet (1.5.1)
rails-assets-markdown-it (9.0.1)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
Expand Down Expand Up @@ -768,4 +771,4 @@ DEPENDENCIES
wkhtmltopdf-binary (~> 0.12.6)

BUNDLED WITH
2.1.4
2.2.33
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ You can access the main website of the project at [http://consulproject.org](htt

**NOTE**: For more detailed instructions check the [docs](https://docs.consulproject.org)

Prerequisites: install git, Ruby 2.7.7, CMake, pkg-config, shared-mime-info, Node.js and PostgreSQL (>=9.5).
Prerequisites: install git, Ruby 3.0.6, CMake, pkg-config, shared-mime-info, Node.js and PostgreSQL (>=9.5).

```bash
git clone https://github.com/consul/consul.git
Expand Down
2 changes: 1 addition & 1 deletion README_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Puedes acceder a la página principal del proyecto en [http://consulproject.org]

**NOTA**: para unas instrucciones más detalladas consulta la [documentación](https://docs.consulproject.org)

Prerequisitos: tener instalado git, Ruby 2.7.7, CMake, pkg-config, shared-mime-info, Node.js y PostgreSQL (9.5 o superior).
Prerequisitos: tener instalado git, Ruby 3.0.6, CMake, pkg-config, shared-mime-info, Node.js y PostgreSQL (9.5 o superior).

```bash
git clone https://github.com/consul/consul.git
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/embed_videos_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module EmbedVideosHelper
VIMEO_REGEX = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/.freeze
YOUTUBE_REGEX = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/.freeze
VIMEO_REGEX = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/
YOUTUBE_REGEX = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/

def embedded_video_code(resource)
link = resource.video_url
Expand Down
2 changes: 1 addition & 1 deletion app/models/legislation/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Legislation::Process < ApplicationRecord
PHASES_AND_PUBLICATIONS = %i[homepage_phase draft_phase debate_phase allegations_phase
proposals_phase draft_publication result_publication].freeze

CSS_HEX_COLOR = /\A#?(?:[A-F0-9]{3}){1,2}\z/i.freeze
CSS_HEX_COLOR = /\A#?(?:[A-F0-9]{3}){1,2}\z/i

has_many :draft_versions, -> { order(:id) },
foreign_key: "legislation_process_id",
Expand Down
4 changes: 2 additions & 2 deletions app/models/poll/question/answer/video.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class Poll::Question::Answer::Video < ApplicationRecord
belongs_to :answer, class_name: "Poll::Question::Answer"

VIMEO_REGEX = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/.freeze
YOUTUBE_REGEX = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/.freeze
VIMEO_REGEX = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/
YOUTUBE_REGEX = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/

validates :title, presence: true
validate :valid_url?
Expand Down
2 changes: 1 addition & 1 deletion app/models/progress_bar.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ProgressBar < ApplicationRecord
self.inheritance_column = nil
RANGE = (0..100).freeze
RANGE = (0..100)

enum kind: %i[primary secondary]

Expand Down
1 change: 1 addition & 0 deletions spec/models/skip_validation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def self.name
translates :title, touch: true
translates :description, touch: true
include Globalizable
has_many :translations, class_name: "DummyBanner::Translation", foreign_key: "banner_id"

validates_translation :title, presence: true
validates_translation :description, presence: true
Expand Down

0 comments on commit 03a12ea

Please sign in to comment.