mumukit-platform 5.1.0 → 5.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/lib/mumukit/platform.rb +1 -0
- data/lib/mumukit/platform/course.rb +6 -0
- data/lib/mumukit/platform/global.rb +19 -0
- data/lib/mumukit/platform/locale.rb +1 -0
- data/lib/mumukit/platform/organization.rb +4 -16
- data/lib/mumukit/platform/organization_mapping.rb +1 -1
- data/lib/mumukit/platform/version.rb +1 -1
- data/mumukit-platform.gemspec +2 -2
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc124483195c06cf33bf27f455441909cd2b2c125b267a55accc3648a7578719
|
4
|
+
data.tar.gz: 6e8c63c1dd6af7720411e7df5df9e29097c6527ac8a924830873fe87a6ba8686
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab495d8e8baffff929cdafd9546b1232656a73cec3065ea2d72fdff6966267681b130a7991aafab699be1301c2641ce9278ceea803fdabcb9ceb6ee24ece72dd
|
7
|
+
data.tar.gz: 7eb34685b1ae105e99a625995987605f2481f4251a80942681bf3988bda36f3f1ed1da5e5a0e53ced8d97a28da61565707de27e7944ffc89a3089d8038eccdf5
|
data/.travis.yml
CHANGED
data/lib/mumukit/platform.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
module Mumukit::Platform::Global
|
2
|
+
def switch!(global)
|
3
|
+
raise "#{__global_thread_variable_key__} must not be nil" unless global
|
4
|
+
Thread.current[__global_thread_variable_key__] = global
|
5
|
+
end
|
6
|
+
|
7
|
+
def leave!
|
8
|
+
Thread.current[__global_thread_variable_key__] = nil
|
9
|
+
end
|
10
|
+
|
11
|
+
def current
|
12
|
+
Thread.current[__global_thread_variable_key__] || raise("#{__global_thread_variable_key__} not selected")
|
13
|
+
end
|
14
|
+
|
15
|
+
def current?
|
16
|
+
!!Thread.current[__global_thread_variable_key__]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
@@ -2,6 +2,7 @@ module Mumukit::Platform::Locale
|
|
2
2
|
SPECS = {
|
3
3
|
en: { facebook_code: :en_US, auth0_code: :en, name: 'English' },
|
4
4
|
es: { facebook_code: :es_LA, auth0_code: :es, name: 'Español' },
|
5
|
+
'es-CL': { facebook_code: :es_LA, auth0_code: :es, name: 'Español chileno' },
|
5
6
|
pt: { facebook_code: :pt_BR, auth0_code: 'pt-br', name: 'Português' }
|
6
7
|
}.with_indifferent_access
|
7
8
|
|
@@ -1,20 +1,5 @@
|
|
1
1
|
module Mumukit::Platform::Organization
|
2
|
-
|
3
|
-
raise 'Organization must not be nil' unless organization
|
4
|
-
Thread.current[:organization] = organization
|
5
|
-
end
|
6
|
-
|
7
|
-
def self.leave!
|
8
|
-
Thread.current[:organization] = nil
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.current
|
12
|
-
Thread.current[:organization] || raise('organization not selected')
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.current?
|
16
|
-
!!Thread.current[:organization]
|
17
|
-
end
|
2
|
+
extend Mumukit::Platform::Global
|
18
3
|
|
19
4
|
def self.current_locale
|
20
5
|
Thread.current[:organization]&.locale || 'en'
|
@@ -24,6 +9,9 @@ module Mumukit::Platform::Organization
|
|
24
9
|
Mumukit::Platform.organization_class.find_by_name!(name)
|
25
10
|
end
|
26
11
|
|
12
|
+
def self.__global_thread_variable_key__
|
13
|
+
:organization
|
14
|
+
end
|
27
15
|
|
28
16
|
## Name validation
|
29
17
|
|
data/mumukit-platform.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_dependency 'mumukit-bridge', '>= 3.5', '< 5'
|
28
28
|
spec.add_dependency 'activemodel', '>= 4.0'
|
29
29
|
|
30
|
-
spec.add_development_dependency 'bundler', '~>
|
31
|
-
spec.add_development_dependency 'rake', '~>
|
30
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
31
|
+
spec.add_development_dependency 'rake', '~> 12.3'
|
32
32
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
33
33
|
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: 5.
|
4
|
+
version: 5.2.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:
|
11
|
+
date: 2020-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit-nuntius
|
@@ -92,28 +92,28 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
95
|
+
version: '2.0'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
102
|
+
version: '2.0'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: rake
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
109
|
+
version: '12.3'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: '
|
116
|
+
version: '12.3'
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
118
|
name: rspec
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,6 +151,7 @@ files:
|
|
151
151
|
- lib/mumukit/platform/bridge.rb
|
152
152
|
- lib/mumukit/platform/course.rb
|
153
153
|
- lib/mumukit/platform/domain.rb
|
154
|
+
- lib/mumukit/platform/global.rb
|
154
155
|
- lib/mumukit/platform/locale.rb
|
155
156
|
- lib/mumukit/platform/model.rb
|
156
157
|
- lib/mumukit/platform/notifiable.rb
|
@@ -184,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
185
|
- !ruby/object:Gem::Version
|
185
186
|
version: '0'
|
186
187
|
requirements: []
|
187
|
-
rubygems_version: 3.0.
|
188
|
+
rubygems_version: 3.0.8
|
188
189
|
signing_key:
|
189
190
|
specification_version: 4
|
190
191
|
summary: Shared Mumuki Platform Components
|