plate_id 0.0.1 → 0.0.6

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: 6b3408e5e25f6c0c78ff3db6c74359db7dc0913c293c90e678ae6fb285956b07
4
- data.tar.gz: 2a550ab8594a96ca5cf34f8de198cf102f3ffe0d538b9f91cdfa0536f9d2e122
3
+ metadata.gz: 70bf5412c0dfcfdfe2993c7d3012b8073c5512500c843345fd4f856288595fce
4
+ data.tar.gz: 27ab91fbc63de055ad1e5726c311c354869a763549166bc514d81e27b18ad69b
5
5
  SHA512:
6
- metadata.gz: bd9126447d7684c761922f340ca3c49b40eb009aef03f2eb4aa4cef5858171fb82e82c0bc025930bc9e6912eeb7d0ee712521e678dae5a1b226821f8bfdc123c
7
- data.tar.gz: 49daf4c620fe31b64b2e20889a033a30f19353f059a80bb13dc16477eae67c4efcd03cf35cca782e36d51304486190fc9d0e45cf4bb46a927184acb073363ea4
6
+ metadata.gz: d70fc2247e4ac453643ef1cb299b551c6a5d4426e1d197c7340e75d8ca1485e7d965bc27ddd1597dde2ba75ca1e4fa0fbd5185c4731057a8ab6e9dbb179de9f1
7
+ data.tar.gz: b1db3f55237419a7313d548de16847e2586bc7595c72e07fa56b4c29360a11c11f0de0effef8cab56ce1fbc400fabe064206e5d088681554002e3bbec57f703c
data/lib/plate_id.rb CHANGED
@@ -33,6 +33,10 @@ class PlateID
33
33
  uri.id
34
34
  end
35
35
 
36
+ def id=(id)
37
+ uri.id = id
38
+ end
39
+
36
40
  def to_s
37
41
  uri.to_s
38
42
  end
data/lib/uri/plate_id.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'cgi'
2
+
1
3
  module URI
2
4
  class PlateID < Generic
3
5
 
@@ -7,11 +9,14 @@ module URI
7
9
  #
8
10
  # The URI format looks like "plateid://group_name/base_class/id".
9
11
 
12
+ attr_writer :id
13
+
10
14
  MAPPING = {
11
15
  "Site" => { host: "Base", base_class: "Site" },
12
16
  "Ngn::Attachment" => { host: "Base", base_class: "Attachment" },
13
17
  "Ngn::Domain" => { host: "Base", base_class: "Domain" },
14
18
  "Ngn::ClipboardItem" => { host: "Base", base_class: "ClipboardItem" },
19
+ "Ngn::VersionControl::Actions::Action" => { host: "Base", base_class: "VersionControl" },
15
20
 
16
21
  "Ngn::Content::Post" => { host: "Content", base_class: "Post" },
17
22
  "Ngn::Content::Section" => { host: "Content", base_class: "Section" },
@@ -20,6 +25,7 @@ module URI
20
25
  "Ngn::Content::Element" => { host: "Content", base_class: "Element" },
21
26
  "Ngn::Content::ContentObject" => { host: "Content", base_class: "ContentObject" },
22
27
  "Ngn::Content::SiteTranslation" => { host: "Content", base_class: "SiteTranslation" },
28
+ "Ngn::Content::AuthenticationObject" => { host: "Content", base_class: "AuthenticationObject" },
23
29
 
24
30
  "Ngn::ContentModel::ContentField" => { host: "ContentModel", base_class: "ContentField" },
25
31
  "Ngn::ContentModel::ContentFieldTab" => { host: "ContentModel", base_class: "ContentFieldGroup" },
@@ -37,11 +43,14 @@ module URI
37
43
  "Org::Auth::User" => { host: "Auth", base_class: "User" },
38
44
  "Api::Integration" => { host: "Auth", base_class: "ApiIntegration" },
39
45
 
40
- # "Ngn::Auth::AccessControl::Policy" => { host: "AccessControl", base_class: "Policy" },
41
-
42
46
  "Org::Company" => { host: "Organization", base_class: "Company" },
43
47
  "Org::Partner" => { host: "Organization", base_class: "Partner" },
44
- "Org::FormMessage" => { host: "Organization", base_class: "FormMessage" }
48
+ "Org::FormMessage" => { host: "Organization", base_class: "FormMessage" },
49
+
50
+ # Access control
51
+ "AccessControl::Policy" => { host: "AccessControl", base_class: "Policy" },
52
+ "AccessControl::Role" => { host: "AccessControl", base_class: "Role" },
53
+ "AccessControl::Group" => { host: "AccessControl", base_class: "Group" }
45
54
  }
46
55
 
47
56
  attr_reader :base_class, :id
@@ -67,13 +76,13 @@ module URI
67
76
 
68
77
  # Create a new URI::PlateID from components with argument check.
69
78
  #
70
- # The allowed components are app, model_name, model_id and params, which
79
+ # The allowed components are model_name and model_id, which
71
80
  # can be either a hash or an array.
72
81
  #
73
82
  # Using a hash:
74
83
  #
75
84
  # URI::PlateID.build(
76
- # model_name: 'Ngn::ContentModelElementType',
85
+ # model_name: 'Ngn::ContentModel::ElementType',
77
86
  # model_id: '1'
78
87
  # )
79
88
  def build(args)
data/plate_id.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "plate_id"
5
- spec.version = "0.0.1"
5
+ spec.version = "0.0.6"
6
6
  spec.authors = ["Kobus Post"]
7
7
  spec.email = ["kobus@getplate.com"]
8
8
  spec.homepage = "https://www.getplate.com"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plate_id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kobus Post
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-15 00:00:00.000000000 Z
11
+ date: 2021-03-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Identify any Plate record or class with URIs. Somewhat based on Rails's
14
14
  GlobalID gem.