pebble_path 0.0.1 → 0.0.2
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/pebble_path/positions.rb +1 -1
- data/lib/pebble_path.rb +3 -3
- data/pebble_path.gemspec +1 -1
- data/spec/positions_spec.rb +6 -6
- metadata +6 -6
data/lib/pebble_path.rb
CHANGED
@@ -6,14 +6,14 @@ module PebblePath
|
|
6
6
|
Positions::MAX_DEPTH
|
7
7
|
end
|
8
8
|
|
9
|
-
def self.
|
10
|
-
Positions.
|
9
|
+
def self.to_conditions(paths)
|
10
|
+
Positions.to_conditions(paths)
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.included(base)
|
14
14
|
base.class_eval do
|
15
15
|
scope :by_path, lambda { |path|
|
16
|
-
where Positions.
|
16
|
+
where Positions.to_conditions(path)
|
17
17
|
}
|
18
18
|
|
19
19
|
validates_presence_of :label_0
|
data/pebble_path.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
13
13
|
gem.name = "pebble_path"
|
14
14
|
gem.require_paths = ["lib"]
|
15
|
-
gem.version = "0.0.
|
15
|
+
gem.version = "0.0.2"
|
16
16
|
|
17
17
|
gem.add_development_dependency 'rspec'
|
18
18
|
gem.add_dependency 'pebblebed', '>=0.0.15'
|
data/spec/positions_spec.rb
CHANGED
@@ -18,26 +18,26 @@ describe PebblePath::Positions do
|
|
18
18
|
}
|
19
19
|
end
|
20
20
|
|
21
|
-
describe "#
|
21
|
+
describe "#to_conditions" do
|
22
22
|
|
23
23
|
specify do
|
24
|
-
subject.
|
24
|
+
subject.to_conditions("a.b.c.d.e.f.g.h.i.j").should eq(full_path)
|
25
25
|
end
|
26
26
|
|
27
27
|
specify do
|
28
|
-
subject.
|
28
|
+
subject.to_conditions("a.b.c").should eq({:label_0=>"a", :label_1=>"b", :label_2=>"c", :label_3=>nil})
|
29
29
|
end
|
30
30
|
|
31
31
|
specify do
|
32
|
-
subject.
|
32
|
+
subject.to_conditions("a.b.*").should eq({:label_0=>"a", :label_1=>"b"})
|
33
33
|
end
|
34
34
|
|
35
35
|
specify do
|
36
|
-
subject.
|
36
|
+
subject.to_conditions("a.^b.c").should eq({:label_0=>"a", :label_1=>["b", nil], :label_2=>["c", nil], :label_3=>nil})
|
37
37
|
end
|
38
38
|
|
39
39
|
specify do
|
40
|
-
subject.
|
40
|
+
subject.to_conditions("a.b|c.d").should eq({:label_0=>"a", :label_1=>["b", "c"], :label_2=>"d", :label_3=>nil})
|
41
41
|
end
|
42
42
|
|
43
43
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pebble_path
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
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-05-
|
12
|
+
date: 2012-05-15 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70309093728740 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70309093728740
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: pebblebed
|
27
|
-
requirement: &
|
27
|
+
requirement: &70309093727040 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 0.0.15
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70309093727040
|
36
36
|
description: Provide pebble-compliant paths for ActiveRecord models.
|
37
37
|
email:
|
38
38
|
- katrina.owen@gmail.com
|