inquisitio 0.1.1 → 0.1.2

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,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZjQ3YThiYjYzNzQ5YTc0OGRjZjcxMTc5NjcwMDJmYjlmYzgwMjQ0Yw==
5
- data.tar.gz: !binary |-
6
- NTE2NmJiOTgxODVlMWZiN2U2MjYwOWFjNGJiMmNkMWQwNTJiMjNlZA==
2
+ SHA1:
3
+ metadata.gz: 66a8d610eaeba785ed28db97ea770fc1cb8dda32
4
+ data.tar.gz: 3f11089c5b376be0f65615c51774a568d3b66a50
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NDI3MWRhNzhkMTk2ZGUxNWE4MWRkYTQxNWE4YjIzNmE5OGU3MjYyMjJhZmQw
10
- ZjI2NzBhYzU2NDNmMDY1NjhjN2FmZWViYTVjNWMxZGE3ZGVhNmQ1NWJhMWI5
11
- OGFiN2E5NDBlMGIzNTkyMGVmOTc1N2U2ZDBmODQ2ZWUyMzFiZjc=
12
- data.tar.gz: !binary |-
13
- NjhhZmJmOTVkY2ZjY2JjY2M3MDFlODVhN2ZiZDU0ZGNkMzdlMmNhMjYxYTQz
14
- ZWEyMzU5NmY1MDMzMDNhMWM2OWU1N2M0ZmI0ZTI0NGU0NjY4YmY5Y2I2MmRh
15
- Njk1NzBiZGU2ODZiNjIwYWJjNmU1MWJkMzIwMzQ2NTUyYmU5NTY=
6
+ metadata.gz: e7c8d8f03668c5578ecea8872d6116230d021f83e329ac31ec69f8105a439c167571044b48ee0f058f6da5e57edffea23ae8695f93e8121c3825ac3c6ccc27a4
7
+ data.tar.gz: 97392e98bad079d40f0320c3fa147cf8902efa71ccf88847f568604e9a52aed640f0a6ab2e383a734d29b7405ee2b33b573039be6b72f6b74c9e7dcda95ac44b
data/.travis.yml CHANGED
@@ -1,8 +1,13 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 1.9.3
3
4
  - 2.0.0
5
+ - rbx-2.1.1
4
6
  script:
5
7
  - bundle exec rake test
6
8
  #addons:
7
9
  # code_climate:
8
10
  # repo_token: 88dd239bc2e0010742a42a4e0234b4decd19b46d0e9d3408d8b1fe0f96dd8fc1
11
+ matrix:
12
+ allow_failures:
13
+ - rvm: rbx-2.1.1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.1.2 / 2013-10-30
2
+
3
+ [BUGFIX] Convert EXCON ERROR to Inquisitio Error
4
+
1
5
  0.1.1 / 2013-10-29
2
6
 
3
7
  [FEATURE] Add pagination methods to match Kaminari
@@ -102,6 +102,7 @@ module Inquisitio
102
102
 
103
103
  def results
104
104
  if @results.nil?
105
+ Inquisitio.config.logger.info("Performing search: #{search_url}")
105
106
  response = Excon.get(search_url)
106
107
  raise InquisitioError.new("Search failed with status code: #{response.status} Message #{response.body}") unless response.status == 200
107
108
  body = JSON.parse(response.body)
@@ -111,6 +112,9 @@ module Inquisitio
111
112
  body["hits"]["found"])
112
113
  end
113
114
  @results
115
+ rescue => e
116
+ Inquisitio.config.logger.error("Exception Performing search: #{search_url} #{e}")
117
+ raise InquisitioError.new("Exception performing search")
114
118
  end
115
119
 
116
120
  def search_url
@@ -1,3 +1,3 @@
1
1
  module Inquisitio
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -217,6 +217,16 @@ module Inquisitio
217
217
  end
218
218
  end
219
219
 
220
+ def test_search_raises_exception_when_excon_exception_thrown
221
+ Excon.stub({}, lambda { |_| raise Excon::Errors::Timeout})
222
+
223
+ searcher = Searcher.where('Star Wars')
224
+
225
+ assert_raises(InquisitioError) do
226
+ searcher.search
227
+ end
228
+ end
229
+
220
230
  def test_that_iterating_calls_results
221
231
  searcher = Searcher.where("star_wars")
222
232
  searcher.expects(results: [])
data/test/test_helper.rb CHANGED
@@ -19,6 +19,7 @@ class Minitest::Test
19
19
 
20
20
  config.logger.stubs(:debug)
21
21
  config.logger.stubs(:error)
22
+ config.logger.stubs(:info)
22
23
  end
23
24
  end
24
25
  end
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.1.1
4
+ version: 0.1.2
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: 2013-10-29 00:00:00.000000000 Z
13
+ date: 2013-10-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: excon
@@ -30,14 +30,14 @@ dependencies:
30
30
  name: ruby_deep_clone
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ! '>='
33
+ - - '>='
34
34
  - !ruby/object:Gem::Version
35
35
  version: '0'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ! '>='
40
+ - - '>='
41
41
  - !ruby/object:Gem::Version
42
42
  version: '0'
43
43
  - !ruby/object:Gem::Dependency
@@ -58,42 +58,42 @@ dependencies:
58
58
  name: rake
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - ! '>='
61
+ - - '>='
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - ! '>='
68
+ - - '>='
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: mocha
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - ! '>='
75
+ - - '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - ! '>='
82
+ - - '>='
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: yard
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - ! '>='
89
+ - - '>='
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - ! '>='
96
+ - - '>='
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  - !ruby/object:Gem::Dependency
@@ -165,12 +165,12 @@ require_paths:
165
165
  - lib
166
166
  required_ruby_version: !ruby/object:Gem::Requirement
167
167
  requirements:
168
- - - ! '>='
168
+ - - '>='
169
169
  - !ruby/object:Gem::Version
170
170
  version: '0'
171
171
  required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  requirements:
173
- - - ! '>='
173
+ - - '>='
174
174
  - !ruby/object:Gem::Version
175
175
  version: '0'
176
176
  requirements: []