Display summary and description #504

Closed
wants to merge 1 commit into from

2 participants

@rking

As a new gem author, I was pretty puzzled by the contrast between:

This patch takes into account the reality that many authors have been working around the current show logic by putting what should be in the description in the summary: it removes the 'summary' match from the 'description' output.

Thanks!

@sferik sferik commented on the diff Jan 3, 2013
app/models/version.rb
@@ -135,7 +135,26 @@ def yanked?
end
def info
- [ description, summary, "This rubygem does not have a description or summary." ].detect(&:present?)
@sferik
RubyGems member
sferik added a note Jan 3, 2013

If I'm reading this correctly, the existing code shows the description if both are present, not the summary.

@rking
rking added a note Jan 3, 2013

Yeah, I mis-typed. It's counterintuitive to show a summary iff it's the only thing, then discard it if there's a description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@sferik sferik commented on the diff Jan 3, 2013
app/views/rubygems/show.html.erb
@@ -8,7 +8,12 @@
<% else %>
<% if @latest_version.indexed %>
<div id="markup">
- <%= simple_markup(@latest_version.info) %>
+ <div id="gem_summary">
+ <%= simple_markup(@latest_version.summary_or_apology) %>
+ </div>
+ <div id="gem_description">
+ <%= simple_markup(@latest_version.description_or_apology) %>
+ </div>
@sferik
RubyGems member
sferik added a note Jan 3, 2013

I'm not sure we need to display both the summary and the description.

@rking
rking added a note Jan 3, 2013

I tried it out with a few existing gems (on my local server), and it seems to be an improvement.

@rking
rking added a note Jan 3, 2013

If this is not the desired behavior, then the "specification" doc should be updated to say something like, "The description takes precedence over the summary in cases where a longer description is needed", then people can start doing like:

gem.description = gem.summary + "\n…"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@rking

(I re-pushed without the spurious change to this file)

@qrush
RubyGems member

I think this is obsolete given the redesign. Please rebase/push again if not!

@qrush qrush closed this Nov 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment