Skip to content

Commit

Permalink
Aggregate guides for 1.12-1.14 to 1.15
Browse files Browse the repository at this point in the history
Guides for v1.15 are the latest one compatible with Ruby 1.8 while
ones for v1.16 were updated with Ruby 1.9 hash notation in PR #404.

#404

Signed-off-by: Takuya Noguchi <[email protected]>
  • Loading branch information
tnir committed Jul 6, 2022
1 parent 0f71541 commit 3ba7c4b
Show file tree
Hide file tree
Showing 14 changed files with 10 additions and 6,483 deletions.
8 changes: 8 additions & 0 deletions config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@
end
end

# Redirect old localizable guides (v1.12-v1.14) to the latest version (1.15) of guide compatible with Ruby 1.8.x
["", "pl/"].each do |lang|
%w[1.12 1.13 1.14].each do |version|
redirect "#{lang}v#{version}/guides/creating_gem.html", to: "#{lang}v1.15/guides/creating_gem.html"
redirect "#{lang}v#{version}/guides/using_bundler_in_applications.html", to: "#{lang}v1.15/using_bundler_in_applications.html"
end
end

redirect "sponsors.html", to: "https://rubygems.org/pages/sponsors" # Backwards compatibility

page '/conduct.html', layout: :guides_layout
Expand Down
3 changes: 2 additions & 1 deletion helpers/guides_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module GuidesHelper

def guides
guides = Dir.glob("./source/#{current_visible_version}/guides/*")
localizable_guides = Dir.glob("./source/localizable/#{current_visible_version}/guides/*.en.html.md")
target_version = current_visible_version > "v1.15" ? current_visible_version : "v1.15"
localizable_guides = Dir.glob("./source/localizable/#{target_version}/guides/*.en.html.md")
all_guides = guides + localizable_guides + ADDITIONAL_GUIDES

guides = all_guides.map do |filename|
Expand Down
Loading

0 comments on commit 3ba7c4b

Please sign in to comment.