ripplr 1.0.0.rc → 1.0.1.rc
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/Gemfile.lock +1 -1
- data/lib/ripplr/criteria.rb +1 -1
- data/lib/ripplr/queryable.rb +5 -0
- data/lib/ripplr/version.rb +1 -1
- data/spec/ripplr/criteria_spec.rb +1 -2
- data/spec/ripplr/queryable_spec.rb +5 -0
- data/spec/support/models/person.rb +1 -0
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/lib/ripplr/criteria.rb
CHANGED
data/lib/ripplr/queryable.rb
CHANGED
@@ -5,6 +5,7 @@ module Ripplr
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def remove_index(indexer=Ripple.client)
|
8
|
+
raise RuntimeError.new "Sorry, not implemented yet"
|
8
9
|
end
|
9
10
|
|
10
11
|
def bucket_name
|
@@ -42,6 +43,10 @@ module Ripplr
|
|
42
43
|
@query_fields
|
43
44
|
end
|
44
45
|
|
46
|
+
def queryable?(name)
|
47
|
+
query_fields.select{|field| field.for? name}.count > 0
|
48
|
+
end
|
49
|
+
|
45
50
|
def queryable(&block)
|
46
51
|
block.call
|
47
52
|
end
|
data/lib/ripplr/version.rb
CHANGED
@@ -3,9 +3,8 @@ require 'spec_helper'
|
|
3
3
|
describe Ripplr::Criteria do
|
4
4
|
|
5
5
|
describe "searching without a query" do
|
6
|
-
Given { Person.stub(:list).and_return [1,2,3,4,5] }
|
7
6
|
When(:results) { Ripplr::Criteria.new(Person).execute }
|
8
|
-
Then { results.should
|
7
|
+
Then { results.should be_empty }
|
9
8
|
end
|
10
9
|
|
11
10
|
describe "searching with a query against a field" do
|
@@ -20,6 +20,11 @@ describe Ripplr::Queryable do
|
|
20
20
|
Then { Person.count.should == 5 }
|
21
21
|
end
|
22
22
|
|
23
|
+
describe "#queryable?" do
|
24
|
+
Then { Person.queryable?(:first_name).should be_true }
|
25
|
+
Then { Person.queryable?(:middle_name).should be_false }
|
26
|
+
end
|
27
|
+
|
23
28
|
describe "#where" do
|
24
29
|
When (:criteria) { Person.where(:first_name => "Patrick") }
|
25
30
|
Then { criteria.should be_a(Ripplr::Criteria) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ripplr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1.rc
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec-given
|