inquisitio 0.0.13 → 0.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: 1f2af1e5aecac2a3ead9c317f23f4855b8c45454
4
- data.tar.gz: 1cb0c84e66432226a168aae714f798bf9ba79f92
3
+ metadata.gz: 0153850b7330c032d7d3bdde601026aa999e4572
4
+ data.tar.gz: 7911234db6c6b7bf878a3b81b124cf07838a042c
5
5
  SHA512:
6
- metadata.gz: ba252a11d4d71945cdca5fa5e086920388c607deb866a26233e1318f51840c9f25fcbcb23addc26c0457a683e2f20d02b44d1d0806e8166d3c785a0ce47e64ae
7
- data.tar.gz: c44469a09d9e054993b28ecaf778c760c4fa24177bf44aa77fd2882a5abddc8b7e2537b64e0c9959d7bb0b641a89f177b3cb138384c287d0f6602f4e46921f4d
6
+ metadata.gz: 41b9e466ee1921dee60271bcacad62a9ca0f9456c21e94569d1700daeede197bedeeaf236662f1ed9c614e72a9e0ae038253352ffb87d178fadcee9349259a57
7
+ data.tar.gz: 984fc2e46cd3c754ab4846b1e8af8bd2190dcb5cad0c560bed257d786476585615ce376bb6029592379ffa8c478882e306716d5255d9f56df07f531ef809c9cb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.1.0 / 2013-10-28
2
+
3
+ [BUGFIX] Parse ids properly.
4
+
1
5
  0.0.13 / 2013-10-28
2
6
 
3
7
  [FEATURE] Implement Searcher#records
@@ -27,16 +27,16 @@ module Inquisitio
27
27
  end
28
28
 
29
29
  def ids
30
- @ids ||= map{|r|r['med_id']}
30
+ @ids ||= map{|r|r['data']['med_id'].first}.flatten.map(&:to_i)
31
31
  end
32
32
 
33
33
  def records
34
34
  @records ||= begin
35
35
  klasses = {}
36
36
  map do |result|
37
- klass = result['med_type']
37
+ klass = result['data']['med_type'].first
38
38
  klasses[klass] ||= []
39
- klasses[klass] << result['med_id']
39
+ klasses[klass] << result['data']['med_id'].first
40
40
  end
41
41
 
42
42
  klasses.map {|klass, ids|
@@ -1,3 +1,3 @@
1
1
  module Inquisitio
2
- VERSION = "0.0.13"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -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 = {'med_id' => 1, 'title' => "Foobar", 'med_type' => "Cat"}
10
- @result_2 = {'med_id' => 2, 'title' => "Foobar", 'med_type' => "Cat"}
11
- @result_3 = {'med_id' => 20, 'title' => "Foobar2", 'med_type' => "Module_Dog"}
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"]}}
12
12
  @expected_results = [@result_1, @result_2, @result_3]
13
13
 
14
14
  @body = <<-EOS
@@ -256,10 +256,10 @@ module Inquisitio
256
256
 
257
257
  def test_should_return_ids
258
258
  searcher = Searcher.where('Star Wars')
259
- assert_equal @expected_results.map{|r|r['med_id']}, searcher.ids
259
+ assert_equal [1,2,20], searcher.ids
260
260
  end
261
261
 
262
- def test_should_return_ids
262
+ def test_should_return_records
263
263
  Object.const_set :Cat, Object.new
264
264
  Module.const_set :Dog, Object.new
265
265
 
@@ -267,8 +267,8 @@ module Inquisitio
267
267
  res2 = 123
268
268
  res3 = true
269
269
 
270
- Cat.expects(:where).with(id: [1,2]).returns([res1, res2])
271
- Module::Dog.expects(:where).with(id: [20]).returns([res3])
270
+ Cat.expects(:where).with(id: ['1','2']).returns([res1, res2])
271
+ Module::Dog.expects(:where).with(id: ['20']).returns([res3])
272
272
 
273
273
  searcher = Searcher.new
274
274
  searcher.instance_variable_set("@results", [])
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: 0.0.13
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Walker