mumukit-platform 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7c6f05e41c271fe32105e06c439445f7a1f9023ec462669ac8baf3711056f49
4
- data.tar.gz: 7ba162eb3644b300a73a8c78a16cc619b84968213ee1218e474c93d496b3e3d7
3
+ metadata.gz: 175ab021309d43bccf5714079497aa7046c50979e51dc30ef80aa1dbbc2ed43d
4
+ data.tar.gz: 66c552fcce96910b6d9df81baffb96e39e1aa585606d75c029a04e2ba99ffc6b
5
5
  SHA512:
6
- metadata.gz: 693094d9e0f01aeef8e3daa5ea04f5c49c3b5e66efb742113256159bbc908f0dcb22c809f566179479ec97b84c697ce991c6527ad0dea1c13619b441755d725c
7
- data.tar.gz: b058099e7dd793da249646d4ba73e83884cee10cce64a39d1f06cfe7ae16f128642a6fe5879c8c0f2e9ef5c73b320a8dc8958810ceebfe19f92bc74c2add8236
6
+ metadata.gz: f3f01970a9dc73b681ec3216f2ece5114fcc029c8654ce0ce49f99691c45b0769ba83fd0ed63a8feacbab0d7e341ce28c44b4e1cee61cac43a620cca049a2dd1
7
+ data.tar.gz: cc6728259a088b3c41f1e896aa59631adf6ca02dbdc87d7556315bec936fe19c9b81728d3db9232dca23383b0b44e0d42e4acc19fa51e7b46985b7bdf0a43059
data/.gitignore CHANGED
@@ -8,6 +8,7 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .idea
11
+ nuntius.log
11
12
 
12
13
  # rspec failure tracking
13
14
  .rspec_status
@@ -1,6 +1,7 @@
1
1
  require 'mumukit/core'
2
2
  require 'mumukit/auth'
3
3
  require 'mumukit/nuntius'
4
+ require 'mumukit/bridge'
4
5
 
5
6
  require_relative './platform/version'
6
7
  require_relative './platform/uri'
@@ -53,6 +54,7 @@ require_relative './platform/organization'
53
54
  require_relative './platform/organization_mapping'
54
55
  require_relative './platform/application'
55
56
  require_relative './platform/web_framework'
57
+ require_relative './platform/bridge'
56
58
 
57
59
  require_relative './platform/with_organization'
58
60
  require_relative './platform/with_applications'
@@ -0,0 +1,61 @@
1
+ module Mumukit::Platform
2
+ def self.bibliotheca_bridge
3
+ Mumukit::Bridge::Bibliotheca.new(config.bibliotheca_api_url)
4
+ end
5
+
6
+ def self.thesaurus_bridge
7
+ Mumukit::Bridge::Thesaurus.new(config.thesaurus_url)
8
+ end
9
+ end
10
+
11
+ class Mumukit::Bridge::Thesaurus
12
+
13
+ # Import all the languages the runners suppor,
14
+ # using a block that will do the actual
15
+ # persistence job.
16
+ #
17
+ # The block takes the language's runner's url (string).
18
+ #
19
+ # Exceptions raised within the block will be ignored
20
+ def import_languages!(&block)
21
+ runners.each do |url|
22
+ puts "Importing Language #{url}"
23
+ begin
24
+ block.call url
25
+ rescue => e
26
+ puts "Ignoring Language #{url} because of import error #{e}"
27
+ end
28
+ end
29
+ end
30
+ end
31
+
32
+ class Mumukit::Bridge::Bibliotheca
33
+
34
+ # Import all the contents, using a block that will do the actual
35
+ # persistence job.
36
+ #
37
+ # The block takes:
38
+ #
39
+ # * a resource_type (string): guide | topic | book
40
+ # * a slug (string)
41
+ #
42
+ # Exceptions raised within the block will be ignored
43
+ def import_contents!(&block)
44
+ %w(guide topic book).each do |resource_type|
45
+ import_content!(resource_type) { |slug| block.call(resource_type, slug) }
46
+ end
47
+ end
48
+
49
+ # Import all the contents of a given type
50
+ def import_content!(resource_type, &block)
51
+ send(resource_type.to_s.pluralize).each do |resource|
52
+ slug = resource['slug']
53
+ puts "Importing #{resource_type} #{slug}"
54
+ begin
55
+ block.call slug
56
+ rescue => e
57
+ puts "Ignoring #{slug} because of import error #{e}"
58
+ end
59
+ end
60
+ end
61
+ end
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Platform
3
- VERSION = '1.5.0'
3
+ VERSION = '1.6.0'
4
4
  end
5
5
  end
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency 'mumukit-nuntius', '~> 6.0'
25
25
  spec.add_dependency 'mumukit-core', '~> 1.2'
26
26
  spec.add_dependency 'mumukit-auth', '~> 7.0'
27
+ spec.add_dependency 'mumukit-bridge', '~> 3.5'
27
28
  spec.add_dependency 'activemodel', '>= 4.0'
28
29
 
29
30
  spec.add_development_dependency 'bundler', '~> 1.14'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-platform
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-11 00:00:00.000000000 Z
11
+ date: 2018-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit-nuntius
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '7.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: mumukit-bridge
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.5'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.5'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: activemodel
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -128,6 +142,7 @@ files:
128
142
  - bin/setup
129
143
  - lib/mumukit/platform.rb
130
144
  - lib/mumukit/platform/application.rb
145
+ - lib/mumukit/platform/bridge.rb
131
146
  - lib/mumukit/platform/course.rb
132
147
  - lib/mumukit/platform/course/helpers.rb
133
148
  - lib/mumukit/platform/domain.rb
@@ -170,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
185
  version: '0'
171
186
  requirements: []
172
187
  rubyforge_project:
173
- rubygems_version: 2.7.6
188
+ rubygems_version: 2.7.7
174
189
  signing_key:
175
190
  specification_version: 4
176
191
  summary: Shared Mumuki Platform Components