-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<% @meta_title = "Open Sustain Dependencies" %> | ||
|
||
<div class="container-sm"> | ||
<h1 class='mb-3'> | ||
Open Sustain Dependencies | ||
</h1> | ||
|
||
<p class='lead'> | ||
The most used dependencies in Open Sustain projects. | ||
</p> | ||
|
||
<div class="card mb-3 d-flex"> | ||
<div class="card-header"> | ||
Most used dependencies across all categories | ||
</div> | ||
<ul class="list-group list-group-flush"> | ||
<% @dependencies.each do |dependency, count| %> | ||
<li class="list-group-item"> | ||
<%= dependency[0] %> : <%= dependency[1] %> | ||
<small class='ps-3 text-muted'> | ||
<i><%= pluralize count, 'dependent project' %></i> | ||
</small> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
|
||
<% top_dependencies = @dependencies.map(&:first) %> | ||
|
||
<% @projects.group_by(&:category).each do |category, projects|%> | ||
<div class="card mb-3 d-flex"> | ||
<div class="card-header"> | ||
Most used dependencies in <%= category %> | ||
</div> | ||
<ul class="list-group list-group-flush"> | ||
<% dependencies = projects.map(&:dependency_packages).flatten(1).group_by(&:itself).transform_values(&:count).sort_by{|k,v| v}.reverse %> | ||
<% filtered_dependencies = dependencies.reject{|p| top_dependencies.include? p[0]}.first(50) %> | ||
<% filtered_dependencies.each do |dependency, count| %> | ||
<% next if count < 2 %> | ||
<li class="list-group-item"> | ||
<%= dependency[0] %> : <%= dependency[1] %> | ||
|
||
<small class='ps-3 text-muted'> | ||
<i><%= pluralize count, 'dependent project' %></i> | ||
</small> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ | |
collection do | ||
post :lookup | ||
get :review | ||
get :dependencies | ||
end | ||
resources :votes, only: [:create] | ||
end | ||
|