mumukit-platform 3.2.0 → 4.0.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: 032ec12800d859266098b83a96fff9a6a4d35182e9a2a26f91cf80e92fbf8102
4
- data.tar.gz: f0a74abb52b4c4e330b329fe0d2fb922e5fa67d9b1bee14cc33d56ddeea8e743
3
+ metadata.gz: 37d749c01796bf6f90b8f862490cfa60ce0ec6f599688c52d7cd67880de8343e
4
+ data.tar.gz: b49509bfff79f36916fb9c7ff41742ca8d2b8153b0b4c3ebec6810236f0fc2d8
5
5
  SHA512:
6
- metadata.gz: 7f427da93f053a976a91c43d9b6d5db46c736466a976309308df1049415d41dad0e77ec34cbad8a7d9419175a9b11d1d4cebe7922c3d04c23327ff09e0645dcc
7
- data.tar.gz: 697a8dbfffe6db844cfae5beb5d74e0f2af4196ac468070de510ff4a1fee3dbbd8d1e94427a079ee32787e45f1f1d92178af3aedbddd4ee89c735047c8b1dec4
6
+ metadata.gz: 481bd7a6f8b30aff029a1d812e78d53f4eedd4bbd62320c2e28e134bcf41685b460e4a6692c743229715093ed2ab89a0e038dab97af1cb5cc1c0de529d03413a
7
+ data.tar.gz: 4d57b6ba0ae70b58bf6ddd217d87ea84a27d5eb663f90e514ea25dc30689d11a5226525ff7afd97662080c65f244abaeece053e07f72775eec4d6fbaa1ff7fc2
@@ -17,9 +17,9 @@ module Mumukit::Platform
17
17
 
18
18
  config.laboratory_url = ENV['MUMUKI_LABORATORY_URL'] || "http://#{domain}"
19
19
  config.thesaurus_url = ENV['MUMUKI_THESAURUS_URL'] || "http://thesaurus.#{domain}"
20
- config.bibliotheca_url = ENV['MUMUKI_BIBLIOTHECA_URL'] || "http://bibliotheca.#{domain}"
20
+ config.bibliotheca_ui_url = ENV['MUMUKI_BIBLIOTHECA_UI_URL'] || "http://bibliotheca.#{domain}"
21
21
  config.bibliotheca_api_url = ENV['MUMUKI_BIBLIOTHECA_API_URL'] || "http://bibliotheca-api.#{domain}"
22
- config.classroom_url = ENV['MUMUKI_CLASSROOM_URL'] || "http://classroom.#{domain}"
22
+ config.classroom_ui_url = ENV['MUMUKI_CLASSROOM_UI_URL'] || "http://classroom.#{domain}"
23
23
  config.classroom_api_url = ENV['MUMUKI_CLASSROOM_API_URL'] || "http://classroom-api.#{domain}"
24
24
  config.organization_mapping = Mumukit::Platform::OrganizationMapping.from_env
25
25
  end
@@ -20,10 +20,10 @@ module Mumukit::Platform::Course::Helpers
20
20
  slug
21
21
  end
22
22
 
23
- ## Platform JSON
23
+ ## Resource Hash
24
24
 
25
- def self.slice_platform_json(json)
26
- json.slice(:slug, :shifts, :code, :days, :period, :description)
25
+ def self.slice_resource_h(resource_h)
26
+ resource_h.slice(:slug, :shifts, :code, :days, :period, :description)
27
27
  end
28
28
 
29
29
  def to_resource_h
@@ -34,10 +34,10 @@ module Mumukit::Platform::Course::Helpers
34
34
  days: days,
35
35
  period: period,
36
36
  description: description
37
- }.except(*protected_platform_fields).compact
37
+ }.except(*protected_resource_fields).compact
38
38
  end
39
39
 
40
- def protected_platform_fields
40
+ def protected_resource_fields
41
41
  []
42
42
  end
43
43
  end
@@ -12,10 +12,6 @@ module Mumukit::Platform::Organization
12
12
  Thread.current[:organization] || raise('organization not selected')
13
13
  end
14
14
 
15
- def self.current?
16
- !!Thread.current[:organization]
17
- end
18
-
19
15
  def self.current_locale
20
16
  Thread.current[:organization]&.locale || 'en'
21
17
  end
@@ -76,10 +76,10 @@ module Mumukit::Platform::Organization::Helpers
76
76
  /([-a-z0-9_]+(\.[-a-z0-9_]+)*)?/
77
77
  end
78
78
 
79
- ## Platform JSON
79
+ ## Resource Hash
80
80
 
81
- def self.slice_platform_json(json)
82
- json.slice(:name, :book, :profile, :settings, :theme)
81
+ def self.slice_resource_h(resource_h)
82
+ resource_h.slice(:name, :book, :profile, :settings, :theme)
83
83
  end
84
84
 
85
85
  def to_resource_h
@@ -89,10 +89,10 @@ module Mumukit::Platform::Organization::Helpers
89
89
  profile: profile,
90
90
  settings: settings,
91
91
  theme: theme
92
- }.except(*protected_platform_fields).compact
92
+ }.except(*protected_resource_fields).compact
93
93
  end
