Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.

Commit 1fa133e

Browse files
authored
Add test coverage for Ruby 3.0.x and drop 2.5.x (#221)
* Update targeted version to 2.6 * Set Bundler version to < 2.2 * Formatting updates for Rubocop
1 parent 452a120 commit 1fa133e

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

.github/workflows/warclight-build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,19 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
ruby: [2.7, 2.6, 2.5]
14+
ruby: [2.6, 2.7, 3.0]
1515
steps:
1616
- uses: actions/checkout@v2
1717
- name: Setup Ruby
1818
uses: ruby/setup-ruby@v1
1919
with:
2020
ruby-version: ${{ matrix.ruby }}
21+
- name: Setup Bundler (< 2.2)
22+
run: gem uninstall bundler; gem install bundler -v '< 2.2'
2123
- name: Setup Node
2224
run: npm install
25+
- name: Bundler version
26+
run: which bundle; bundle --version
2327
- name: Setup Warclight
2428
run: bundle install
2529
- name: Run tests

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ AllCops:
1010
- 'db/**/*'
1111
- 'lib/generators/warclight/templates/**/*'
1212
- 'vendor/**/*'
13-
TargetRubyVersion: 2.4
13+
TargetRubyVersion: 2.6
1414
DisplayCopNames: true
1515

1616
Rails:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Ruest, Nick, Milligan, Ian, and Lin, Jimmy. [Warclight: A Rails Engine for Web A
1313

1414
## Requirements
1515

16-
* [Ruby](https://www.ruby-lang.org/en/) 2.4+ or later
17-
* [Bundler](https://bundler.io/)
16+
* [Ruby](https://www.ruby-lang.org/en/) 2.6+ or later
17+
* [Bundler](https://bundler.io/) < 2.2
1818
* [Rails](http://rubyonrails.org) 5.1+ or later
1919

2020
## Installation

app/helpers/warclight_helper.rb

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55
module WarclightHelper
66
def url_to_link(options = {})
77
safe_join(options[:value].map do |url|
8-
begin
9-
res = Net::HTTP.get_response(URI(url))
10-
if res.code.start_with?('1', '2', '3')
11-
link_to(url, url, target: '_blank', rel: 'noopener') << ' 🔗'
12-
else
13-
url + ' (Not available)'
14-
end
15-
rescue
8+
res = Net::HTTP.get_response(URI(url))
9+
if res.code.start_with?('1', '2', '3')
10+
link_to(url, url, target: '_blank', rel: 'noopener') << ' 🔗'
11+
else
1612
url + ' (Not available)'
1713
end
14+
rescue
15+
url + ' (Not available)'
1816
end, '')
1917
end
2018

warclight.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
1313
s.homepage = 'https://github.com/archivesunleashed/warclight'
1414
s.summary = 'A Rails engine supporting discovery of web archives.'
1515
s.license = 'Apache-2.0'
16-
s.required_ruby_version = '>= 2.4'
16+
s.required_ruby_version = '>= 2.6'
1717

1818
s.files = `git ls-files -z`.split("\x0").reject do |f|
1919
f.match(%r{^(test|spec|features)/})
@@ -22,9 +22,9 @@ Gem::Specification.new do |s|
2222
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
2323
s.require_paths = ['lib']
2424

25-
s.add_dependency 'blacklight', '7.19.2'
25+
s.add_dependency 'blacklight', '~> 7.2'
2626
s.add_dependency 'blacklight_range_limit', '8.0.0'
27-
s.add_dependency 'rails', '~> 5.0'
27+
s.add_dependency 'rails', '>= 5.1', '< 6.2'
2828
s.add_dependency 'sprockets', '< 4.0'
2929

3030
s.add_development_dependency 'bundler', '> 1.14'

0 commit comments

Comments
 (0)