pebbles-uid 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +25 -0
- data/lib/pebbles-uid.rb +4 -0
- data/lib/pebbles-uid/query.rb +2 -2
- data/lib/pebbles-uid/version.rb +1 -1
- data/spec/uid_spec.rb +5 -0
- metadata +10 -6
data/README.md
CHANGED
@@ -43,6 +43,31 @@ There are currently two characters which cannot be included in an oid:
|
|
43
43
|
|
44
44
|
Oid is optional when creating a new resource.
|
45
45
|
|
46
|
+
## Relations
|
47
|
+
|
48
|
+
A convention has emerged where the path of an object who belongs in a category
|
49
|
+
is built up using the category's path, with the category's oid, appended.
|
50
|
+
|
51
|
+
I.e.
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
category = Pebbles::Uid.new('post.doc:edu.uni.abc$123')
|
55
|
+
thing = Pebbles::Uid.new('course:edu.uni.abc.123$456')
|
56
|
+
|
57
|
+
thing.parent
|
58
|
+
# => 'course:edu.uni.abc$123'
|
59
|
+
thing.parent('post.doc')
|
60
|
+
# => 'post.doc:edu.uni.abc$123'
|
61
|
+
|
62
|
+
category.child_path
|
63
|
+
# => 'edu.uni.abc.123'
|
64
|
+
|
65
|
+
category.children
|
66
|
+
# => '*:edu.uni.abc.123'
|
67
|
+
category.children('post.subcategory')
|
68
|
+
# => 'post.subcategory:edu.uni.abc.123'
|
69
|
+
```
|
70
|
+
|
46
71
|
## Queries
|
47
72
|
|
48
73
|
### For one specific resource
|
data/lib/pebbles-uid.rb
CHANGED
data/lib/pebbles-uid/query.rb
CHANGED
data/lib/pebbles-uid/version.rb
CHANGED
data/spec/uid_spec.rb
CHANGED
@@ -155,6 +155,11 @@ describe Pebbles::Uid do
|
|
155
155
|
|
156
156
|
its(:child_path) { should eq('tourism.norway.fjords.1234') }
|
157
157
|
|
158
|
+
its(:children) { should eq('*:tourism.norway.fjords.1234')}
|
159
|
+
it "has children of a certain species" do
|
160
|
+
subject.children('stuff').should eq('stuff:tourism.norway.fjords.1234')
|
161
|
+
end
|
162
|
+
|
158
163
|
its(:cache_key) { should eq('post.card:tourism.*$1234') }
|
159
164
|
|
160
165
|
its(:to_hash) do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pebbles-uid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-06-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,12 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
description: Handle pebble UIDs conveniently.
|
26
31
|
email:
|
27
32
|
- katrina.owen@gmail.com
|
@@ -72,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
77
|
version: '0'
|
73
78
|
requirements: []
|
74
79
|
rubyforge_project:
|
75
|
-
rubygems_version: 1.8.
|
80
|
+
rubygems_version: 1.8.25
|
76
81
|
signing_key:
|
77
82
|
specification_version: 3
|
78
83
|
summary: Unique identifiers in the Pebblestack universe, in the format species[.genus]:path$oid,
|
@@ -85,4 +90,3 @@ test_files:
|
|
85
90
|
- spec/roots_spec.rb
|
86
91
|
- spec/uid_spec.rb
|
87
92
|
- spec/wildcard_spec.rb
|
88
|
-
has_rdoc:
|