Skip to content

Commit bab2e8c

Browse files
committed
Remove leaderboards (Issue #163)
1 parent 18bceea commit bab2e8c

File tree

21 files changed

+1
-531
lines changed

21 files changed

+1
-531
lines changed

apps/web/assets/stylesheets/_leaderboard.scss

Lines changed: 0 additions & 137 deletions
This file was deleted.

apps/web/assets/stylesheets/main.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@import 'leaderboard';
21
@import 'settings';
32
@import 'buttons';
43
@import 'labels';

apps/web/config/routes.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
root to: 'main#index'
22

3-
get '/leaderboards', to: 'leaderboards#index'
4-
53
get '/about', to: 'static#about', as: 'about'
64
get '/how-to-help', to: 'static#help', as: 'help'
75

apps/web/controllers/leaderboards/index.rb

Lines changed: 0 additions & 19 deletions
This file was deleted.

apps/web/templates/leaderboards/index.html.slim

Lines changed: 0 additions & 30 deletions
This file was deleted.

apps/web/views/leaderboards/index.rb

Lines changed: 0 additions & 14 deletions
This file was deleted.

config/sidekiq.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
:schedule:
22
RefreshUserReposWorker:
33
every: 12h
4-
CalculatePointsWorker:
5-
every: 12h

lib/container.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
%w[markdown http_request].each { |file| require_relative "ossboard/core/#{file}" }
55

66
%w[
7-
analytic_reporter url_shortener points_calculator task_tweeter
7+
analytic_reporter url_shortener task_tweeter
88
].each { |file| require_relative "ossboard/services/#{file}" }
99

1010
require_relative 'tasks/matchers/git_host'
@@ -19,7 +19,6 @@ class Container
1919

2020
namespace('services') do
2121
register('analytic_reporter', Services::AnalyticReporter.new)
22-
register('points_calculator', Services::PointsCalculator.new)
2322
register('task_twitter', Services::TaskTwitter.new)
2423
register('url_shortener', Services::UrlShortener.new)
2524
end

lib/ossboard/entities/point.rb

Lines changed: 0 additions & 2 deletions
This file was deleted.

lib/ossboard/entities/user.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class User < Hanami::Entity
1313
attribute :created_at_day, Types::Date
1414

1515
attribute :tasks, Types::Collection(Task)
16-
attribute :points, Types::Collection(Point)
1716
attribute :repos, Types::Collection(Repo)
1817
attribute :accounts, Types::Collection(Account)
1918
end

lib/ossboard/repositories/point_repository.rb

Lines changed: 0 additions & 2 deletions
This file was deleted.

lib/ossboard/repositories/user_repository.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ class UserRepository < Hanami::Repository
33
has_many :tasks
44
has_many :accounts
55
has_many :repos
6-
has_many :points
76
end
87

98
def admins
@@ -35,10 +34,6 @@ def find_with_tasks(id)
3534
aggregate(:tasks).where(id: id).map_to(User).one
3635
end
3736

38-
def all_with_points_and_tasks
39-
aggregate(:points, :tasks).map_to(User).to_a
40-
end
41-
4237
private
4338

4439
def all_from_date_request(from)

lib/ossboard/services/points_calculator.rb

Lines changed: 0 additions & 32 deletions
This file was deleted.

lib/ossboard/workers/calculate_points_worker.rb

Lines changed: 0 additions & 9 deletions
This file was deleted.

spec/ossboard/entities/point_spec.rb

Lines changed: 0 additions & 3 deletions
This file was deleted.

spec/ossboard/repositories/point_repository_spec.rb

Lines changed: 0 additions & 2 deletions
This file was deleted.

spec/ossboard/repositories/user_repository_spec.rb

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,23 +89,4 @@
8989
it { expect(subject.tasks).to be_a Array }
9090
it { expect(subject.tasks.count).to eq 1 }
9191
end
92-
93-
describe '#all_with_points_and_tasks' do
94-
let(:task_repo) { TaskRepository.new }
95-
96-
let(:user) { Fabricate.create(:user, uuid: 'test') }
97-
98-
before do
99-
Fabricate.create(:task, title: 'bad', user_id: user.id )
100-
Fabricate.create(:task, title: 'good', approved: true)
101-
end
102-
103-
subject { repo.all_with_points_and_tasks }
104-
105-
it { expect(subject).to be_a Array }
106-
107-
it { expect(subject[0]).to be_a User }
108-
it { expect(subject[0].points).to be_a Array }
109-
it { expect(subject[0].tasks).to be_a Array }
110-
end
11192
end

0 commit comments

Comments
 (0)