plate_id 0.0.5 → 0.0.10

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
  SHA256:
3
- metadata.gz: 5049ac8ebc480808709a64331a1bfa81ca18439cd9be1ca90e1a3b7210df0585
4
- data.tar.gz: f1b9fbee8fcb9d927a6c6ce20de3b4cfe2212c8bd87e9159cf041c7ec7d35a05
3
+ metadata.gz: 1e4267be40d69246b89d74c0283fb9d3b34ec0bc003cce9b963da1ec681aaa94
4
+ data.tar.gz: e26eafdaae1d8451cb7deb7ead2010d75e82610144120a0f5ab31b2daeb3f2c8
5
5
  SHA512:
6
- metadata.gz: 85c51e9581ecc77a27ee583570d8e3da2077714d3101663c5345f66ed4b3fc28f999fde3a4cf6b1251a75f213697225462b1d681690b3ce42d2688ba45cbcacd
7
- data.tar.gz: 03d03dd24752f22546c785f1f3845a51378e6c2fd8d9cac10f2054b4ae60e376a051c04f206ba90be60142c83941555c16dfea64b56d36994d57a2eebba82680
6
+ metadata.gz: f01562368e6c1bf753ef5a322e2025e74f4f98e6bfa0c2f86d731d1d1de64a7b9724ee3b88a6b3d15eab0481238eda0fc97c6875db078b9dd471f036059c0296
7
+ data.tar.gz: 33e7f1efe94ff3f0ff48ed4ffe8620942f542619e9cbde5fdfac03ff366f545fdf3b982df26e79c25170df859f285fd1d8f3ed94a017591069e642129bfedd3e
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,14 @@ 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" },
19
+ "Ngn::AttachmentSetting" => { host: "Base", base_class: "AttachmentSetting" },
20
+ "Ngn::AttachmentFolder" => { host: "Base", base_class: "AttachmentFolder" },
17
21
  "Ngn::Domain" => { host: "Base", base_class: "Domain" },
18
22
  "Ngn::ClipboardItem" => { host: "Base", base_class: "ClipboardItem" },
23
+ "Ngn::VersionControl::Actions::Action" => { host: "Base", base_class: "VersionControl" },
19
24
 
20
25
  "Ngn::Content::Post" => { host: "Content", base_class: "Post" },
21
26
  "Ngn::Content::Section" => { host: "Content", base_class: "Section" },
@@ -32,6 +37,7 @@ module URI
32
37
  "Ngn::ContentModel::SectionType" => { host: "ContentModel", base_class: "SectionType" },
33
38
  "Ngn::ContentModel::ElementType" => { host: "ContentModel", base_class: "ElementType" },
34
39
  "Ngn::ContentModel::ObjectTypeKind" => { host: "ContentModel", base_class: "ContentType" },
40
+ "Ngn::ContentModel::ObjectType" => { host: "ContentModel", base_class: "ObjectType" }, # TODO: legacy, to be replaced with typed kinds
35
41
  "Ngn::ContentModel::TrayType" => { host: "ContentModel", base_class: "TrayType" },
36
42
  "Ngn::ContentModel::AuthenticationType" => { host: "ContentModel", base_class: "AuthenticationType" },
37
43
 
@@ -86,7 +92,11 @@ module URI
86
92
  # )
87
93
  def build(args)
88
94
  comps = Util.make_components_hash(self, args)
95
+ return unless comps
96
+
89
97
  parts = MAPPING[comps[:model_name]].dup
98
+ return unless parts
99
+
90
100
  parts[:scheme] = comps[:scheme]
91
101
  parts[:id] = comps[:model_id]
92
102
  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.5"
5
+ spec.version = "0.0.10"
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.5
4
+ version: 0.0.10
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-18 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.