mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-27 20:38:48 +01:00
Merge pull request #2704 from TracksApp/ruby-update
Ruby 3.0 compatibility and testing
This commit is contained in:
commit
dfef3f31da
12 changed files with 95 additions and 42 deletions
2
.github/workflows/continuous-integration.yml
vendored
2
.github/workflows/continuous-integration.yml
vendored
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
2
Gemfile
2
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'
|
||||
|
|
|
|||
18
Gemfile.lock
18
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -64,10 +64,10 @@
|
|||
<li>/projects/<code><%= t('rest_help.id') %></code>/todos.xml</li>
|
||||
</ul>
|
||||
|
||||
<p><%= raw t('rest_help.retrieve.limit', {
|
||||
<p><%= raw t('rest_help.retrieve.limit',
|
||||
fields: '<code>ID, created_at, modified_at, completed_at</code>',
|
||||
limit_parameter: '<code>limit_fields</code>',
|
||||
set_to: '<code>index</code>'}) %></p>
|
||||
set_to: '<code>index</code>') %></p>
|
||||
|
||||
<pre>
|
||||
<code>
|
||||
|
|
@ -87,10 +87,10 @@
|
|||
|
||||
<h2><%= t('rest_help.writing.title') %></h2>
|
||||
|
||||
<p><%= raw t('rest_help.writing.description', {
|
||||
<p><%= raw t('rest_help.writing.description',
|
||||
put: '<code>PUT</code>',
|
||||
post: '<code>POST</code>',
|
||||
delete: '<code>DELETE</code>'}) %></p>
|
||||
delete: '<code>DELETE</code>') %></p>
|
||||
|
||||
<p><%= t('rest_help.writing.example_title') %></p>
|
||||
|
||||
|
|
@ -105,9 +105,9 @@ Location: <%= root_url %>projects/65.xml
|
|||
</code>
|
||||
</pre>
|
||||
|
||||
<p><%= raw t('rest_help.writing.example_project_response_title', {
|
||||
<p><%= raw t('rest_help.writing.example_project_response_title',
|
||||
response_code: '<code>HTTP/1.1 201 Created</code>',
|
||||
header: '<code>Location</code>'}) %></p>
|
||||
header: '<code>Location</code>') %></p>
|
||||
|
||||
<pre>
|
||||
<code>
|
||||
|
|
@ -120,9 +120,9 @@ Location: <%= root_url %>todos/452.xml
|
|||
</code>
|
||||
</pre>
|
||||
|
||||
<p><%= raw t('rest_help.writing.example_todo_response_title', {
|
||||
<p><%= raw t('rest_help.writing.example_todo_response_title',
|
||||
response_code: '<code>HTTP/1.1 201 Created</code>',
|
||||
header: '<code>Location</code>'}) %></p>
|
||||
header: '<code>Location</code>') %></p>
|
||||
|
||||
<pre>
|
||||
<code>
|
||||
|
|
@ -143,8 +143,8 @@ Location: <%= root_url %>todos/452.xml
|
|||
</code>
|
||||
</pre>
|
||||
|
||||
<p><%= raw t('rest_help.writing.example_note_response_title', {
|
||||
response_code: '<code>HTTP/1.1 200 OK</code>'}) %></p>
|
||||
<p><%= raw t('rest_help.writing.example_note_response_title',
|
||||
response_code: '<code>HTTP/1.1 200 OK</code>') %></p>
|
||||
|
||||
<pre>
|
||||
<code>
|
||||
|
|
@ -164,8 +164,8 @@ Location: <%= root_url %>todos/452.xml
|
|||
</code>
|
||||
</pre>
|
||||
|
||||
<p><%= raw t('rest_help.writing.example_delete_title', {
|
||||
delete: '<code>DELETE</code>'}) %></p>
|
||||
<p><%= raw t('rest_help.writing.example_delete_title',
|
||||
delete: '<code>DELETE</code>') %></p>
|
||||
|
||||
<pre>
|
||||
<code>
|
||||
|
|
@ -176,15 +176,15 @@ Location: <%= root_url %>todos/452.xml
|
|||
</code>
|
||||
</pre>
|
||||
|
||||
<p><%= raw t('rest_help.writing.example_delete_response_title', {
|
||||
response_code: '<code>HTTP/1.1 200 OK</code>'}) %></p>
|
||||
<p><%= raw t('rest_help.writing.example_delete_response_title',
|
||||
response_code: '<code>HTTP/1.1 200 OK</code>') %></p>
|
||||
|
||||
<h2><%= t('rest_help.response.title') %></h2>
|
||||
|
||||
<p><%= raw t('rest_help.response.description', {
|
||||
<p><%= raw t('rest_help.response.description',
|
||||
response_200: '<code>200 OK</code>',
|
||||
response_201: '<code>201 Created</code>',
|
||||
example_call: '<code>GET /contexts/2/todos.xml</code>'}) %></p>
|
||||
example_call: '<code>GET /contexts/2/todos.xml</code>') %></p>
|
||||
|
||||
<p><%= t('rest_help.response.xml_description') %></p>
|
||||
|
||||
|
|
@ -200,11 +200,11 @@ $ curl -u username:p4ssw0rd -H "Content-Type: text/xml" \
|
|||
|
||||
<h2><%= t('rest_help.activeresource.title') %></h2>
|
||||
|
||||
<p><%= raw I18n.t 'rest_help.activeresource.description', {
|
||||
<p><%= 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: '<code>gem install activeresource --source http://gems.rubyonrails.org --include-dependencies</code>'
|
||||
} %></p>
|
||||
%></p>
|
||||
|
||||
<pre>
|
||||
<code>
|
||||
|
|
@ -226,8 +226,8 @@ Loading development environment (Rails 1.2.4)
|
|||
</code>
|
||||
</pre>
|
||||
|
||||
<p><%= raw I18n.t 'rest_help.activeresource.wrapper_description', {
|
||||
signals_link: link_to(I18n.t('rest_help.activeresource.signals_link_text'), 'http://www.37signals.com')} %></p>
|
||||
<p><%= raw I18n.t 'rest_help.activeresource.wrapper_description',
|
||||
signals_link: link_to(I18n.t('rest_help.activeresource.signals_link_text'), 'http://www.37signals.com') %></p>
|
||||
|
||||
<pre>
|
||||
<code>
|
||||
|
|
@ -246,13 +246,13 @@ irb(main):003:0>
|
|||
<p><%= t('rest_help.notes.description') %></p>
|
||||
|
||||
<ul>
|
||||
<li><%= raw I18n.t 'rest_help.notes.bullet1', {
|
||||
<li><%= raw I18n.t 'rest_help.notes.bullet1',
|
||||
id: '<code>ID</code>',
|
||||
url: '<span class="caps">URL</span>'} %></li>
|
||||
<li><%= raw I18n.t 'rest_help.notes.bullet2', {
|
||||
omit: '<code>...</code>' } %></li>
|
||||
url: '<span class="caps">URL</span>' %></li>
|
||||
<li><%= raw I18n.t 'rest_help.notes.bullet2',
|
||||
omit: '<code>...</code>' %></li>
|
||||
</ul>
|
||||
|
||||
<p><%= raw I18n.t 'rest_help.notes.curl_description', {
|
||||
curl: link_to(I18n.t('rest_help.curl_link_text'), 'http://en.wikipedia.org/wiki/CURL')} %></p>
|
||||
<p><%= raw I18n.t 'rest_help.notes.curl_description',
|
||||
curl: link_to(I18n.t('rest_help.curl_link_text'), 'http://en.wikipedia.org/wiki/CURL') %></p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
32
test-envs/docker-compose-3.0-postgres.yml
Normal file
32
test-envs/docker-compose-3.0-postgres.yml
Normal file
|
|
@ -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:
|
||||
17
test-envs/docker-compose-3.0-sqlite.yml
Normal file
17
test-envs/docker-compose-3.0-sqlite.yml
Normal file
|
|
@ -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
|
||||
|
|
@ -28,7 +28,7 @@ class RenderingHelperTest < ActionView::TestCase
|
|||
end
|
||||
|
||||
test "message link" do
|
||||
expected = '<p>Call <a href="message://%3C123%3E">message://<123></a>.</p>'
|
||||
expected = '<p>Call <a href="message://<123>">message://<123></a>.</p>'
|
||||
actual = render_text("Call message://<123>.")
|
||||
assert_equal(expected, actual)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue