pebbles-uid 0.0.13 → 0.0.14

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.
data/lib/pebbles-uid.rb CHANGED
@@ -96,5 +96,9 @@ module Pebbles
96
96
  "#{species}:#{realm}.*$#{oid}"
97
97
  end
98
98
 
99
+ def parent(parent_species = species)
100
+ "#{parent_species}:#{path_labels.values[0..-2].join('.')}$#{path_labels.values.last}"
101
+ end
102
+
99
103
  end
100
104
  end
@@ -1,5 +1,5 @@
1
1
  module Pebbles
2
2
  class Uid
3
- VERSION = "0.0.13"
3
+ VERSION = "0.0.14"
4
4
  end
5
5
  end
data/spec/uid_spec.rb CHANGED
@@ -148,6 +148,10 @@ describe Pebbles::Uid do
148
148
  its(:path) { should eq('tourism.norway.fjords') }
149
149
  its(:oid) { should eq('1234') }
150
150
  its(:oid?) { should == true }
151
+ its(:parent) { should eq('post.card:tourism.norway$fjords') }
152
+ it "has a parent with a different species" do
153
+ subject.parent('stuff').should eq('stuff:tourism.norway$fjords')
154
+ end
151
155
 
152
156
  its(:cache_key) { should eq('post.card:tourism.*$1234') }
153
157
 
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.13
4
+ version: 0.0.14
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: 2012-12-18 00:00:00.000000000 Z
12
+ date: 2013-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &70124235672500 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,12 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
24
+ version_requirements: *70124235672500
30
25
  description: Handle pebble UIDs conveniently.
31
26
  email:
32
27
  - katrina.owen@gmail.com
@@ -77,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
72
  version: '0'
78
73
  requirements: []
79
74
  rubyforge_project:
80
- rubygems_version: 1.8.24
75
+ rubygems_version: 1.8.15
81
76
  signing_key:
82
77
  specification_version: 3
83
78
  summary: Unique identifiers in the Pebblestack universe, in the format species[.genus]:path$oid,