inquisitio 1.0.0 → 1.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 151b837673c294cb81070643412ef509450b7c7d
4
- data.tar.gz: 6f49e96732b28065c14f3008bf7cf9e694848412
3
+ metadata.gz: 5beb1d995aa120b59b2a6f45c0f2c3827e40f5eb
4
+ data.tar.gz: 4b0f184f436c0042c3096b74dc4a6dfa82b0c109
5
5
  SHA512:
6
- metadata.gz: e6f3bcbcb91cd604702bfc3bfd16c1422fa1913e2fdb1ab1267192f229205fe0dffda8334e0ac4783c74fa8e312d89fb7e8fbc2152413f54e74ea3c534c7de1f
7
- data.tar.gz: 1df98bc883b607a808486311955e5fc8d4eb3d774ef480f771bc1ef5a72a1ab2049a0115066250b9f4138b7339bda394c80925d006f6cb71e97bc14ec2e77958
6
+ metadata.gz: 92252a7a9af735589d88d89181ad5377383c1350350d85182f6cb02d7011175a84965e5ff32550a4f293e1f44150eeb50b50295b4bf668d087a2b65e3cfa5c1b
7
+ data.tar.gz: 5f975e567a4c08fb553090446eee45e44cf2d086334ed05fab01afee966c3136fe8fb11eb4d9e1144bf21291b1d2d716a9f3e3e9a6316a880b354e6dd376b2d4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 1.1.0 / 2014-01-24
2
+
3
+ [BUGFIX] Use 'type' and 'id' fields instead of deprecated med_ fields
4
+
1
5
  0.2.0 / 2014-01-14
2
6
 
3
7
  [FEATURE] Add support for retrying query
@@ -28,16 +28,16 @@ module Inquisitio
28
28
  end
29
29
 
30
30
  def ids
31
- @ids ||= map{|r|r['data']['med_id'].first}.flatten.map(&:to_i)
31
+ @ids ||= map{|r|r['data']['id'].first}.flatten.map(&:to_i)
32
32
  end
33
33
 
34
34
  def records
35
35
  @records ||= begin
36
36
  klasses = {}
37
37
  results.map do |result|
38
- klass = result['data']['med_type'].first
38
+ klass = result['data']['type'].first
39
39
  klasses[klass] ||= []
40
- klasses[klass] << result['data']['med_id'].first
40
+ klasses[klass] << result['data']['id'].first
41
41
  end
42
42
 
43
43
  klasses.map {|klass, ids|
@@ -127,7 +127,7 @@ module Inquisitio
127
127
 
128
128
  def search_url
129
129
  @search_url ||= begin
130
- return_fields = params[:returns].empty?? [:med_type, :med_id] : params[:returns]
130
+ return_fields = params[:returns].empty?? [:type, :id] : params[:returns]
131
131
 
132
132
  SearchUrlBuilder.build(
133
133
  query: params[:criteria],
@@ -1,3 +1,3 @@
1
1
  module Inquisitio
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
data/test/results_test.rb CHANGED
@@ -6,9 +6,9 @@ module Inquisitio
6
6
  super
7
7
  @search_endpoint = 'http://my.search-endpoint.com'
8
8
  Inquisitio.config.search_endpoint = @search_endpoint
9
- @result_1 = {'data' => {'med_id' => ['1'], 'title' => ["Foobar"], 'med_type' => ["Cat"]}}
10
- @result_2 = {'data' => {'med_id' => ['2'], 'title' => ["Foobar"], 'med_type' => ["Cat"]}}
11
- @result_3 = {'data' => {'med_id' => ['20'], 'title' => ["Foobar2"], 'med_type' => ["Module_Dog"]}}
9
+ @result_1 = {'data' => {'id' => ['1'], 'title' => ["Foobar"], 'type' => ["Cat"]}}
10
+ @result_2 = {'data' => {'id' => ['2'], 'title' => ["Foobar"], 'type' => ["Cat"]}}
11
+ @result_3 = {'data' => {'id' => ['20'], 'title' => ["Foobar2"], 'type' => ["Module_Dog"]}}
12
12
  @expected_results = [@result_1, @result_2, @result_3]
13
13
  @start = 5
14
14
  @found = 8
@@ -6,9 +6,9 @@ module Inquisitio
6
6
  super
7
7
  @search_endpoint = 'http://my.search-endpoint.com'
8
8
  Inquisitio.config.search_endpoint = @search_endpoint
9
- @result_1 = {'data' => {'med_id' => ['1'], 'title' => ["Foobar"], 'med_type' => ["Cat"]}}
10
- @result_2 = {'data' => {'med_id' => ['2'], 'title' => ["Foobar"], 'med_type' => ["Cat"]}}
11
- @result_3 = {'data' => {'med_id' => ['20'], 'title' => ["Foobar2"], 'med_type' => ["Module_Dog"]}}
9
+ @result_1 = {'data' => {'id' => ['1'], 'title' => ["Foobar"], 'type' => ["Cat"]}}
10
+ @result_2 = {'data' => {'id' => ['2'], 'title' => ["Foobar"], 'type' => ["Cat"]}}
11
+ @result_3 = {'data' => {'id' => ['20'], 'title' => ["Foobar2"], 'type' => ["Module_Dog"]}}
12
12
  @expected_results = [@result_1, @result_2, @result_3]
13
13
  @start = 5
14
14
  @found = 8
@@ -177,13 +177,13 @@ module Inquisitio
177
177
  end
178
178
 
179
179
  def test_returns_with_array_gets_correct_url
180
- searcher = Searcher.returns('med_id', 'foobar')
181
- assert searcher.send(:search_url).include? "&return-fields=med_id,foobar"
180
+ searcher = Searcher.returns('id', 'foobar')
181
+ assert searcher.send(:search_url).include? "&return-fields=id,foobar"
182
182
  end
183
183
 
184
184
  def test_returns_appends_variable
185
- searcher = Searcher.returns('med_id').returns('foobar')
186
- assert_equal ['med_id', 'foobar'], searcher.params[:returns]
185
+ searcher = Searcher.returns('id').returns('foobar')
186
+ assert_equal ['id', 'foobar'], searcher.params[:returns]
187
187
  end
188
188
 
189
189
  def test_with_saves_variable
@@ -279,7 +279,7 @@ module Inquisitio
279
279
  def test_should_return_type_and_id_by_default
280
280
  searcher = Searcher.where('Star Wars')
281
281
  assert_equal [], searcher.params[:returns]
282
- assert searcher.send(:search_url).include? "&return-fields=med_type,med_id"
282
+ assert searcher.send(:search_url).include? "&return-fields=type,id"
283
283
  searcher.send(:search_url)
284
284
  end
285
285
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inquisitio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Walker
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-01-22 00:00:00.000000000 Z
13
+ date: 2014-01-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: excon
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  version: '0'
176
176
  requirements: []
177
177
  rubyforge_project:
178
- rubygems_version: 2.1.9
178
+ rubygems_version: 2.2.0
179
179
  signing_key:
180
180
  specification_version: 4
181
181
  summary: This wraps AWS CloudSearch in a Ruby Gem