mumuki-bibliotheca 6.4.0 → 6.4.1
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/bibliotheca/events/events.rb} +0 -0
- data/lib/mumuki/bibliotheca/version.rb +1 -1
- data/lib/tasks/content.rake +8 -6
- data/lib/tasks/events.rake +9 -7
- data/lib/tasks/guides.rake +23 -26
- 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: 1cd83a3fcbc452a652eb52308e58c80cff92b80d617fb8245eeba0846127ed90
|
4
|
+
data.tar.gz: 3079fe15d2186e9ead02feec86a6d27648ad141aac0e1238f2532a90fbe21b44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9871740c88c16a67dd461b62e5d25fc0025342b2530f8572e960676ea233b97bc3d18f94c4f9ddf6a6ae240cf007b159141ce020f6c1d763b0da98ce37017eb
|
7
|
+
data.tar.gz: 1b5181057011b9cf8d3d82e40ac2e9ea539612634f1442c185013b317db6cdc9c936790c02c6f3f0c87ea3a5e4bec8136c0528f048b5b73b7c377bcada4beb9c
|
File without changes
|
data/lib/tasks/content.rake
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
namespace :
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
namespace :bibliotheca do
|
2
|
+
namespace :content do
|
3
|
+
task :import do
|
4
|
+
bridge = Mumukit::Platform.bibliotheca_bridge
|
5
|
+
bridge.import_contents! do |resource_type, slug|
|
6
|
+
resource = bridge.send(resource_type, slug)
|
6
7
|
|
7
|
-
|
8
|
+
Bibliotheca::Collection.insert_hash! resource_type, resource
|
9
|
+
end
|
8
10
|
end
|
9
11
|
end
|
10
12
|
end
|
data/lib/tasks/events.rake
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
logger = Mumukit::Nuntius::Logger
|
2
|
-
namespace :
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
namespace :bibliotheca do
|
3
|
+
namespace :events do
|
4
|
+
task listen: :environment do
|
5
|
+
logger.info 'Loading event handlers....'
|
6
|
+
require_relative '../mumuki/bibliotheca/events/events'
|
7
|
+
logger.info "Loaded handlers #{Mumukit::Nuntius::EventConsumer.handled_events}!"
|
7
8
|
|
8
|
-
|
9
|
-
|
9
|
+
logger.info 'Listening to events...'
|
10
|
+
Mumukit::Nuntius::EventConsumer.start!
|
11
|
+
end
|
10
12
|
end
|
11
13
|
end
|
data/lib/tasks/guides.rake
CHANGED
@@ -1,36 +1,33 @@
|
|
1
|
-
namespace :
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
namespace :bibliotheca do
|
2
|
+
namespace :guides do
|
3
|
+
def guides_for_organization(org)
|
4
|
+
Octokit.auto_paginate = true
|
5
|
+
Octokit.repos(org).map(&:full_name).select { |it| it =~ /guia/ }
|
6
|
+
end
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
task :export, [:author_email] do |_t, args|
|
9
|
+
author_email = args[:author_email]
|
10
|
+
Bibliotheca::Collection::Guides.all.each do |it|
|
11
|
+
it.export! author_email rescue (puts "ignoring #{it.slug}")
|
12
|
+
end
|
11
13
|
end
|
12
|
-
end
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
task :import_from_github, [:organization, :url] do |_t, args|
|
16
|
+
args.with_defaults(url: 'http://localhost:3004')
|
16
17
|
|
17
|
-
|
18
|
-
|
18
|
+
org = args[:organization]
|
19
|
+
url = args[:url]
|
19
20
|
|
20
|
-
|
21
|
+
puts "importing guides from organization #{org} into #{url}"
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
guides_for_organization(org).each do |slug|
|
24
|
+
puts "importing guide #{slug}...."
|
25
|
+
begin
|
26
|
+
RestClient.post "#{url}/guides/import/#{slug}", {}
|
27
|
+
rescue => e
|
28
|
+
puts "import failed! #{e.response}"
|
29
|
+
end
|
28
30
|
end
|
29
31
|
end
|
30
32
|
end
|
31
33
|
end
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
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.4.
|
4
|
+
version: 6.4.1
|
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
|
@@ -160,9 +160,9 @@ files:
|
|
160
160
|
- README.md
|
161
161
|
- Rakefile
|
162
162
|
- config/routes.rb
|
163
|
-
- lib/events.rb
|
164
163
|
- lib/mumuki/bibliotheca.rb
|
165
164
|
- lib/mumuki/bibliotheca/engine.rb
|
165
|
+
- lib/mumuki/bibliotheca/events/events.rb
|
166
166
|
- lib/mumuki/bibliotheca/sinatra.rb
|
167
167
|
- lib/mumuki/bibliotheca/sinatra/books.rb
|
168
168
|
- lib/mumuki/bibliotheca/sinatra/guides.rb
|
@@ -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.3
|
197
197
|
signing_key:
|
198
198
|
specification_version: 4
|
199
199
|
summary: API for editing content on mumuki
|