Skip to content

Commit

Permalink
Remove unused code from OST
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Dec 15, 2024
1 parent 002ccae commit 74cb227
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 92 deletions.
4 changes: 0 additions & 4 deletions app/controllers/api/v1/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,4 @@ def ping
def packages
@projects = Project.all.active.select{|p| p.packages.present? }.sort_by{|p| p.packages.sum{|p| p['downloads'] || 0 } }.reverse
end

def images
@projects = Project.all.with_readme.select{|p| p.readme_image_urls.present? }
end
end
6 changes: 1 addition & 5 deletions app/controllers/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ def dependencies
end

def packages
@projects = Project.all.select{|p| p.packages.present? }.sort_by{|p| p.packages.sum{|p| p['downloads'] || 0 } }.reverse
end

def images
@projects = Project.all.with_readme.select{|p| p.readme_image_urls.present? }
@projects = Project.all.select{|p| p.packages.present? }.sort_by{|p| p.packages.sum{|p| p['downloads'] || 0 } }.select{|p| p.packages.sum{|p| p['downloads'] || 0 } > 1000}.reverse
end
end
2 changes: 1 addition & 1 deletion app/views/issues/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<div class="container-sm">
<h1 class='mb-3'>
Contribute to an Open Sustain Open Source Project
Contribute to an Ruby Open Source Project
</h1>

<p class='lead'>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
A summary of data about the Ruby ecosystem.
</p>
<p class='mt-0 mb-4'>
<%= link_to 'Browse projects', root_path %> | <%= link_to 'Open Issues', issues_path %> | <%= link_to 'Contributors', contributors_path %> | <%= link_to 'Recent Releases', releases_path %>
<%= link_to 'Browse projects', root_path %> | <%= link_to 'Open Issues', issues_path %> | <%= link_to 'Contributors', contributors_path %> | <%= link_to 'Recent Releases', releases_path %> | <%= link_to 'Dependencies', dependencies_projects_path %>
</p>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions app/views/projects/dependencies.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<% @meta_title = "Open Sustain Dependencies" %>
<% @meta_description = "Browse the most used dependencies in Open Sustain projects" %>
<% @meta_title = "Ruby Dependencies" %>
<% @meta_description = "Browse the most used dependencies in Ruby projects" %>

<div class="container-sm">
<h1 class='mb-3'>
Open Sustain Dependencies
Ruby Dependencies
</h1>

<p class='lead'>
The most used dependencies in Open Sustain projects.
The most used dependencies in Ruby projects.
</p>

<div class='row'>
Expand Down
20 changes: 0 additions & 20 deletions app/views/projects/images.html.erb

This file was deleted.

9 changes: 5 additions & 4 deletions app/views/projects/packages.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<% @meta_title = "Open Sustain Packages" %>
<% @meta_description = "The most popular packages published from Open Sustain projects" %>
<% @meta_title = "Ruby Packages" %>
<% @meta_description = "The most popular packages published from Ruby projects" %>

<div class="container-sm">
<h1 class='mb-3'>
Open Sustain Packages
Ruby Packages
</h1>

<p class='lead'>
The most popular packages published from Open Sustain projects.
The most popular packages published from Ruby projects.
</p>

<% @projects.each do |project|%>
Expand Down Expand Up @@ -62,6 +62,7 @@
<h4>Packages</h4>
<ul>
<% project.packages.sort_by{|p| p['downloads'] || 0 }.reverse.each do |package| %>
<% next unless package['downloads'] && package['downloads'] > 1000 %>
<li>
<%= package['registry']['name'] %>: <%= link_to package['name'], package['registry_url'] %>
<% if package['downloads']%>
Expand Down
31 changes: 0 additions & 31 deletions app/views/projects/review.html.erb

This file was deleted.

8 changes: 1 addition & 7 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,12 @@

namespace :api, :defaults => {:format => :json} do
namespace :v1 do
resources :issues do
collection do
get :openclimateaction
end
end
resources :issues
resources :jobs
resources :projects, constraints: { id: /.*/ }, only: [:index, :show] do
collection do
get :lookup
get :packages
get :images
end
member do
get :ping
Expand All @@ -40,7 +35,6 @@
get :lookup
get :dependencies
get :packages
get :images
end
resources :releases, only: [:index, :show]
end
Expand Down
15 changes: 0 additions & 15 deletions openapi/api/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,6 @@ paths:
type: array
items:
$ref: '#/components/schemas/Project'
/projects/images:
get:
description: get projects with images
operationId: getProjectImages
tags:
- projects
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Project'
/issues:
get:
description: get issues
Expand Down

0 comments on commit 74cb227

Please sign in to comment.