Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edge guides don't properly link to the current GitHub tree #8221

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions guides/rails_guides/generator.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def set_flags_from_environment
@all = ENV['ALL'] == '1' @all = ENV['ALL'] == '1'
@kindle = ENV['KINDLE'] == '1' @kindle = ENV['KINDLE'] == '1'
@version = ENV['RAILS_VERSION'] || `git rev-parse --short HEAD`.chomp @version = ENV['RAILS_VERSION'] || `git rev-parse --short HEAD`.chomp
@full_version = ENV['RAILS_VERSION'] || `git rev-parse HEAD`.chomp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the short SHA is sent in the ENV variable, this is still a problem right? I 'd suggest to remove the ENV check for the full version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any time that ENV['rails_version'] would be passed when it wouldn't be a branch or tag name? Or rather, when it would be a short commit hash?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how it is set up on the docs server. @fxn can tell.

@lang = ENV['GUIDES_LANGUAGE'] @lang = ENV['GUIDES_LANGUAGE']
end end


Expand Down
2 changes: 1 addition & 1 deletion guides/source/_welcome.html.erb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</p> </p>
<% else %> <% else %>
<p> <p>
These are the new guides for Rails 3.2 based on <a href="https://github.com/rails/rails/tree/<%= @version %>"><%= @version %></a>. These are the new guides for Rails 3.2 based on <a href="https://github.com/rails/rails/tree/<%= @full_version %>"><%= @version %></a>.
These guides are designed to make you immediately productive with Rails, and to help you understand how all of the pieces fit together. These guides are designed to make you immediately productive with Rails, and to help you understand how all of the pieces fit together.
</p> </p>
<% end %> <% end %>
Expand Down