ripplr 1.0.0.rc → 1.0.1.rc

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ripplr (0.0.2.beta)
4
+ ripplr (1.0.0.rc)
5
5
  ripple (>= 0.9.5)
6
6
 
7
7
  GEM
@@ -57,7 +57,7 @@ module Ripplr
57
57
  end
58
58
 
59
59
  def execute
60
- return @target.list if condition.nil?
60
+ return Array.new if condition.nil?
61
61
 
62
62
  @indexer.search @target, query, options
63
63
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Ripplr
2
- VERSION = "1.0.0.rc"
2
+ VERSION = "1.0.1.rc"
3
3
  end
@@ -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 == [1,2,3,4,5] }
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) }
@@ -2,6 +2,7 @@ class Person
2
2
  include Ripple::Document
3
3
  property :first_name, String
4
4
  property :last_name, String
5
+ property :middle_name, String
5
6
  timestamps!
6
7
 
7
8
  include Ripplr::Queryable
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.0.rc
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-09-11 00:00:00.000000000 Z
12
+ date: 2012-10-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec-given