forked from geminabox/geminabox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgem.erb
42 lines (39 loc) · 1.5 KB
/
gem.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<p>
<a href="/">Back to Gem Index</a>
</p>
<ul class="gemlist">
<% @gem.by_name do |name, versions| %>
<li class="gem-version">
<h2><%= h(name) %> (<%= h(versions.count == 1 ? versions.first.number : "#{versions.oldest.number} - #{versions.newest.number}") %>)</h2>
<% versions.each.reverse_each do |version| %>
<p>
<code>gem install <%= h(version.name) %> <%= "--prerelease" if version.number.to_s.match(/[a-z]/i) %> -v "<%= h(version.number) %>"</code>
<% unless version.platform =~ /^ruby/i %>
<small class="platform"><%= h(version.platform) %></small>
<% end %>
</p>
<div class="delete-form">
<a class="download" href="<%= h(url("/gems/#{version.gemfile_name}.gem")) %>">download</a>
<% if @allow_delete %>
<form method="post" action="<%= h(url("/gems/#{version.gemfile_name}.gem")) %>">
<input type="hidden" name="_method" value="DELETE" />
<button type="submit">delete</button>
</form>
<% end %>
</div>
<% end %>
<div class="details">
<p>
<% newest_gem = versions.newest %>
<% if spec = spec_for(name, newest_gem.number, newest_gem.platform) %>
<%= h(spec.description) %>
<br/>
<span class="author">– <%= spec.authors.map do |author|
"<a href='#{href(spec.homepage)}'>#{h(author)}</a>"
end.join(', ') %></span>
<% end %>
</p>
</div>
</li>
<% end %>
</ul>