mumuki-laboratory 6.4.1 → 6.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/{events.rb → mumuki/laboratory/events/events.rb} +0 -0
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/lib/tasks/assignments.rake +23 -21
- data/lib/tasks/events.rake +9 -7
- data/lib/tasks/messages.rake +10 -8
- data/lib/tasks/users.rake +8 -6
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c70e70c721988ae2a17c12556ceb48438c3eb7d45e1c43f186f61f1db8a7eb68
|
4
|
+
data.tar.gz: 243fe0ce527986bbb37b0557cdfb1141762a183d139cebe670a9001fafc95e1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39077b3aabe2b22aa8c0e9aa4886e1ae1a9f196badbe84e5779c48fe85130870a13b499a27ee845160669231b60c7031957271d3407e247928f333f521699a00
|
7
|
+
data.tar.gz: ac16e9e2804ea667bf2cde6857b41bb7f11cdc3e759d058210bdd1e0075195f901d80b41a6cc9fb437f49d8933768fc64c03891f326942fdc52b304c650ef880
|
File without changes
|
data/lib/tasks/assignments.rake
CHANGED
@@ -1,27 +1,29 @@
|
|
1
|
-
namespace :
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
namespace :laboratory do
|
2
|
+
namespace :assignments do
|
3
|
+
task :notify_all, [:organization_name, :date_since] => :select_organization do |t, args|
|
4
|
+
args.with_defaults(date_since: '2014-01-01')
|
5
|
+
Organization.current.notify_recent_assignments! Date.parse(args[:date_since])
|
6
|
+
end
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
task :notify_user, [:organization_name, :user_uid] => :select_organization do |t, args|
|
9
|
+
user = User.find_by(uid: args[:user_uid])
|
10
|
+
puts "Found user #{user.name}."
|
10
11
|
|
11
|
-
|
12
|
-
|
12
|
+
Organization.current.notify_assignments_by! user
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
task :notify_recent, [:organization_name] => :select_organization do |t, args|
|
16
|
+
Organization
|
17
|
+
.current
|
18
|
+
.assignments
|
19
|
+
.where(submitter: User.where(last_organization: Organization.current))
|
20
|
+
.where('assignments.created_at > ?', 1.month.ago)
|
21
|
+
.each(&:notify!)
|
22
|
+
end
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
# This task should not be called directly (because it "does nothing"), it's just a prerrequisite for the others.
|
25
|
+
task :select_organization, [:organization_name] => :environment do |t, args|
|
26
|
+
Organization.find_by!(name: args[:organization_name]).switch!
|
27
|
+
end
|
26
28
|
end
|
27
29
|
end
|
data/lib/tasks/events.rake
CHANGED
@@ -5,13 +5,15 @@ module Mumukit::Nuntius::EventConsumer
|
|
5
5
|
end
|
6
6
|
|
7
7
|
logger = Mumukit::Nuntius::Logger
|
8
|
-
namespace :
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
namespace :laboratory do
|
9
|
+
namespace :events do
|
10
|
+
task listen: :environment do
|
11
|
+
logger.info 'Loading event handlers....'
|
12
|
+
require_relative '../mumuki/laboratory/events/events'
|
13
|
+
logger.info "Loaded handlers #{Mumukit::Nuntius::EventConsumer.handled_events}!"
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
logger.info 'Listening to events...'
|
16
|
+
Mumukit::Nuntius::EventConsumer.start!
|
17
|
+
end
|
16
18
|
end
|
17
19
|
end
|
data/lib/tasks/messages.rake
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
logger = Mumukit::Nuntius::Logger
|
2
2
|
|
3
|
-
namespace :
|
4
|
-
|
5
|
-
|
3
|
+
namespace :laboratory do
|
4
|
+
namespace :messages do
|
5
|
+
task listen: :environment do
|
6
|
+
logger.info 'Listening to messages'
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
Mumukit::Nuntius::Consumer.start 'teacher-messages', 'teacher-messages' do |_delivery_info, _properties, body|
|
9
|
+
begin
|
10
|
+
Message.import_from_resource_h!(body)
|
11
|
+
rescue ActiveRecord::RecordInvalid => e
|
12
|
+
logger.info e
|
13
|
+
end
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
data/lib/tasks/users.rake
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
namespace :
|
1
|
+
namespace :laboratory do
|
2
|
+
namespace :users do
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
task notify_reminder: :environment do
|
5
|
+
BATCH_SIZE = ENV['MUMUKI_JOB_BATCH_SIZE']&.to_i || 1000
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
User.remindable.find_each(batch_size: BATCH_SIZE) do |user|
|
8
|
+
user.try_remind_with_lock!
|
9
|
+
end if ApplicationMailer.environment_variables_set?
|
10
|
+
end
|
9
11
|
end
|
10
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-laboratory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.4.
|
4
|
+
version: 6.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -379,7 +379,6 @@ files:
|
|
379
379
|
- config/initializers/omniauth.rb
|
380
380
|
- config/initializers/session_store.rb
|
381
381
|
- config/routes.rb
|
382
|
-
- lib/events.rb
|
383
382
|
- lib/mumuki/laboratory.rb
|
384
383
|
- lib/mumuki/laboratory/controllers.rb
|
385
384
|
- lib/mumuki/laboratory/controllers/authorization.rb
|
@@ -392,6 +391,7 @@ files:
|
|
392
391
|
- lib/mumuki/laboratory/controllers/notifications.rb
|
393
392
|
- lib/mumuki/laboratory/controllers/results_rendering.rb
|
394
393
|
- lib/mumuki/laboratory/engine.rb
|
394
|
+
- lib/mumuki/laboratory/events/events.rb
|
395
395
|
- lib/mumuki/laboratory/extensions.rb
|
396
396
|
- lib/mumuki/laboratory/extensions/request.rb
|
397
397
|
- lib/mumuki/laboratory/locales/datetime.es.yml
|
@@ -557,7 +557,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
557
557
|
- !ruby/object:Gem::Version
|
558
558
|
version: '0'
|
559
559
|
requirements: []
|
560
|
-
rubygems_version: 3.0.
|
560
|
+
rubygems_version: 3.0.3
|
561
561
|
signing_key:
|
562
562
|
specification_version: 4
|
563
563
|
summary: Code assement web application for the Mumuki Platform.
|