Skip to content

Commit

Permalink
Merge pull request #47328 from zzak/horo-canonical-url
Browse files Browse the repository at this point in the history
Add HORO_CANONICAL_URL to api docs generator
  • Loading branch information
zzak committed Mar 6, 2023
2 parents c06e61f + 3b36f1f commit 09f5d81
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions railties/lib/rails/api/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def setup_horo_variables # :nodoc:
ENV["HORO_PROJECT_NAME"] = "Ruby on Rails"
ENV["HORO_PROJECT_VERSION"] = rails_version
ENV["HORO_BADGE_VERSION"] = badge_version
ENV["HORO_CANONICAL_URL"] = canonical_url
end

def api_main
Expand Down Expand Up @@ -197,6 +198,10 @@ def rails_version
def badge_version
"edge"
end

def canonical_url
"https://edgeapi.rubyonrails.org"
end
end

class StableTask < RepoTask
Expand All @@ -207,6 +212,10 @@ def rails_version
def badge_version
"v#{rails_version}"
end

def canonical_url
"https://api.rubyonrails.org/#{badge_version}"
end
end
end
end

0 comments on commit 09f5d81

Please sign in to comment.