mumukit-platform 2.7.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4674e22f2ac37e9d5c43ae6b7a2136f3695192813677eeed02990c55e6673d1a
4
- data.tar.gz: c2ae3de0955f92cc46d65ee90a0f46046b46f576a268606c8a175cac4f360baa
3
+ metadata.gz: d0bcd9af2725a5e0ad248a2315cead3ca98b37e9a055a575c589a9993a1d911d
4
+ data.tar.gz: 63d88b251ede6678845e78ae3b0893959bba9d142ad52388312f8fcdac30fe0f
5
5
  SHA512:
6
- metadata.gz: 4fcb02e58c711f49984bfafc3929c4cca1b182735ef8a9533a2a564bc6d021089e71b2c4e3ce8008f56449b219abbaed27ebb2d2325b05eb33b19e7f8529a2a9
7
- data.tar.gz: 639052fcfebe94565a3eec4060b45e88374a6d6ad0232eb98d21e1679444f1473241e528635951977cff19a39f52e3520c82120d80f96176e0b7f50e6c05bb94
6
+ metadata.gz: dec4847ca7a0ce8fd9333e69e9edafa3b56aedcb102555fef9bc2bcda0c798ee5813ed093f368de869a141639ad13906166c12f0477148f680f1e7124e594f51
7
+ data.tar.gz: ef717a1fcf9cdc805f7ea10e5b8216df34b4f8dbd152b9f578026a30979c6fb8da22965bf1758302f58fbc5008639fcc019e76e160839ce2641920652a613467
@@ -7,57 +7,3 @@ module Mumukit::Platform
7
7
  Mumukit::Bridge::Thesaurus.new(config.thesaurus_url)
8
8
  end
9
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 whose slug matches the given regex, 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!(slug_regex = /.*/, &block)
44
- %w(guide topic book).each do |resource_type|
45
- import_content!(resource_type, slug_regex) { |slug| block.call(resource_type, slug) }
46
- end
47
- end
48
-
49
- # Import all the contents of a given type, that matches a given slug
50
- def import_content!(resource_type, slug_regex = /.*/, &block)
51
- send(resource_type.to_s.pluralize).each do |resource|
52
- slug = resource['slug']
53
- next unless slug_regex.matches? slug
54
-
55
- puts "Importing #{resource_type} #{slug}"
56
- begin
57
- block.call slug
58
- rescue => e
59
- puts "Ignoring #{slug} because of import error #{e}"
60
- end
61
- end
62
- end
63
- end
@@ -26,7 +26,7 @@ module Mumukit::Platform::Course::Helpers
26
26
  json.slice(:slug, :shifts, :code, :days, :period, :description)
27
27
  end
28
28
 
29
- def as_platform_json
29
+ def to_resource_h
30
30
  {
31
31
  slug: slug,
32
32
  shifts: shifts,
@@ -8,6 +8,6 @@ module Mumukit::Platform::Notifiable
8
8
  end
9
9
 
10
10
  def as_platform_event
11
- { platform_class_name.downcase => as_platform_json }
11
+ { platform_class_name.downcase => to_resource_h }
12
12
  end
13
13
  end
@@ -82,7 +82,7 @@ module Mumukit::Platform::Organization::Helpers
82
82
  json.slice(:name, :book, :profile, :settings, :theme)
83
83
  end
84
84
 
85
- def as_platform_json
85
+ def to_resource_h
86
86
  {
87
87
  name: name,
88
88
  book: book.slug,
@@ -101,7 +101,7 @@ module Mumukit::Platform::User::Helpers
101
101
  json.slice(:uid, :social_id, :image_url, :email, :first_name, :last_name, :permissions)
102
102
  end
103
103
 
104
- def as_platform_json
104
+ def to_resource_h
105
105
  {
106
106
  uid: uid,
107
107
  social_id: social_id,
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Platform
3
- VERSION = '2.7.1'
3
+ VERSION = '3.0.0'
4
4
  end
5
5
  end
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: 2.7.1
4
+ version: 3.0.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-10-23 00:00:00.000000000 Z
11
+ date: 2018-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit-nuntius
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  version: '0'
186
186
  requirements: []
187
187
  rubyforge_project:
188
- rubygems_version: 2.7.7
188
+ rubygems_version: 2.7.8
189
189
  signing_key:
190
190
  specification_version: 4
191
191
  summary: Shared Mumuki Platform Components