Use the CSS badge for the API docs as well

Sdoc 2.4.0 supports a CSS badge that can be set by passing the version
as the HORO_BADGE_VERSION env variable.

The old badge image can be removed, as it no longer needs to be copied
by the docs server: https://github.com/rails/rails-docs-server/pull/28
This commit is contained in:
Petrik 2022-05-10 21:02:17 +02:00
parent 88c0e2c950
commit 55073ac10f
4 changed files with 12 additions and 3 deletions

View File

@ -44,7 +44,7 @@ group :rubocop do
end
group :doc do
gem "sdoc", ">= 2.3.2"
gem "sdoc", ">= 2.4.0"
gem "redcarpet", "~> 3.2.3", platforms: :ruby
gem "w3c_validators", "~> 1.3.6"
gem "kindlerb", "~> 1.2.0"

View File

@ -456,7 +456,7 @@ GEM
rubyzip (2.3.2)
rufus-scheduler (3.6.0)
fugit (~> 1.1, >= 1.1.6)
sdoc (2.3.2)
sdoc (2.4.0)
rdoc (>= 5.0)
selenium-webdriver (4.1.0)
childprocess (>= 0.5, < 5.0)
@ -613,7 +613,7 @@ DEPENDENCIES
rubocop-packaging
rubocop-performance
rubocop-rails
sdoc (>= 2.3.2)
sdoc (>= 2.4.0)
selenium-webdriver (>= 4.0.0)
sequel
sidekiq

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -166,6 +166,7 @@ module Rails
def setup_horo_variables # :nodoc:
ENV["HORO_PROJECT_NAME"] = "Ruby on Rails"
ENV["HORO_PROJECT_VERSION"] = rails_version
ENV["HORO_BADGE_VERSION"] = badge_version
end
def api_main
@ -192,12 +193,20 @@ module Rails
def rails_version
"main@#{`git rev-parse HEAD`[0, 7]}"
end
def badge_version
"edge"
end
end
class StableTask < RepoTask
def rails_version
File.read("RAILS_VERSION").strip
end
def badge_version
"v#{rails_version}"
end
end
end
end