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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 024bf781a48ada1f1e2536ece324a305771a6d4d
4
- data.tar.gz: 69c6dfb30d9dcaf02fd59000c3dc5c8c4e2356be
3
+ metadata.gz: e279cf66b86c01b1ef8a679f28e735a674dc0d62
4
+ data.tar.gz: 34a0ed5c9e8ebfbab74db60a908882b9129aec8d
5
5
  SHA512:
6
- metadata.gz: 1e22b6cb08f1df7284ed97b60d66280f158e3bc892279614700b4952b23b6ddb9ef6732e43fbc5e827e15ed04d5e0cd47256b3f643b616bd491131e5c6d4d5a8
7
- data.tar.gz: 35b20ce05e326cd56a73e064d86c9189c55167b90f70a488fe866b11dc676c54090c0dba88052e2c3efc49a8be0d9b0d596f1fbe1704a911eaf315918631ec3c
6
+ metadata.gz: 97daabdb3988020b9e88958c04a61e072af7db9c603110cb37435af4e0a0e268b2d2a6fd399c78568d1e17538b118a71456f1e2c7cd9b97ab653ae6d1a13d7b0
7
+ data.tar.gz: 1d4d2a21c9c68b0417d5d3eff597da5035a494208fa0eaf8e6ef44912a01566d7a4e9caa1e3679f202033ff1335843e7da207b0aa0bfdc7b357cd7e10f1b048f
@@ -11,7 +11,7 @@ module Mumukit::Platform
11
11
 
12
12
  def self.defaults
13
13
  struct.tap do |config|
14
- domain = platform_domain_from_env
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/application'
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'
@@ -0,0 +1,9 @@
1
+ module Mumukit::Platform::Domain
2
+ def self.from_env
3
+ if ENV['RACK_ENV'] == 'test' || ENV['RAILS_ENV'] == 'test'
4
+ 'localmumuki.io'
5
+ else
6
+ ENV['MUMUKI_PLATFORM_DOMAIN'] || 'mumuki.io'
7
+ end
8
+ end
9
+ end
@@ -1,7 +1,15 @@
1
1
  module Mumukit::Platform::OrganizationMapping
2
2
  def self.from_env
3
- mapping = ENV['MUMUKI_ORGANIZATION_MAPPING']&.strip
4
- if ENV['RACK_ENV'] == 'test' || ENV['RAILS_ENV'] == 'test' || mapping == 'subdomain'
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
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Platform
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
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: 0.1.0
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-04-30 00:00:00.000000000 Z
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.1
116
+ rubygems_version: 2.4.5
116
117
  signing_key:
117
118
  specification_version: 4
118
119
  summary: Shared Mumuki Platform Components