diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 20bdb8dc..eb9ce9fd 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: ["2.6", "2.7"] + ruby: ["2.6", "2.7", "3.0"] db: [sqlite, mysql, postgres] exclude: - ruby: "2.6" diff --git a/Dockerfile-2.5 b/Dockerfile-3.0 similarity index 98% rename from Dockerfile-2.5 rename to Dockerfile-3.0 index f14decab..534d5c92 100644 --- a/Dockerfile-2.5 +++ b/Dockerfile-3.0 @@ -1,4 +1,4 @@ -FROM ruby:2.5 +FROM ruby:3.0 # throw errors if Gemfile has been modified since Gemfile.lock RUN bundle config --global frozen 1 diff --git a/Gemfile b/Gemfile index bc32d458..4c21623c 100644 --- a/Gemfile +++ b/Gemfile @@ -20,7 +20,7 @@ gem 'aasm', '~> 5.2.0' gem 'acts_as_list' gem 'bcrypt', '~> 3.1.16' gem 'htmlentities' -gem 'paperclip' +gem "kt-paperclip", "~> 6.4", ">= 6.4.1" gem 'puma', '~> 5.5' gem 'rails_autolink' gem 'RedCloth' diff --git a/Gemfile.lock b/Gemfile.lock index 4174949a..f1d97d33 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -135,6 +135,12 @@ GEM rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) + kt-paperclip (6.4.1) + activemodel (>= 4.2.0) + activesupport (>= 4.2.0) + mime-types + mimemagic (~> 0.3.0) + terrapin (~> 0.6.0) libv8 (3.16.14.19) listen (3.7.0) rb-fsevent (~> 0.10, >= 0.10.3) @@ -146,9 +152,9 @@ GEM mini_mime (>= 0.1.1) marcel (1.0.2) method_source (1.0.0) - mime-types (3.3.1) + mime-types (3.4.1) mime-types-data (~> 3.2015) - mime-types-data (3.2020.1104) + mime-types-data (3.2021.1115) mimemagic (0.3.10) nokogiri (~> 1) rake @@ -162,12 +168,6 @@ GEM nokogiri (1.12.5) mini_portile2 (~> 2.6.1) racc (~> 1.4) - paperclip (6.1.0) - activemodel (>= 4.2.0) - activesupport (>= 4.2.0) - mime-types - mimemagic (~> 0.3.0) - terrapin (~> 0.6.0) parallel (1.21.0) parser (3.1.0.0) ast (~> 2.4.1) @@ -336,11 +336,11 @@ DEPENDENCIES i18n-tasks (~> 0.9.37) jquery-rails (~> 4.4) jquery-ui-rails (~> 6.0.1) + kt-paperclip (~> 6.4, >= 6.4.1) listen minitest-stub-const mocha mysql2 (~> 0.5.3) - paperclip pg (~> 1.2.3) puma (~> 5.5) rack-mini-profiler diff --git a/app/helpers/rendering_helper.rb b/app/helpers/rendering_helper.rb index ad406aa6..60c6b3c6 100644 --- a/app/helpers/rendering_helper.rb +++ b/app/helpers/rendering_helper.rb @@ -13,7 +13,7 @@ module RenderingHelper # do not change string; URL is already linked href else - content_tag(:a, h(href), :href => URI.escape(href)) + content_tag(:a, h(href), :href => href) end end end diff --git a/app/models/message_gateway.rb b/app/models/message_gateway.rb index 711e6a92..2a125cd7 100644 --- a/app/models/message_gateway.rb +++ b/app/models/message_gateway.rb @@ -26,7 +26,7 @@ class MessageGateway < ActionMailer::Base attachment = todo.attachments.build # create temp file - tmp = Tempfile.new(['attachment', '.eml'], { universal_newline: true }) + tmp = Tempfile.new(['attachment', '.eml'], universal_newline: true) tmp.write email.raw_source.gsub(/\r/, "") # add temp file to attachment. paperclip will copy the file to the right location diff --git a/app/views/integrations/rest_api.html.erb b/app/views/integrations/rest_api.html.erb index abf9a758..3d867146 100644 --- a/app/views/integrations/rest_api.html.erb +++ b/app/views/integrations/rest_api.html.erb @@ -64,10 +64,10 @@
<%= t('rest_help.id') %>/todos.xml<%= raw t('rest_help.retrieve.limit', { +
<%= raw t('rest_help.retrieve.limit',
fields: 'ID, created_at, modified_at, completed_at',
limit_parameter: 'limit_fields',
- set_to: 'index'}) %>
index') %>
@@ -87,10 +87,10 @@
<%= t('rest_help.writing.title') %>
-<%= raw t('rest_help.writing.description', {
+
<%= raw t('rest_help.writing.description',
put: 'PUT',
post: 'POST',
- delete: 'DELETE'}) %>
+ delete: 'DELETE') %>
<%= t('rest_help.writing.example_title') %>
@@ -105,9 +105,9 @@ Location: <%= root_url %>projects/65.xml
-<%= raw t('rest_help.writing.example_project_response_title', { +
<%= raw t('rest_help.writing.example_project_response_title',
response_code: 'HTTP/1.1 201 Created',
- header: 'Location'}) %>
Location') %>
@@ -120,9 +120,9 @@ Location: <%= root_url %>todos/452.xml
-<%= raw t('rest_help.writing.example_todo_response_title', { +
<%= raw t('rest_help.writing.example_todo_response_title',
response_code: 'HTTP/1.1 201 Created',
- header: 'Location'}) %>
Location') %>
@@ -143,8 +143,8 @@ Location: <%= root_url %>todos/452.xml
-<%= raw t('rest_help.writing.example_note_response_title', {
- response_code: 'HTTP/1.1 200 OK'}) %>
<%= raw t('rest_help.writing.example_note_response_title',
+ response_code: 'HTTP/1.1 200 OK') %>
@@ -164,8 +164,8 @@ Location: <%= root_url %>todos/452.xml
-<%= raw t('rest_help.writing.example_delete_title', {
- delete: 'DELETE'}) %>
<%= raw t('rest_help.writing.example_delete_title',
+ delete: 'DELETE') %>
@@ -176,15 +176,15 @@ Location: <%= root_url %>todos/452.xml
-<%= raw t('rest_help.writing.example_delete_response_title', {
- response_code: 'HTTP/1.1 200 OK'}) %>
<%= raw t('rest_help.writing.example_delete_response_title',
+ response_code: 'HTTP/1.1 200 OK') %>
<%= raw t('rest_help.response.description', { +
<%= raw t('rest_help.response.description',
response_200: '200 OK',
response_201: '201 Created',
- example_call: 'GET /contexts/2/todos.xml'}) %>
GET /contexts/2/todos.xml') %>
<%= t('rest_help.response.xml_description') %>
@@ -200,11 +200,11 @@ $ curl -u username:p4ssw0rd -H "Content-Type: text/xml" \<%= raw I18n.t 'rest_help.activeresource.description', { +
<%= raw I18n.t 'rest_help.activeresource.description',
activeresource_link: link_to(I18n.t('rest_help.activeresource.activeresource_link_text'), 'http://weblog.rubyonrails.org/2007/9/30/rails-2-0-0-preview-release'),
ror_link: link_to(I18n.t('rest_help.activeresource.ror_link_text'), 'http://www.rubyonrails.org'),
gem_command: 'gem install activeresource --source http://gems.rubyonrails.org --include-dependencies'
-} %>
@@ -226,8 +226,8 @@ Loading development environment (Rails 1.2.4)
-<%= raw I18n.t 'rest_help.activeresource.wrapper_description', { - signals_link: link_to(I18n.t('rest_help.activeresource.signals_link_text'), 'http://www.37signals.com')} %>
+<%= raw I18n.t 'rest_help.activeresource.wrapper_description', + signals_link: link_to(I18n.t('rest_help.activeresource.signals_link_text'), 'http://www.37signals.com') %>
@@ -246,13 +246,13 @@ irb(main):003:0>
<%= t('rest_help.notes.description') %>
- - <%= raw I18n.t 'rest_help.notes.bullet1', {
+
- <%= raw I18n.t 'rest_help.notes.bullet1',
id: '
ID',
- url: 'URL'} %>
- - <%= raw I18n.t 'rest_help.notes.bullet2', {
- omit: '
...' } %>
+ url: 'URL' %>
+ - <%= raw I18n.t 'rest_help.notes.bullet2',
+ omit: '
...' %>
-<%= raw I18n.t 'rest_help.notes.curl_description', {
- curl: link_to(I18n.t('rest_help.curl_link_text'), 'http://en.wikipedia.org/wiki/CURL')} %>
+<%= raw I18n.t 'rest_help.notes.curl_description',
+ curl: link_to(I18n.t('rest_help.curl_link_text'), 'http://en.wikipedia.org/wiki/CURL') %>
diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md
index ab3a3778..5d788103 100644
--- a/doc/CHANGELOG.md
+++ b/doc/CHANGELOG.md
@@ -2,6 +2,10 @@ See doc/upgrading.md for the upgrade documentation!
## Version 2.6
+## New features
+
+* Ruby 3.0 is now supported.
+
## Removed features
* No longer supporting EOL Ruby 2.5
diff --git a/test-envs/docker-compose-2.5-mysql.yml b/test-envs/docker-compose-3.0-mysql.yml
similarity index 95%
rename from test-envs/docker-compose-2.5-mysql.yml
rename to test-envs/docker-compose-3.0-mysql.yml
index 249e1f35..2cd0413f 100644
--- a/test-envs/docker-compose-2.5-mysql.yml
+++ b/test-envs/docker-compose-3.0-mysql.yml
@@ -10,7 +10,7 @@ services:
web:
build:
context: ..
- dockerfile: Dockerfile-2.5
+ dockerfile: Dockerfile-3.0
environment:
# These are set in script/ci-build, so we need to pass-thru them.
RAILS_ENV: $RAILS_ENV
diff --git a/test-envs/docker-compose-3.0-postgres.yml b/test-envs/docker-compose-3.0-postgres.yml
new file mode 100644
index 00000000..0c6d9b03
--- /dev/null
+++ b/test-envs/docker-compose-3.0-postgres.yml
@@ -0,0 +1,32 @@
+version: '3'
+services:
+ db:
+ image: postgres:13
+ environment:
+ POSTGRES_DB: ${DATABASE_NAME:-tracks}
+ POSTGRES_PASSWORD: password
+ volumes:
+ - db-data:/var/lib/postgresql/data
+ web:
+ build:
+ context: ..
+ dockerfile: Dockerfile-3.0
+ environment:
+ # These are set in script/ci-build, so we need to pass-thru them.
+ RAILS_ENV: $RAILS_ENV
+ DATABASE_NAME: $DATABASE_NAME
+ DATABASE_USERNAME: postgres
+ DATABASE_PASSWORD: password
+ DATABASE_TYPE: postgresql
+ DATABASE_ENCODING: unicode
+ DATABASE_PORT: 5432
+ volumes:
+ - ${VOLUME:-..}:/app:Z
+ - ${VOLUME:-..}/config/database.docker.yml:/app/config/database.yml:Z
+ - ${VOLUME:-..}/config/site.docker.yml:/app/config/site.yml:Z
+ ports:
+ - 3000:3000
+ depends_on:
+ - db
+volumes:
+ db-data:
diff --git a/test-envs/docker-compose-3.0-sqlite.yml b/test-envs/docker-compose-3.0-sqlite.yml
new file mode 100644
index 00000000..ba4d3709
--- /dev/null
+++ b/test-envs/docker-compose-3.0-sqlite.yml
@@ -0,0 +1,17 @@
+version: '3'
+services:
+ web:
+ build:
+ context: ..
+ dockerfile: Dockerfile-3.0
+ environment:
+ # These are set in script/ci-build, so we need to pass-thru them.
+ RAILS_ENV: $RAILS_ENV
+ DATABASE_NAME: "/app/db.sqlite"
+ DATABASE_TYPE: sqlite3
+ volumes:
+ - ${VOLUME:-..}:/app:Z
+ - ${VOLUME:-..}/config/database.docker.yml:/app/config/database.yml:Z
+ - ${VOLUME:-..}/config/site.docker.yml:/app/config/site.yml:Z
+ ports:
+ - 3000:3000
diff --git a/test/helpers/rendering_helper_test.rb b/test/helpers/rendering_helper_test.rb
index 8aae34e9..14740710 100644
--- a/test/helpers/rendering_helper_test.rb
+++ b/test/helpers/rendering_helper_test.rb
@@ -28,7 +28,7 @@ class RenderingHelperTest < ActionView::TestCase
end
test "message link" do
- expected = 'Call message://<123>.
'
+ expected = 'Call message://<123>.
'
actual = render_text("Call message://<123>.")
assert_equal(expected, actual)
end