pebble_path 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -47,7 +47,7 @@ module PebblePath
47
47
 
48
48
  class << self
49
49
 
50
- def detect(path)
50
+ def to_conditions(path)
51
51
  unless Pebblebed::Uid.valid_path?(path)
52
52
  raise ArgumentError.new("Wildcards terminate the path. Invalid path: #{path}")
53
53
  end
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.detect(paths)
10
- Positions.detect(paths)
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.detect(path)
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.1"
15
+ gem.version = "0.0.2"
16
16
 
17
17
  gem.add_development_dependency 'rspec'
18
18
  gem.add_dependency 'pebblebed', '>=0.0.15'
@@ -18,26 +18,26 @@ describe PebblePath::Positions do
18
18
  }
19
19
  end
20
20
 
21
- describe "#detect" do
21
+ describe "#to_conditions" do
22
22
 
23
23
  specify do
24
- subject.detect("a.b.c.d.e.f.g.h.i.j").should eq(full_path)
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.detect("a.b.c").should eq({:label_0=>"a", :label_1=>"b", :label_2=>"c", :label_3=>nil})
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.detect("a.b.*").should eq({:label_0=>"a", :label_1=>"b"})
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.detect("a.^b.c").should eq({:label_0=>"a", :label_1=>["b", nil], :label_2=>["c", nil], :label_3=>nil})
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.detect("a.b|c.d").should eq({:label_0=>"a", :label_1=>["b", "c"], :label_2=>"d", :label_3=>nil})
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.1
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-14 00:00:00.000000000Z
12
+ date: 2012-05-15 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70303532184640 !ruby/object:Gem::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: *70303532184640
24
+ version_requirements: *70309093728740
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: pebblebed
27
- requirement: &70303532183560 !ruby/object:Gem::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: *70303532183560
35
+ version_requirements: *70309093727040
36
36
  description: Provide pebble-compliant paths for ActiveRecord models.
37
37
  email:
38
38
  - katrina.owen@gmail.com