cancel-in-progress: true
env:
os: ubuntu-22.04
- ruby: '3.0'
+ ruby: '3.1'
jobs:
rubocop:
name: RuboCop
name: Ubuntu ${{ matrix.ubuntu }}, Ruby ${{ matrix.ruby }}
strategy:
matrix:
- ubuntu: [20.04, 22.04]
- ruby: ['3.0', '3.1', '3.2', '3.3']
+ ubuntu: [22.04, 24.04]
+ ruby: ['3.1', '3.2', '3.3']
runs-on: ubuntu-${{ matrix.ubuntu }}
env:
RAILS_ENV: test
- rubocop-rake
AllCops:
- TargetRubyVersion: 3.0
+ TargetRubyVersion: 3.1
NewCops: enable
Exclude:
- 'vendor/**/*'
gem "marcel"
# Used for browser detection
-gem "browser", "< 6" # for ruby 3.0 support
+gem "browser", "< 6" # for ruby 3.1 support
# Used for S3 object storage
gem "aws-sdk-s3"
# Used to validate widths
gem "unicode-display_width"
-# Keep ruby 3.0 compatibility
-gem "multi_xml", "~> 0.6.0"
-
# Gems useful for development
group :development do
gem "better_errors"
minitest (>= 4, < 6)
msgpack (1.7.2)
multi_json (1.15.0)
- multi_xml (0.6.0)
+ multi_xml (0.7.1)
+ bigdecimal (~> 3.1)
mutex_m (0.2.0)
net-http (0.4.1)
uri
minitest (~> 5.1)
minitest-focus
multi_json
- multi_xml (~> 0.6.0)
omniauth (~> 2.0.2)
omniauth-facebook
omniauth-github
* **Vagrant** This installs the software into a virtual machine. For Vagrant instructions see [VAGRANT.md](VAGRANT.md).
* **Docker** This installs the software using containerization. For Docker instructions see [DOCKER.md](DOCKER.md).
-These instructions are based on Ubuntu 22.04 LTS, which is the platform used by the OSMF servers.
+These instructions are based on Ubuntu 24.04 LTS, which is the platform used by the OSMF servers.
The instructions also work, with only minor amendments, for all other current Ubuntu releases, Fedora and MacOSX
We don't recommend attempting to develop or deploy this software on Windows. Some Ruby gems may not be supported. If you need to use Windows the easiest solutions in order are [Docker](DOCKER.md), [Vagrant](VAGRANT.md), and Ubuntu in a virtual machine.
## Minimum requirements
-* Ruby 3.0+
+* Ruby 3.1+
* PostgreSQL 13+
* Bundler (see note below about [developer Ruby setup](#rbenv))
* Javascript Runtime
-These can be installed on Ubuntu 22.04 or later with:
+These can be installed on Ubuntu 24.04 or later with:
```
sudo apt-get update
Vagrant.configure("2") do |config|
# use official ubuntu image for virtualbox
config.vm.provider "virtualbox" do |vb, override|
- override.vm.box = "ubuntu/jammy64"
+ override.vm.box = "ubuntu/noble64"
override.vm.synced_folder ".", "/srv/openstreetmap-website"
vb.customize ["modifyvm", :id, "--memory", "4096"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
# use third party image and sshfs or NFS sharing for lxc
config.vm.provider "lxc" do |_, override|
- override.vm.box = "generic/ubuntu2204"
+ override.vm.box = "generic/ubuntu2404"
override.vm.synced_folder ".", "/srv/openstreetmap-website", :type => sharing_type
end
# use third party image and sshfs or NFS sharing for libvirt
config.vm.provider "libvirt" do |_, override|
- override.vm.box = "generic/ubuntu2204"
+ override.vm.box = "generic/ubuntu2404"
override.vm.synced_folder ".", "/srv/openstreetmap-website", :type => sharing_type
end
##
# wrap an api call in a timeout
- def api_call_timeout(&block)
- Timeout.timeout(Settings.api_timeout, &block)
+ def api_call_timeout(&)
+ Timeout.timeout(Settings.api_timeout, &)
rescue ActionView::Template::Error => e
e = e.cause
##
# wrap a web page in a timeout
- def web_timeout(&block)
+ def web_timeout(&)
raise Timeout::Error if Settings.web_timeout.negative?
- Timeout.timeout(Settings.web_timeout, &block)
+ Timeout.timeout(Settings.web_timeout, &)
rescue ActionView::Template::Error => e
e = e.cause
t "printable_name.version", :version => object.version
end
- def element_strikethrough(object, &block)
+ def element_strikethrough(object, &)
if object.redacted? || !object.visible?
- tag.s(&block)
+ tag.s(&)
else
yield
end
)
end
- def message_body(&block)
+ def message_body(&)
render(
:partial => "message_body",
- :locals => { :body => capture(&block) }
+ :locals => { :body => capture(&) }
)
end
end
end
- def with_recipient_locale(recipient, &block)
- I18n.with_locale(Locale.available.preferred(recipient.preferred_languages), &block)
+ def with_recipient_locale(recipient, &)
+ I18n.with_locale(Locale.available.preferred(recipient.preferred_languages), &)
end
def from_address(name, type, id, token, user_id = nil)
end
# Successively yields all the paginator's pages to the given block.
- def each(&_block)
+ def each(&)
page_count.times do |n|
yield self[n + 1]
end
click_on "Logout", :match => :first
end
- def within_sidebar(&block)
- within "#sidebar_content", &block
+ def within_sidebar(&)
+ within("#sidebar_content", &)
end
end
Settings.merge!(saved_settings)
end
- def with_user_account_deletion_delay(value, &block)
+ def with_user_account_deletion_delay(value, &)
freeze_time
- with_settings(:user_account_deletion_delay => value, &block)
+ with_settings(:user_account_deletion_delay => value, &)
ensure
unfreeze_time
end