Skip to content
Permalink
Browse files

Bump Ruby version to 2.5.3 (#4927)

* Bump Ruby version to 2.5.3

* Update changelog

* Remove useless changelog line

* Update Ruby version for rubocop

* Fix more rubocop issues
  • Loading branch information...
mrcasals committed Mar 5, 2019
1 parent 5bfca99 commit 6ae0bf5ca4ce0baab332017f7fb6045a3b61c08b
Showing with 72 additions and 85 deletions.
  1. +1 −1 .rubocop.yml
  2. +2 −1 CHANGELOG.md
  3. +1 −1 decidim-accountability/decidim-accountability.gemspec
  4. +8 −10 decidim-admin/app/permissions/decidim/admin/permissions.rb
  5. +1 −1 decidim-admin/decidim-admin.gemspec
  6. +1 −1 decidim-api/decidim-api.gemspec
  7. +1 −1 decidim-assemblies/decidim-assemblies.gemspec
  8. +1 −1 decidim-blogs/decidim-blogs.gemspec
  9. +1 −1 decidim-budgets/decidim-budgets.gemspec
  10. +1 −1 decidim-comments/decidim-comments.gemspec
  11. +1 −1 decidim-conferences/decidim-conferences.gemspec
  12. +1 −1 decidim-consultations/decidim-consultations.gemspec
  13. +9 −11 decidim-core/app/permissions/decidim/permissions.rb
  14. +4 −6 decidim-core/lib/decidim/content_renderers/user_renderer.rb
  15. +1 −1 decidim-debates/decidim-debates.gemspec
  16. +1 −1 decidim-dev/decidim-dev.gemspec
  17. +10 −12 decidim-dev/lib/decidim/dev/test/rspec_support/authorization.rb
  18. +5 −7 decidim-dev/lib/decidim/dev/test/rspec_support/orderly_matchers.rb
  19. +1 −1 decidim-forms/decidim-forms.gemspec
  20. +1 −1 decidim-generators/decidim-generators.gemspec
  21. +1 −1 decidim-generators/lib/decidim/generators/component_templates/decidim-component.gemspec.erb
  22. +1 −1 decidim-initiatives/decidim-initiatives.gemspec
  23. +1 −1 decidim-meetings/decidim-meetings.gemspec
  24. +1 −1 decidim-pages/decidim-pages.gemspec
  25. +1 −1 decidim-participatory_processes/decidim-participatory_processes.gemspec
  26. +1 −1 decidim-proposals/decidim-proposals.gemspec
  27. +5 −7 decidim-proposals/lib/decidim/content_renderers/proposal_renderer.rb
  28. +1 −1 decidim-sortitions/decidim-sortitions.gemspec
  29. +1 −1 decidim-surveys/decidim-surveys.gemspec
  30. +1 −1 decidim-system/decidim-system.gemspec
  31. +1 −1 decidim.gemspec
  32. +5 −7 decidim_app-design/bin/yarn
@@ -64,7 +64,7 @@ AllCops:
# If a value is specified for TargetRubyVersion then it is used.
# Else if .ruby-version exists and it contains an MRI version it is used.
# Otherwise we fallback to the oldest officially supported Ruby version (2.0).
TargetRubyVersion: 2.3
TargetRubyVersion: 2.5

RSpec:
Patterns:
@@ -17,7 +17,7 @@ ActiveSupport::Notifications.subscribe "decidim.user.omniauth_registration" do |
```


- **decidim-core**: Don't mix omniauth notifications with `Decidim::EventManager` events
- **Bump Ruby version**: As per [\#4927](https://github.com/decidim/decidim/pull/4927) we've bumped the minimum Ruby version to 2.5.x. Check you're running a suitable Ruby version.

**Added**:

@@ -69,6 +69,7 @@ ActiveSupport::Notifications.subscribe "decidim.user.omniauth_registration" do |
- **decidim-initiatives**: Change initiative creation wizard layout. [\#4888](https://github.com/decidim/decidim/pull/4888)
- **decidim-initiatives**: Make changes related with initiatives signature and permissions ux. [\#4906](https://github.com/decidim/decidim/pull/4906)
- **decidim-admin**: Fix inputs of translated attributes in resource permissions options form. [\#4911](https://github.com/decidim/decidim/pull/4911)
- **decidim**: Bump required Ruby minimum version to 2.5.x [\#4927](https://github.com/decidim/decidim/pull/4927)
- **decidim-initiatives**: Validate vote_form metadata considering initiative scope and also children scopes. [\#4933](https://github.com/decidim/decidim/pull/4933)

**Fixed**:
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-accountability"
s.summary = "Decidim accountability module"
@@ -139,16 +139,14 @@ def user_can_enter_space_area?

def space_allows_admin_access_to_current_action?
Decidim.participatory_space_manifests.any? do |manifest|
begin
new_permission_action = Decidim::PermissionAction.new(
action: permission_action.action,
scope: permission_action.scope,
subject: permission_action.subject
)
manifest.permissions_class.new(user, new_permission_action, context).permissions.allowed?
rescue Decidim::PermissionAction::PermissionNotSetError
nil
end
new_permission_action = Decidim::PermissionAction.new(
action: permission_action.action,
scope: permission_action.scope,
subject: permission_action.subject
)
manifest.permissions_class.new(user, new_permission_action, context).permissions.allowed?
rescue Decidim::PermissionAction::PermissionNotSetError
nil
end
end

@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-admin"
s.summary = "Decidim organization administration"
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-api"
s.summary = "Decidim API module"
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-assemblies"
s.summary = "Decidim assemblies module"
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.email = ["isaac.mg@coditramuntana.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3.1"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-blogs"
s.summary = "Decidim blogs module"
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-budgets"
s.summary = "Decidim budgets module"
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-comments"
s.summary = "Decidim comments module"
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.email = ["isaac.mg@coditramuntana.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-conferences"
s.summary = "Decidim conferences module"
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.email = ["jsperezg@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3.1"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-consultations"
s.summary = "Decidim consultations module"
@@ -139,17 +139,15 @@ def user_can_admin_component?

def user_can_admin_component_via_space?
Decidim.participatory_space_manifests.any? do |manifest|
begin
new_permission_action = Decidim::PermissionAction.new(
action: permission_action.action,
scope: :admin,
subject: permission_action.subject
)
new_context = context.merge(current_participatory_space: component.participatory_space)
manifest.permissions_class.new(user, new_permission_action, new_context).permissions.allowed?
rescue Decidim::PermissionAction::PermissionNotSetError
nil
end
new_permission_action = Decidim::PermissionAction.new(
action: permission_action.action,
scope: :admin,
subject: permission_action.subject
)
new_context = context.merge(current_participatory_space: component.participatory_space)
manifest.permissions_class.new(user, new_permission_action, new_context).permissions.allowed?
rescue Decidim::PermissionAction::PermissionNotSetError
nil
end
end

@@ -19,12 +19,10 @@ class UserRenderer < BaseRenderer
# @return [String] the content ready to display (contains HTML)
def render
content.gsub(GLOBAL_ID_REGEX) do |user_gid|
begin
user = GlobalID::Locator.locate(user_gid)
Decidim::UserPresenter.new(user).display_mention
rescue ActiveRecord::RecordNotFound => _ex
""
end
user = GlobalID::Locator.locate(user_gid)
Decidim::UserPresenter.new(user).display_mention
rescue ActiveRecord::RecordNotFound => _ex
""
end
end
end
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com", "genis.matutes@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-debates"
s.summary = "Decidim debates module"
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-dev"
s.summary = "Decidim dev tools"
@@ -27,20 +27,18 @@ class Engine < ::Rails::Engine

RSpec.configure do |config|
config.around(:example, :with_authorization_workflows) do |example|
begin
previous_workflows = Decidim::Verifications.workflows.dup
previous_workflows = Decidim::Verifications.workflows.dup

new_workflows = example.metadata[:with_authorization_workflows].map do |name|
Decidim::Verifications.find_workflow_manifest(name)
end
new_workflows = example.metadata[:with_authorization_workflows].map do |name|
Decidim::Verifications.find_workflow_manifest(name)
end

Decidim::Verifications.reset_workflows(*new_workflows)
Rails.application.reload_routes!
Decidim::Verifications.reset_workflows(*new_workflows)
Rails.application.reload_routes!

example.run
ensure
Decidim::Verifications.reset_workflows(*previous_workflows)
Rails.application.reload_routes!
end
example.run
ensure
Decidim::Verifications.reset_workflows(*previous_workflows)
Rails.application.reload_routes!
end
end
@@ -2,12 +2,10 @@

RSpec::Matchers.define :appear_before do |later_content|
match do |earlier_content|
begin
page.body.index(earlier_content) < page.body.index(later_content)
rescue ArgumentError
raise "Could not locate later content on page: #{later_content}"
rescue NoMethodError
raise "Could not locate earlier content on page: #{earlier_content}"
end
page.body.index(earlier_content) < page.body.index(later_content)
rescue ArgumentError
raise "Could not locate later content on page: #{later_content}"
rescue NoMethodError
raise "Could not locate earlier content on page: #{earlier_content}"
end
end
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com", "rbngzlv@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-forms"
s.summary = "Decidim forms"
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-generators"

@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.email = ["<%= %x[git config user.email].chomp %>"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim-module-<%= component_name %>"
s.required_ruby_version = ">= 2.3.1"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-<%= component_name %>"
s.summary = "A decidim <%= component_name %> module"
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.email = ["jsperezg@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3.1"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-initiatives"
s.summary = "Decidim initiatives module"
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-meetings"
s.summary = "Decidim meetings module"
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-pages"
s.summary = "Decidim pages module"
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-participatory_processes"
s.summary = "Decidim participatory processes module"
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-proposals"
s.summary = "Decidim proposals module"
@@ -19,13 +19,11 @@ class ProposalRenderer < BaseRenderer
# @return [String] the content ready to display (contains HTML)
def render
content.gsub(GLOBAL_ID_REGEX) do |proposal_gid|
begin
proposal = GlobalID::Locator.locate(proposal_gid)
Decidim::Proposals::ProposalPresenter.new(proposal).display_mention
rescue ActiveRecord::RecordNotFound
proposal_id = proposal_gid.split("/").last
"~#{proposal_id}"
end
proposal = GlobalID::Locator.locate(proposal_gid)
Decidim::Proposals::ProposalPresenter.new(proposal).display_mention
rescue ActiveRecord::RecordNotFound
proposal_id = proposal_gid.split("/").last
"~#{proposal_id}"
end
end
end
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.email = ["jsperezg@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3.1"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-sortitions"
s.summary = "Decidim sortitions module"
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-surveys"
s.summary = "Decidim surveys module"
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim-system"
s.summary = "Decidim system administration"
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
s.license = "AGPL-3.0"
s.homepage = "https://github.com/decidim/decidim"
s.required_ruby_version = ">= 2.3"
s.required_ruby_version = ">= 2.5"

s.name = "decidim"

@@ -3,11 +3,9 @@

VENDOR_PATH = File.expand_path("..", __dir__)
Dir.chdir(VENDOR_PATH) do
begin
exec "yarnpkg #{ARGV.join(" ")}"
rescue Errno::ENOENT
warn "Yarn executable was not detected in the system."
warn "Download Yarn at https://yarnpkg.com/en/docs/install"
exit 1
end
exec "yarnpkg #{ARGV.join(" ")}"
rescue Errno::ENOENT
warn "Yarn executable was not detected in the system."
warn "Download Yarn at https://yarnpkg.com/en/docs/install"
exit 1
end

0 comments on commit 6ae0bf5

Please sign in to comment.
You can’t perform that action at this time.