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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1afd814d055b5a9ce037f53e475a2f1122d60fc64cb7dc66589707a70f83c72
4
- data.tar.gz: 9ab5ac143a1cbdd5e0ad1154da7df5d6a610d353125080f3fa713760b7d622de
3
+ metadata.gz: bc124483195c06cf33bf27f455441909cd2b2c125b267a55accc3648a7578719
4
+ data.tar.gz: 6e8c63c1dd6af7720411e7df5df9e29097c6527ac8a924830873fe87a6ba8686
5
5
  SHA512:
6
- metadata.gz: 6634d7a63968fd6ec802be5c4469662716b5a5a9659e93041069a484791367ea8f8b09d8219d395f9e7683bbb4171b8db8a4fe35c3293f1981642f010caeb90f
7
- data.tar.gz: 86aa9223741d003012de4b5c1ac88cc6d2b8a2cb2ca23a1fd535b0e7a01c4475849c3c7fe4cdce40610667d85786eb6ca8bd91fa826a5c584ee6d6af199a570d
6
+ metadata.gz: ab495d8e8baffff929cdafd9546b1232656a73cec3065ea2d72fdff6966267681b130a7991aafab699be1301c2641ce9278ceea803fdabcb9ceb6ee24ece72dd
7
+ data.tar.gz: 7eb34685b1ae105e99a625995987605f2481f4251a80942681bf3988bda36f3f1ed1da5e5a0e53ced8d97a28da61565707de27e7944ffc89a3089d8038eccdf5
@@ -2,7 +2,7 @@ sudo: false
2
2
  language: ruby
3
3
  rvm:
4
4
  - 2.6.3
5
- before_install: gem install bundler -v 1.14.2
5
+ before_install: gem install bundler -v 2.0.2
6
6
  deploy:
7
7
  provider: rubygems
8
8
  api_key:
@@ -51,6 +51,7 @@ end
51
51
 
52
52
  require_relative './platform/notifiable'
53
53
 
54
+ require_relative './platform/global'
54
55
  require_relative './platform/domain'
55
56
  require_relative './platform/model'
56
57
  require_relative './platform/locale'
@@ -1,5 +1,11 @@
1
1
  module Mumukit::Platform::Course
2
+ extend Mumukit::Platform::Global
3
+
2
4
  def self.find_by_slug!(slug)
3
5
  Mumukit::Platform.course_class.find_by_slug!(slug)
4
6
  end
7
+
8
+ def self.__global_thread_variable_key__
9
+ :course
10
+ end
5
11
  end
@@ -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
- def self.switch!(organization)
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
 
@@ -50,7 +50,7 @@ module Mumukit::Platform::OrganizationMapping
50
50
  end
51
51
 
52
52
  def self.organization_name(request, _domain)
53
- request.path.split('/')[1]
53
+ request.path_info.split('/')[1]
54
54
  end
55
55
 
56
56
  def self.organic_uri(uri, organization)
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Platform
3
- VERSION = '5.1.0'
3
+ VERSION = '5.2.0'
4
4
  end
5
5
  end
@@ -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', '~> 1.14'
31
- spec.add_development_dependency 'rake', '~> 10.0'
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.1.0
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: 2019-07-12 00:00:00.000000000 Z
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: '1.14'
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: '1.14'
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: '10.0'
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: '10.0'
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.4
188
+ rubygems_version: 3.0.8
188
189
  signing_key:
189
190
  specification_version: 4
190
191
  summary: Shared Mumuki Platform Components