94
94
 
95
- def protected_platform_fields
95
+ def protected_resource_fields
96
96
  []
97
97
  end
98
98
 
@@ -2,8 +2,6 @@ module Mumukit::Platform::User::Helpers
2
2
  include Mumukit::Auth::Roles
3
3
  include Mumukit::Platform::Notifiable
4
4
 
5
- extend Gem::Deprecate
6
-
7
5
  ## Implementors must declare the following methods:
8
6
  #
9
7
  # * permissions
@@ -69,28 +67,22 @@ module Mumukit::Platform::User::Helpers
69
67
 
70
68
  ## Accesible organizations
71
69
 
72
- def student_granted_organizations
73
- permissions.student_granted_organizations.map do |org|
70
+ def accessible_organizations
71
+ permissions.accessible_organizations.map do |org|
74
72
  Mumukit::Platform::Organization.find_by_name!(org) rescue nil
75
73
  end.compact
76
74
  end
77
75
 
78
- def has_student_granted_organizations?
79
- student_granted_organizations.present?
80
- end
81
-
82
- [[:accessible_organizations, :student_granted_organizations],
83
- [:has_accessible_organizations?, :has_student_granted_organizations?]].each do |it, replacement|
84
- alias_method it, replacement
85
- deprecate it, replacement, 2019, 6
76
+ def has_accessible_organizations?
77
+ accessible_organizations.present?
86
78
  end
87
79
 
88
80
  def main_organization
89
- student_granted_organizations.first
81
+ accessible_organizations.first
90
82
  end
91
83
 
92
84
  def has_main_organization?
93
- student_granted_organizations.length == 1
85
+ accessible_organizations.length == 1
94
86
  end
95
87
 
96
88
  def has_immersive_main_organization?
@@ -103,10 +95,10 @@ module Mumukit::Platform::User::Helpers
103
95
  uid
104
96
  end
105
97
 
106
- ## Platform JSON
98
+ ## Resource Hash
107
99
 
108
- def self.slice_platform_json(json)
109
- json.slice(:uid, :social_id, :image_url, :email, :first_name, :last_name, :permissions)
100
+ def self.slice_resource_h(resource_h)
101
+ resource_h.slice(:uid, :social_id, :image_url, :email, :first_name, :last_name, :permissions)
110
102
  end
111
103
 
112
104
  def to_resource_h
@@ -118,10 +110,10 @@ module Mumukit::Platform::User::Helpers
118
110
  first_name: first_name,
119
111
  last_name: last_name,
120
112
  permissions: permissions
121
- }.except(*protected_platform_fields).compact
113
+ }.except(*protected_resource_fields).compact
122
114
  end
123
115
 
124
- def protected_platform_fields
116
+ def protected_resource_fields
125
117
  []
126
118
  end
127
119
  end
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Platform
3
- VERSION = '3.2.0'
3
+ VERSION = '4.0.0'
4
4
  end
5
5
  end
@@ -1,21 +1,20 @@
1
1
  module Mumukit::Platform::WithApplications
2
2
  delegate :application, to: :config
3
- delegate :url_for, :organic_url_for, to: :application
4
3
 
5
4
  def laboratory
6
5
  Mumukit::Platform::Application::Organic.new config.laboratory_url, organization_mapping
7
6
  end
8
7
 
9
- def classroom
10
- Mumukit::Platform::Application::Organic.new config.classroom_url, organization_mapping
8
+ def classroom_ui
9
+ Mumukit::Platform::Application::Organic.new config.classroom_ui_url, organization_mapping
11
10
  end
12
11
 
13
12
  def classroom_api
14
13
  Mumukit::Platform::Application::Organic.new config.classroom_api_url, organization_mapping
15
14
  end
16
15
 
17
- def bibliotheca
18
- Mumukit::Platform::Application::Basic.new config.bibliotheca_url
16
+ def bibliotheca_ui
17
+ Mumukit::Platform::Application::Basic.new config.bibliotheca_ui_url
19
18
  end
20
19
 
21
20
  def bibliotheca_api
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_dependency 'mumukit-nuntius', '~> 6.0'
25
25
  spec.add_dependency 'mumukit-core', '~> 1.2'
26
- spec.add_dependency 'mumukit-auth', '~> 7.6'
26
+ spec.add_dependency 'mumukit-auth', '~> 7.0'
27
27
  spec.add_dependency 'mumukit-bridge', '~> 3.5'
28
28
  spec.add_dependency 'activemodel', '>= 4.0'
29
29
 
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: 3.2.0
4
+ version: 4.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: 2019-03-14 00:00:00.000000000 Z
11
+ date: 2018-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit-nuntius
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '7.6'
47
+ version: '7.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '7.6'
54
+ version: '7.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mumukit-bridge
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -184,7 +184,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  - !ruby/object:Gem::Version
185
185
  version: '0'
186
186
  requirements: []
187
- rubygems_version: 3.0.3
187
+ rubyforge_project:
188
+ rubygems_version: 2.7.8
188
189
  signing_key:
189
190
  specification_version: 4
190
191
  summary: Shared Mumuki Platform Components