mumuki-bibliotheca 6.2.0 → 6.2.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 +1 -1
- data/lib/mumuki/bibliotheca.rb +10 -0
- data/lib/mumuki/bibliotheca/sinatra.rb +7 -0
- data/lib/mumuki/bibliotheca/sinatra/books.rb +1 -1
- data/lib/mumuki/bibliotheca/sinatra/guides.rb +1 -1
- data/lib/mumuki/bibliotheca/sinatra/topics.rb +1 -1
- data/lib/mumuki/bibliotheca/version.rb +1 -1
- data/lib/tasks/events.rake +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c49be8ab2a2941f9bb2c48cd13eff5da71860392c15991f358ce89ec488cdee0
|
4
|
+
data.tar.gz: 54660a3c891a128a9284c32e38521c468a2bd3fda037dcaeef83c65c0626baad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74d17df501da0253d8b8cf23af42ab6c36971b8ddac92b955ad20f6c18d4dc50b5a0b1f9999a0247b7053960c48d63b4ddfff770884bcc33375e86e84cde89cd
|
7
|
+
data.tar.gz: b8e8d51b6139d6a7cf0e1fd541d64a8d7ea3f9c81974c98a5104bede941d1f0a82b5a46a2fdc62ad3d81d4af2335be0c704dc8d71d82094463f8bfd5311c635c
|
data/lib/events.rb
CHANGED
@@ -4,7 +4,7 @@ Mumukit::Nuntius::EventConsumer.handle do
|
|
4
4
|
# * new logins in classroom
|
5
5
|
# * user creation and modification in laboratory
|
6
6
|
# * user creation and modification in classroom
|
7
|
-
event :UserChanged do |
|
7
|
+
event :UserChanged do |payload|
|
8
8
|
User.import_from_resource_h! payload.deep_symbolize_keys[:user]
|
9
9
|
end
|
10
10
|
|
data/lib/mumuki/bibliotheca.rb
CHANGED
@@ -8,6 +8,16 @@ require 'mumukit/login'
|
|
8
8
|
require 'mumukit/nuntius'
|
9
9
|
require 'mumukit/platform'
|
10
10
|
|
11
|
+
module Mumukit::Nuntius
|
12
|
+
def self.notify_content_change_event!(content_kind, slug)
|
13
|
+
notify_event! content_change_event_name(content_kind), slug: slug.to_s
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.content_change_event_name(content_kind)
|
17
|
+
"#{content_kind.to_s.camelize}Changed"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
11
21
|
Mumukit::Nuntius.configure do |c|
|
12
22
|
c.app_name = 'bibliotheca'
|
13
23
|
end
|
@@ -131,6 +131,13 @@ HTML
|
|
131
131
|
Mumuki::Bibliotheca.api_syncer(json_body)
|
132
132
|
end
|
133
133
|
|
134
|
+
def upsert_and_notify!(content_kind)
|
135
|
+
resource_h = upsert! content_kind
|
136
|
+
|
137
|
+
Mumukit::Nuntius.notify_content_change_event! content_kind, slug.to_s
|
138
|
+
resource_h
|
139
|
+
end
|
140
|
+
|
134
141
|
def upsert!(content_kind)
|
135
142
|
authorize! :writer
|
136
143
|
content = api_syncer.locate_and_import! content_kind, slug.to_s
|
data/lib/tasks/events.rake
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-bibliotheca
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.2.
|
4
|
+
version: 6.2.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: 2018-12-
|
11
|
+
date: 2018-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 6.2.
|
75
|
+
version: 6.2.2
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 6.2.
|
82
|
+
version: 6.2.2
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: mumukit-login
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
195
|
requirements: []
|
196
|
-
rubygems_version: 3.0.
|
196
|
+
rubygems_version: 3.0.1
|
197
197
|
signing_key:
|
198
198
|
specification_version: 4
|
199
199
|
summary: API for editing content on mumuki
|