Skip to content

Commit 7849c6d

Browse files
committed
Fix Ruby 2.5 CI by avoiding dependency on psych
Otherwise rdoc pulls Psych 5.x and that breaks bundler itself.
1 parent 63c702f commit 7849c6d

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
ruby-version:
16-
# - '2.5', # 2.5 is broken in ruby/setup-ruby. It ships with a very old bundler but Pysch 5.x and crash.
16+
- '2.5',
1717
- '2.6',
1818
- '2.7',
1919
- '3.0',
@@ -30,6 +30,7 @@ jobs:
3030
with:
3131
ruby-version: ${{ matrix.ruby-version }}
3232
bundler-cache: true
33+
cache-version: 2
3334
- name: Run tests
3435
run: bundle exec rake --trace
3536
env:

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ end
77

88
group :development do
99
gem 'rake', :require => false
10-
gem 'rdoc'
10+
gem 'rdoc' unless ENV['CI'] # Avoid dependency on psych for Ruby 2.5 compatibility
1111
gem 'test-unit'
1212
gem 'pry'
1313
gem 'rack', '~> 2.2'

Rakefile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
require 'bundler/setup'
22
require 'rake/testtask'
3-
require 'rdoc/task'
43
require 'bundler/gem_tasks'
54

65
task :default => :test
@@ -13,13 +12,17 @@ Rake::TestTask.new('test') do |test|
1312
test.test_files = Dir.glob('test/test_*.rb')
1413
end
1514

16-
Rake::RDocTask.new("doc") do |rdoc|
17-
load 'lib/httpclient/version.rb'
18-
rdoc.rdoc_dir = 'doc'
19-
rdoc.title = "HTTPClient Library Document: Version #{HTTPClient::VERSION}"
20-
rdoc.rdoc_files.include('README.txt')
21-
rdoc.rdoc_files.include('lib/httpclient/*.rb')
22-
rdoc.rdoc_files.include('lib/httpclient.rb')
15+
unless ENV['CI']
16+
require 'rdoc/task'
17+
18+
Rake::RDocTask.new("doc") do |rdoc|
19+
load 'lib/httpclient/version.rb'
20+
rdoc.rdoc_dir = 'doc'
21+
rdoc.title = "HTTPClient Library Document: Version #{HTTPClient::VERSION}"
22+
rdoc.rdoc_files.include('README.txt')
23+
rdoc.rdoc_files.include('lib/httpclient/*.rb')
24+
rdoc.rdoc_files.include('lib/httpclient.rb')
25+
end
2326
end
2427

2528
task 'tags' do

0 commit comments

Comments
 (0)