mumukit-platform 0.1.0 → 0.1.1
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 +4 -4
- data/lib/mumukit/platform.rb +3 -10
- data/lib/mumukit/platform/domain.rb +9 -0
- data/lib/mumukit/platform/organization_mapping.rb +10 -2
- data/lib/mumukit/platform/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e279cf66b86c01b1ef8a679f28e735a674dc0d62
|
|
4
|
+
data.tar.gz: 34a0ed5c9e8ebfbab74db60a908882b9129aec8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 97daabdb3988020b9e88958c04a61e072af7db9c603110cb37435af4e0a0e268b2d2a6fd399c78568d1e17538b118a71456f1e2c7cd9b97ab653ae6d1a13d7b0
|
|
7
|
+
data.tar.gz: 1d4d2a21c9c68b0417d5d3eff597da5035a494208fa0eaf8e6ef44912a01566d7a4e9caa1e3679f202033ff1335843e7da207b0aa0bfdc7b357cd7e10f1b048f
|
data/lib/mumukit/platform.rb
CHANGED
|
@@ -11,7 +11,7 @@ module Mumukit::Platform
|
|
|
11
11
|
|
|
12
12
|
def self.defaults
|
|
13
13
|
struct.tap do |config|
|
|
14
|
-
domain =
|
|
14
|
+
domain = Mumukit::Platform::Domain.from_env
|
|
15
15
|
|
|
16
16
|
config.laboratory_url = ENV['MUMUKI_LABORATORY_URL'] || "http://#{domain}"
|
|
17
17
|
config.thesaurus_url = ENV['MUMUKI_THESAURUS_URL'] || "http://thesaurus.#{domain}"
|
|
@@ -24,21 +24,14 @@ module Mumukit::Platform
|
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
def self.platform_domain_from_env
|
|
28
|
-
if ENV['RACK_ENV'] == 'test' || ENV['RAILS_ENV'] == 'test'
|
|
29
|
-
'localmumuki.io'
|
|
30
|
-
else
|
|
31
|
-
ENV['MUMUKI_PLATFORM_DOMAIN'] || 'mumuki.io'
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
27
|
def self.config
|
|
36
28
|
@config
|
|
37
29
|
end
|
|
38
30
|
end
|
|
39
31
|
|
|
40
|
-
require_relative './platform/
|
|
32
|
+
require_relative './platform/domain'
|
|
41
33
|
require_relative './platform/organization_mapping'
|
|
34
|
+
require_relative './platform/application'
|
|
42
35
|
require_relative './platform/web_framework'
|
|
43
36
|
require_relative './platform/with_applications'
|
|
44
37
|
require_relative './platform/with_organization_mapping'
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
module Mumukit::Platform::OrganizationMapping
|
|
2
2
|
def self.from_env
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
if ENV['RACK_ENV'] == 'test' || ENV['RAILS_ENV'] == 'test'
|
|
4
|
+
Subdomain
|
|
5
|
+
else
|
|
6
|
+
parse ENV['MUMUKI_ORGANIZATION_MAPPING']
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def self.parse(name)
|
|
11
|
+
mapping = name.try { |it| it.strip.downcase }
|
|
12
|
+
if mapping.blank? || mapping == 'subdomain'
|
|
5
13
|
Subdomain
|
|
6
14
|
elsif mapping == 'path'
|
|
7
15
|
Path
|
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: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
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: 2017-
|
|
11
|
+
date: 2017-05-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: mumukit-core
|
|
@@ -85,6 +85,7 @@ files:
|
|
|
85
85
|
- bin/setup
|
|
86
86
|
- lib/mumukit/platform.rb
|
|
87
87
|
- lib/mumukit/platform/application.rb
|
|
88
|
+
- lib/mumukit/platform/domain.rb
|
|
88
89
|
- lib/mumukit/platform/organization_mapping.rb
|
|
89
90
|
- lib/mumukit/platform/uri.rb
|
|
90
91
|
- lib/mumukit/platform/version.rb
|
|
@@ -112,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
112
113
|
version: '0'
|
|
113
114
|
requirements: []
|
|
114
115
|
rubyforge_project:
|
|
115
|
-
rubygems_version: 2.5
|
|
116
|
+
rubygems_version: 2.4.5
|
|
116
117
|
signing_key:
|
|
117
118
|
specification_version: 4
|
|
118
119
|
summary: Shared Mumuki Platform Components
|