Remove support for ruby 2.1, 2.2, 2.3 and 2.4, add 2.6 instead
all older than 2.3 are already EOL and 2.4 will be EOL soon and the next diaspora major version will already depend on newer versions, so we can already remove it now.
This commit is contained in:
parent
4b4375cf78
commit
68df3cf555
10 changed files with 10 additions and 19 deletions
|
|
@ -1,5 +1,5 @@
|
|||
AllCops:
|
||||
TargetRubyVersion: 2.1
|
||||
TargetRubyVersion: 2.5
|
||||
Exclude:
|
||||
- "bin/**/*"
|
||||
- "test/dummy/bin/**/*"
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
2.4
|
||||
2.6
|
||||
|
|
|
|||
12
.travis.yml
12
.travis.yml
|
|
@ -1,20 +1,12 @@
|
|||
language: ruby
|
||||
|
||||
rvm:
|
||||
- 2.5.5
|
||||
- 2.4.5
|
||||
- 2.3.8
|
||||
- 2.2.10
|
||||
- 2.1
|
||||
- 2.6.5
|
||||
- 2.5.7
|
||||
gemfile:
|
||||
- Gemfile
|
||||
- test/gemfiles/no-rails.Gemfile
|
||||
|
||||
matrix:
|
||||
exclude:
|
||||
- rvm: 2.1
|
||||
gemfile: Gemfile
|
||||
|
||||
sudo: false
|
||||
cache:
|
||||
bundler: true
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|||
s.files = Dir["app/**/*", "config/routes.rb", "config/initializers/*",
|
||||
"lib/diaspora_federation/{engine,rails}.rb", "LICENSE", "README.md", "Changelog.md"]
|
||||
|
||||
s.required_ruby_version = "~> 2.1"
|
||||
s.required_ruby_version = "~> 2.5"
|
||||
|
||||
s.add_dependency "actionpack", ">= 5", "< 6"
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|||
|
||||
s.files = Dir["lib/diaspora_federation/test.rb", "lib/diaspora_federation/test/*"]
|
||||
|
||||
s.required_ruby_version = "~> 2.1"
|
||||
s.required_ruby_version = "~> 2.5"
|
||||
|
||||
s.add_dependency "diaspora_federation", DiasporaFederation::VERSION
|
||||
s.add_dependency "fabrication", "~> 2.16"
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|||
"lib/diaspora_federation/test/*",
|
||||
"lib/tasks/*.rake"]
|
||||
|
||||
s.required_ruby_version = "~> 2.1"
|
||||
s.required_ruby_version = "~> 2.5"
|
||||
|
||||
s.add_dependency "faraday", ">= 0.9.0", "< 0.16.0"
|
||||
s.add_dependency "faraday_middleware", ">= 0.10.0", "< 0.14.0"
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ module DiasporaFederation
|
|||
# Returns diaspora* ID of the new person identity.
|
||||
# @return [String] diaspora* ID of the new person identity
|
||||
def new_identity
|
||||
profile.author if profile
|
||||
profile&.author
|
||||
end
|
||||
|
||||
# @return [String] string representation of this object
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ module DiasporaFederation
|
|||
# Validates that the parent exists and the parent author is local
|
||||
def validate_parent
|
||||
parent = DiasporaFederation.callbacks.trigger(:fetch_related_entity, parent_type, parent_guid)
|
||||
raise ParentNotLocal, "obj=#{self}" unless parent && parent.local
|
||||
raise ParentNotLocal, "obj=#{self}" unless parent&.local
|
||||
end
|
||||
|
||||
# Validate that the parent is local.
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ module Validation
|
|||
return true if value.nil? || (value.is_a?(String) && value.empty?)
|
||||
return true if value.is_a? Date
|
||||
|
||||
if value =~ /[0-9]{4}\-[0-9]{2}\-[0-9]{2}/
|
||||
if value.is_a?(String) && value.match?(/[0-9]{4}\-[0-9]{2}\-[0-9]{2}/)
|
||||
date_field = value.split("-").map(&:to_i)
|
||||
return Date.valid_civil?(date_field[0], date_field[1], date_field[2])
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ namespace :gemfiles do
|
|||
original_gemfile.sub!(/(gemspec name:.*)/) { "#{Regexp.last_match[1]}, path: \"../../\"" }
|
||||
original_gemfile.sub!(/(gemspec\(name:.*)\)/) { "#{Regexp.last_match[1]}, path: \"../../\")" }
|
||||
original_gemfile.sub!(/^group :development do$.*?^end$\n\n/m, "")
|
||||
original_gemfile << "\n gem \"fabrication\", \"< 2.17.0\"\n" # new versions are not compatible with ruby 2.1
|
||||
|
||||
no_rails_gemfile = original_gemfile.dup
|
||||
no_rails_gemfile.sub!(/(gemspec\(name:.*)/) { "#{Regexp.last_match[1]} unless plugin == \"rails\"" }
|
||||
|
|
|
|||
Loading…
Reference in a new issue