mumukit-platform 5.0.1 → 5.1.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: ff5505e3d0593e7928058ec91492a3cee48e8bbf7032a4bb991a066ad6367a05
4
- data.tar.gz: 16b8d4e4fc5edc1437332e27283ab26d5a47ebfa2fd88d611215b89b68941ac9
3
+ metadata.gz: a1afd814d055b5a9ce037f53e475a2f1122d60fc64cb7dc66589707a70f83c72
4
+ data.tar.gz: 9ab5ac143a1cbdd5e0ad1154da7df5d6a610d353125080f3fa713760b7d622de
5
5
  SHA512:
6
- metadata.gz: 7af159ccbb971a130b4cb56145527884a4f8f90005f73462b74484719dd6d38c885106b8ba5e2c6b1c08593a89dc44271215340a5bd2cc0ce0f0c6989e8e652c
7
- data.tar.gz: 0215da67f0cc8b35daedb5ed8b9074be5d43d80d6f22c8f881978deb2bd9ba58bb30945620df8c1c0ad499d18f2bfdd8f709ffd5acae2ddba307c282fb5f8d29
6
+ metadata.gz: 6634d7a63968fd6ec802be5c4469662716b5a5a9659e93041069a484791367ea8f8b09d8219d395f9e7683bbb4171b8db8a4fe35c3293f1981642f010caeb90f
7
+ data.tar.gz: 86aa9223741d003012de4b5c1ac88cc6d2b8a2cb2ca23a1fd535b0e7a01c4475849c3c7fe4cdce40610667d85786eb6ca8bd91fa826a5c584ee6d6af199a570d
@@ -23,5 +23,20 @@ module Mumukit::Platform::Organization
23
23
  def self.find_by_name!(name)
24
24
  Mumukit::Platform.organization_class.find_by_name!(name)
25
25
  end
26
+
27
+
28
+ ## Name validation
29
+
30
+ def self.valid_name?(name)
31
+ !!(name =~ anchored_valid_name_regex)
32
+ end
33
+
34
+ def self.anchored_valid_name_regex
35
+ /\A#{valid_name_regex}\z/
36
+ end
37
+
38
+ def self.valid_name_regex
39
+ /([-a-z0-9_]+(\.[-a-z0-9_]+)*)?/
40
+ end
26
41
  end
27
42
 
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Platform
3
- VERSION = '5.0.1'
3
+ VERSION = '5.1.0'
4
4
  end
5
5
  end
@@ -21,7 +21,7 @@ module Mumukit::Platform::WebFramework
21
21
  def self.tenant_scope_options
22
22
  {
23
23
  defaults: { tenant: lazy_string { Mumukit::Platform.current_organization_name } },
24
- constraints: { tenant: Mumukit::Platform::Organization::Helpers.valid_name_regex }
24
+ constraints: { tenant: Mumukit::Platform::Organization.valid_name_regex }
25
25
  }
26
26
  end
27
27
  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.0.1
4
+ version: 5.1.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-08 00:00:00.000000000 Z
11
+ date: 2019-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit-nuntius