mumukit-platform 0.3.0 → 0.4.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
  SHA1:
3
- metadata.gz: 7154b3afdb0790bb53652318132117eae4cf6373
4
- data.tar.gz: d86f32512ff2cf050a761666336ebbc5d35cbfab
3
+ metadata.gz: 634dc869405637f51920cb23016fd72c4d04f929
4
+ data.tar.gz: d99f425b1166d80544e0ddee5240729ab8501306
5
5
  SHA512:
6
- metadata.gz: 937e151e473cff1dc48cfe8cb740e6779b1a0a1524b197654e3544da5d6c7a7f23aa4e31ea4b66be92d34def09e6a59a834313d1e4659afa978213ade3f17596
7
- data.tar.gz: 23c188a3033e2dd478f4f9af63033afd975fea976b7622c0269bf69d2bfc8f5b64c3ac1b3e9308a711b9de2d5a5b83b81a54316218d495957020b0175b0b5dad
6
+ metadata.gz: 63ec5750a1ad2e4243a3ca4c656eb805125c906fb2cb3d40f7c1d61c65a28f0083814035a773b66c0b5542ec7d9e98d3522c284ecd84a390c8e3365c5b513dd3
7
+ data.tar.gz: 98be2cb9a50427ff741b53edf83b8073dcef3d3e0a0ac8d922a8e54b376df512f8577c3fcee9a646a9dd5772980d8fc78c1b4aed62a3235a12387f294191d473
@@ -30,16 +30,19 @@ module Mumukit::Platform
30
30
  end
31
31
 
32
32
  require_relative './platform/domain'
33
+ require_relative './platform/organization'
33
34
  require_relative './platform/organization_mapping'
34
35
  require_relative './platform/application'
35
36
  require_relative './platform/web_framework'
36
37
 
38
+ require_relative './platform/with_organization'
37
39
  require_relative './platform/with_applications'
38
40
  require_relative './platform/with_organization_mapping'
39
41
  require_relative './platform/with_web_framework'
40
42
 
41
43
  module Mumukit::Platform
42
44
  extend Mumukit::Platform::WithApplications
45
+ extend Mumukit::Platform::WithOrganization
43
46
  extend Mumukit::Platform::WithOrganizationMapping
44
47
  extend Mumukit::Platform::WithWebFramework
45
48
  end
@@ -0,0 +1,14 @@
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
+ end
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Platform
3
- VERSION = '0.3.0'
3
+ VERSION = '0.4.0'
4
4
  end
5
5
  end
@@ -0,0 +1,9 @@
1
+ module Mumukit::Platform::WithOrganization
2
+ def current_organization
3
+ Mumukit::Platform::Organization.current
4
+ end
5
+
6
+ def current_organization_name
7
+ current_organization.name
8
+ end
9
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-platform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
@@ -86,11 +86,13 @@ files:
86
86
  - lib/mumukit/platform.rb
87
87
  - lib/mumukit/platform/application.rb
88
88
  - lib/mumukit/platform/domain.rb
89
+ - lib/mumukit/platform/organization.rb
89
90
  - lib/mumukit/platform/organization_mapping.rb
90
91
  - lib/mumukit/platform/uri.rb
91
92
  - lib/mumukit/platform/version.rb
92
93
  - lib/mumukit/platform/web_framework.rb
93
94
  - lib/mumukit/platform/with_applications.rb
95
+ - lib/mumukit/platform/with_organization.rb
94
96
  - lib/mumukit/platform/with_organization_mapping.rb
95
97
  - lib/mumukit/platform/with_web_framework.rb
96
98
  - mumukit-platform.gemspec