daedal 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGMxMGUzOWUzOTllYzcyZmVmNTViYmMxOWFiYzBiNTc1ODA4MDY0Yg==
4
+ YTJmZDFhZDhiOGY5MTdhYzk5ZGZlMGRhN2ZkYzdjODYzYTUxMGFjZA==
5
5
  data.tar.gz: !binary |-
6
- ZTMzZDNhMTI3ZWY3ZDg2YzAxYmUzZGQwM2JkZDYwNTQwNWEyYzdiMQ==
6
+ MmUzY2NmNzA3MzE4ZDQ2N2EyZWRhODA5YjFiNzIyYjdiOTA0MTI5Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDAzODBjM2E0M2Y5NDVkNzllNWQzY2ZhZTVmNWExOGQ1MzJlZjE1ZDVkYTZi
10
- ZDk5MzI3NGRlMzU4NjRiNWM4Y2ZlNmRjYTdhYzMxNjM2NzViMGYwZWMyNzVi
11
- ODc0YjBhNmVlNzljZDc5MDFjNzYxNTYzZDhlYzU3ODk4NWEwYjQ=
9
+ OWRhZTk4NTc3YTEwZGQ1MDNkZWQxYTlhMmEyYmI0ZmI1OTU5YTA2MzkzNzdl
10
+ NmY0NTRhMGI3NWE1NzY5NjljMjViMmIxMWJiNGU1MzhjMzFiMjExZTg4ZmI2
11
+ ZWJmOWRkZDFkNjljN2Q0ZjA0OTc3ZWYwNjEwY2RkNzMyMjMzZmQ=
12
12
  data.tar.gz: !binary |-
13
- MmI3ZTM4OTlmMDFjZmY2YTk4ZTQ2MWU3ZDRlODUyZTA2NjVmZTI0NDFhNjJh
14
- YzZlOWRhYWM2ZGVmZmZhNDBkMTc2ZWNkODdlY2Q1NTdmMDRhNGIzYjVjZjA4
15
- NzRiZDMyODZhNTVmYzc2MTJmYmRjZjJjNDYzYWRmMzAwOTQyNzc=
13
+ MTM4OWNjZTkxMmM1NDM3ODc4MjY0YWRhMWVhMjdkYjUyOTFmZWI2ODgxMzZi
14
+ YWE4NzQ5OGRlNjczNjdkNjYxOGU2ZjE1ZGZmNmRjOTVkZjEwMGU4NDQzNWE4
15
+ OTJiNmQ2ZGU3MDNmY2M3MjRlOGZmMTlkNDdiMDdiOGMxMDFmOWI=
@@ -1,17 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- daedal (0.0.10)
4
+ daedal (0.0.11)
5
5
  virtus (>= 1.0.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  atomic (1.1.16)
11
- axiom-types (0.1.0)
12
- descendants_tracker (~> 0.0.3)
11
+ axiom-types (0.1.1)
12
+ descendants_tracker (~> 0.0.4)
13
13
  ice_nine (~> 0.11.0)
14
- thread_safe (~> 0.1.3)
14
+ thread_safe (~> 0.3, >= 0.3.1)
15
15
  celluloid (0.15.2)
16
16
  timers (~> 1.1.0)
17
17
  coderay (1.1.0)
@@ -23,7 +23,8 @@ GEM
23
23
  simplecov (>= 0.7)
24
24
  term-ansicolor
25
25
  thor
26
- descendants_tracker (0.0.3)
26
+ descendants_tracker (0.0.4)
27
+ thread_safe (~> 0.3, >= 0.3.1)
27
28
  diff-lcs (1.2.5)
28
29
  equalizer (0.0.9)
29
30
  ffi (1.9.3)
@@ -77,8 +78,8 @@ GEM
77
78
  term-ansicolor (1.2.2)
78
79
  tins (~> 0.8)
79
80
  thor (0.18.1)
80
- thread_safe (0.1.3)
81
- atomic
81
+ thread_safe (0.3.1)
82
+ atomic (>= 1.1.7, < 2)
82
83
  timers (1.1.0)
83
84
  tins (0.13.1)
84
85
  virtus (1.0.2)
@@ -21,6 +21,7 @@ require 'daedal/attributes/query_value'
21
21
  require 'daedal/attributes/boost'
22
22
 
23
23
  # filters
24
+ require 'daedal/filters/exists_filter'
24
25
  require 'daedal/filters/term_filter'
25
26
  require 'daedal/filters/terms_filter'
26
27
  require 'daedal/filters/range_filter'
@@ -0,0 +1,14 @@
1
+ module Daedal
2
+ module Filters
3
+ """Class for the basic term filter"""
4
+ class ExistsFilter < Filter
5
+
6
+ # required attributes
7
+ attribute :field, Daedal::Attributes::Field
8
+
9
+ def to_hash
10
+ {exists: {:field => field}}
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module Daedal
2
- VERSION = '0.0.10'
2
+ VERSION = '0.0.11'
3
3
  end
@@ -0,0 +1,40 @@
1
+ require 'spec_helper'
2
+
3
+ describe Daedal::Filters::TermFilter do
4
+
5
+ subject do
6
+ Daedal::Filters::ExistsFilter
7
+ end
8
+
9
+ let(:field) do
10
+ :some_index_name
11
+ end
12
+
13
+ let(:hash_filter) do
14
+ {exists: {:field => field}}
15
+ end
16
+
17
+ context 'without a field specified' do
18
+ it 'will raise an error' do
19
+ expect {subject.new}.to raise_error(Virtus::CoercionError)
20
+ end
21
+ end
22
+
23
+ context 'with a field and a term specified' do
24
+ let(:filter) do
25
+ subject.new(field: field)
26
+ end
27
+
28
+ it 'will populate the field and term attributes appropriately' do
29
+ expect(filter.field).to eq field
30
+ end
31
+
32
+ it 'will have the correct hash representation' do
33
+ expect(filter.to_hash).to eq hash_filter
34
+ end
35
+
36
+ it 'will have the correct json representation' do
37
+ expect(filter.to_json).to eq hash_filter.to_json
38
+ end
39
+ end
40
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daedal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Schuch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-04 00:00:00.000000000 Z
11
+ date: 2014-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: virtus
@@ -56,6 +56,7 @@ files:
56
56
  - lib/daedal/facets/facet.rb
57
57
  - lib/daedal/filters/and_filter.rb
58
58
  - lib/daedal/filters/bool_filter.rb
59
+ - lib/daedal/filters/exists_filter.rb
59
60
  - lib/daedal/filters/filter.rb
60
61
  - lib/daedal/filters/geo_distance_filter.rb
61
62
  - lib/daedal/filters/nested_filter.rb
@@ -79,6 +80,7 @@ files:
79
80
  - spec/spec_helper.rb
80
81
  - spec/unit/daedal/filters/and_filter_spec.rb
81
82
  - spec/unit/daedal/filters/bool_filter_spec.rb
83
+ - spec/unit/daedal/filters/exists_filter_spec.rb
82
84
  - spec/unit/daedal/filters/geo_distance_filter_spec.rb
83
85
  - spec/unit/daedal/filters/nested_filter_spec.rb
84
86
  - spec/unit/daedal/filters/or_filter_spec.rb