plate_id 0.0.4 → 0.0.9

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: b48d2380f3a5942072fc80b5151dc1bffcf8d98b8b706e0f1047009afaec6518
4
- data.tar.gz: 92a3abd85ba9d7be9525230c66f4efc67e88d882cbaf891cc291f6c2045ac33f
3
+ metadata.gz: 8b8d3dabbaefa7c9ee8a0deae52e407cd1ab16da2155412ef675357cd9d9f70c
4
+ data.tar.gz: 7551903ea1563796779fd1d009a5ebbe545a270e77224505a20c94b758d5b3dd
5
5
  SHA512:
6
- metadata.gz: 4b793f991419cf32197fde25ba9c7c227d0eb1853904817600d4c391e71756aefc34fbbf5ffc5365fb2c4678f6e507d83d098d00e87146f68ce5b8f912e843dd
7
- data.tar.gz: 3e844d5e16ceb9b6f157139da95c1c55f70363d40bc7b270d72596b78e4d73324c5dc93a8773ae553c8daaf9de9614bf3615840de7296b442771431f9c300e71
6
+ metadata.gz: afcd7d4e1dc7a155bca5c2d38ab156862788faca0a4b261aee352984f969c518ab63a62b4374b0b001cf9a58fd2f871e9502b716510c8208901bb0dc72c59472
7
+ data.tar.gz: 4cd51908239399a521f6585c9aae06b49ea2491dd14f059f0e1d765b68848abdfa00a677fe001f5e14df298fa8be121d290b0a47a21dad0912f89d045f8d9b2d
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ *.gem
data/lib/plate_id.rb CHANGED
@@ -4,7 +4,8 @@ class PlateID
4
4
  class << self
5
5
 
6
6
  def create(model)
7
- new(URI::PlateID.create(model))
7
+ uri = URI::PlateID.create(model)
8
+ new(uri) if uri
8
9
  end
9
10
 
10
11
  def parse(plate_id)
data/lib/uri/plate_id.rb CHANGED
@@ -13,9 +13,12 @@ module URI
13
13
 
14
14
  MAPPING = {
15
15
  "Site" => { host: "Base", base_class: "Site" },
16
+ "Ngn::Site" => { host: "Base", base_class: "Site" },
17
+ "Org::Site" => { host: "Base", base_class: "Site" },
16
18
  "Ngn::Attachment" => { host: "Base", base_class: "Attachment" },
17
19
  "Ngn::Domain" => { host: "Base", base_class: "Domain" },
18
20
  "Ngn::ClipboardItem" => { host: "Base", base_class: "ClipboardItem" },
21
+ "Ngn::VersionControl::Actions::Action" => { host: "Base", base_class: "VersionControl" },
19
22
 
20
23
  "Ngn::Content::Post" => { host: "Content", base_class: "Post" },
21
24
  "Ngn::Content::Section" => { host: "Content", base_class: "Section" },
@@ -32,6 +35,7 @@ module URI
32
35
  "Ngn::ContentModel::SectionType" => { host: "ContentModel", base_class: "SectionType" },
33
36
  "Ngn::ContentModel::ElementType" => { host: "ContentModel", base_class: "ElementType" },
34
37
  "Ngn::ContentModel::ObjectTypeKind" => { host: "ContentModel", base_class: "ContentType" },
38
+ "Ngn::ContentModel::ObjectType" => { host: "ContentModel", base_class: "ObjectType" }, # TODO: legacy, to be replaced with typed kinds
35
39
  "Ngn::ContentModel::TrayType" => { host: "ContentModel", base_class: "TrayType" },
36
40
  "Ngn::ContentModel::AuthenticationType" => { host: "ContentModel", base_class: "AuthenticationType" },
37
41
 
@@ -47,7 +51,9 @@ module URI
47
51
  "Org::FormMessage" => { host: "Organization", base_class: "FormMessage" },
48
52
 
49
53
  # Access control
50
- "AccessControl::Policy" => { host: "AccessControl", base_class: "Policy" }
54
+ "AccessControl::Policy" => { host: "AccessControl", base_class: "Policy" },
55
+ "AccessControl::Role" => { host: "AccessControl", base_class: "Role" },
56
+ "AccessControl::Group" => { host: "AccessControl", base_class: "Group" }
51
57
  }
52
58
 
53
59
  attr_reader :base_class, :id
@@ -84,7 +90,11 @@ module URI
84
90
  # )
85
91
  def build(args)
86
92
  comps = Util.make_components_hash(self, args)
93
+ return unless comps
94
+
87
95
  parts = MAPPING[comps[:model_name]].dup
96
+ return unless parts
97
+
88
98
  parts[:scheme] = comps[:scheme]
89
99
  parts[:id] = comps[:model_id]
90
100
  parts[:path] = "/#{parts[:base_class]}/#{CGI.escape(parts[:id].to_s)}"
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.4"
5
+ spec.version = "0.0.9"
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.4
4
+ version: 0.0.9
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-03-15 00:00:00.000000000 Z
11
+ date: 2021-04-08 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.