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 end
group :doc do group :doc do
gem "sdoc", ">= 2.3.2" gem "sdoc", ">= 2.4.0"
gem "redcarpet", "~> 3.2.3", platforms: :ruby gem "redcarpet", "~> 3.2.3", platforms: :ruby
gem "w3c_validators", "~> 1.3.6" gem "w3c_validators", "~> 1.3.6"
gem "kindlerb", "~> 1.2.0" gem "kindlerb", "~> 1.2.0"

View File

@ -456,7 +456,7 @@ GEM
rubyzip (2.3.2) rubyzip (2.3.2)
rufus-scheduler (3.6.0) rufus-scheduler (3.6.0)
fugit (~> 1.1, >= 1.1.6) fugit (~> 1.1, >= 1.1.6)
sdoc (2.3.2) sdoc (2.4.0)
rdoc (>= 5.0) rdoc (>= 5.0)
selenium-webdriver (4.1.0) selenium-webdriver (4.1.0)
childprocess (>= 0.5, < 5.0) childprocess (>= 0.5, < 5.0)
@ -613,7 +613,7 @@ DEPENDENCIES
rubocop-packaging rubocop-packaging
rubocop-performance rubocop-performance
rubocop-rails rubocop-rails
sdoc (>= 2.3.2) sdoc (>= 2.4.0)
selenium-webdriver (>= 4.0.0) selenium-webdriver (>= 4.0.0)
sequel sequel
sidekiq 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: def setup_horo_variables # :nodoc:
ENV["HORO_PROJECT_NAME"] = "Ruby on Rails" ENV["HORO_PROJECT_NAME"] = "Ruby on Rails"
ENV["HORO_PROJECT_VERSION"] = rails_version ENV["HORO_PROJECT_VERSION"] = rails_version
ENV["HORO_BADGE_VERSION"] = badge_version
end end
def api_main def api_main
@ -192,12 +193,20 @@ module Rails
def rails_version def rails_version
"main@#{`git rev-parse HEAD`[0, 7]}" "main@#{`git rev-parse HEAD`[0, 7]}"
end end
def badge_version
"edge"
end
end end
class StableTask < RepoTask class StableTask < RepoTask
def rails_version def rails_version
File.read("RAILS_VERSION").strip File.read("RAILS_VERSION").strip
end end
def badge_version
"v#{rails_version}"
end
end end
end end
end end