Skip to content

Commit 3b36f1f

Browse files
committed
Add HORO_CANONICAL_URL to api docs generator
1 parent bba0db7 commit 3b36f1f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

railties/lib/rails/api/task.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def setup_horo_variables # :nodoc:
167167
ENV["HORO_PROJECT_NAME"] = "Ruby on Rails"
168168
ENV["HORO_PROJECT_VERSION"] = rails_version
169169
ENV["HORO_BADGE_VERSION"] = badge_version
170+
ENV["HORO_CANONICAL_URL"] = canonical_url
170171
end
171172

172173
def api_main
@@ -197,6 +198,10 @@ def rails_version
197198
def badge_version
198199
"edge"
199200
end
201+
202+
def canonical_url
203+
"https://edgeapi.rubyonrails.org"
204+
end
200205
end
201206

202207
class StableTask < RepoTask
@@ -207,6 +212,10 @@ def rails_version
207212
def badge_version
208213
"v#{rails_version}"
209214
end
215+
216+
def canonical_url
217+
"https://api.rubyonrails.org/#{badge_version}"
218+
end
210219
end
211220
end
212221
end

0 commit comments

Comments
 (0)