bento_search 0.0.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +14 -8
- data/app/assets/stylesheets/bento_search/suggested_styles.css +22 -0
- data/app/models/bento_search/multi_searcher.rb +1 -1
- data/app/models/bento_search/result_item.rb +5 -0
- data/app/models/bento_search/results.rb +6 -1
- data/app/models/bento_search/search_engine.rb +185 -28
- data/app/models/bento_search/search_engine/capabilities.rb +7 -1
- data/app/search_engines/bento_search/ebsco_host_engine.rb +3 -1
- data/app/search_engines/bento_search/eds_engine.rb +43 -10
- data/app/search_engines/bento_search/google_books_engine.rb +2 -2
- data/app/search_engines/bento_search/mock_engine.rb +51 -0
- data/app/search_engines/bento_search/primo_engine.rb +86 -15
- data/app/search_engines/bento_search/summon_engine.rb +22 -22
- data/lib/bento_search.rb +4 -1
- data/lib/bento_search/util.rb +67 -0
- data/lib/bento_search/version.rb +1 -1
- data/test/dummy/log/development.log +1 -0
- data/test/dummy/log/test.log +653 -1951
- data/test/helper/bento_search_helper_test.rb +1 -0
- data/test/unit/eds_engine_test.rb +41 -1
- data/test/unit/google_books_engine_test.rb +8 -0
- data/test/unit/handle_highlight_tags_test.rb +71 -0
- data/test/unit/item_decorators_test.rb +2 -0
- data/test/unit/primo_engine_test.rb +25 -0
- data/test/unit/search_engine_base_test.rb +21 -0
- data/test/unit/search_engine_test.rb +32 -25
- data/test/unit/summon_engine_test.rb +15 -2
- data/test/vcr_cassettes/gbs/empty_results.yml +40 -0
- data/test/vcr_cassettes/primo/proper_tags_for_snippets.yml +812 -0
- data/test/vcr_cassettes/primo/search_smoke_test.yml +978 -799
- metadata +15 -10
- data/app/assets/stylesheets/bento_search/bento.css +0 -4
- data/app/search_engines/bento_search/#Untitled-1# +0 -11
- data/test/support/mock_engine.rb +0 -23
- data/test/unit/#vcr_test.rb# +0 -68
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bento_search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.5.0
|
5
5
|
prerelease:
|
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-08-
|
12
|
+
date: 2012-08-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -194,7 +194,7 @@ files:
|
|
194
194
|
- app/assets/images/bento_search/large_loader.gif
|
195
195
|
- app/assets/javascripts/bento_search.js
|
196
196
|
- app/assets/javascripts/bento_search/ajax_load.js
|
197
|
-
- app/assets/stylesheets/bento_search/
|
197
|
+
- app/assets/stylesheets/bento_search/suggested_styles.css
|
198
198
|
- app/models/bento_search/link.rb
|
199
199
|
- app/models/bento_search/results.rb
|
200
200
|
- app/models/bento_search/search_engine/capabilities.rb
|
@@ -216,7 +216,7 @@ files:
|
|
216
216
|
- app/search_engines/bento_search/scopus_engine.rb
|
217
217
|
- app/search_engines/bento_search/primo_engine.rb
|
218
218
|
- app/search_engines/bento_search/eds_engine.rb
|
219
|
-
- app/search_engines/bento_search
|
219
|
+
- app/search_engines/bento_search/mock_engine.rb
|
220
220
|
- app/search_engines/bento_search/xerxes_engine.rb
|
221
221
|
- app/item_decorators/bento_search/openurl_add_other_link.rb
|
222
222
|
- app/item_decorators/bento_search/openurl_main_link.rb
|
@@ -224,6 +224,7 @@ files:
|
|
224
224
|
- config/locales/en.yml
|
225
225
|
- lib/http_client_patch/include_client.rb
|
226
226
|
- lib/bento_search/routes.rb
|
227
|
+
- lib/bento_search/util.rb
|
227
228
|
- lib/bento_search/version.rb
|
228
229
|
- lib/bento_search/engine.rb
|
229
230
|
- lib/bento_search.rb
|
@@ -235,7 +236,6 @@ files:
|
|
235
236
|
- README.md
|
236
237
|
- test/view/std_item_test.rb
|
237
238
|
- test/support/test_with_cassette.rb
|
238
|
-
- test/support/mock_engine.rb
|
239
239
|
- test/integration/navigation_test.rb
|
240
240
|
- test/dummy/app/controllers/application_controller.rb
|
241
241
|
- test/dummy/app/assets/javascripts/application.js
|
@@ -267,12 +267,14 @@ files:
|
|
267
267
|
- test/dummy/config.ru
|
268
268
|
- test/dummy/db/test.sqlite3
|
269
269
|
- test/dummy/log/test.log
|
270
|
+
- test/dummy/log/development.log
|
270
271
|
- test/helper/bento_search_helper_test.rb
|
271
272
|
- test/vcr_cassettes/summon/proper_tags_for_snippets.yml
|
272
273
|
- test/vcr_cassettes/summon/search.yml
|
273
274
|
- test/vcr_cassettes/summon/bad_auth.yml
|
274
275
|
- test/vcr_cassettes/xerxes/live_search.yml
|
275
276
|
- test/vcr_cassettes/primo/search_smoke_test.yml
|
277
|
+
- test/vcr_cassettes/primo/proper_tags_for_snippets.yml
|
276
278
|
- test/vcr_cassettes/ebscohost/live_search.yml
|
277
279
|
- test/vcr_cassettes/ebscohost/error_bad_db.yml
|
278
280
|
- test/vcr_cassettes/ebscohost/error_bad_password.yml
|
@@ -291,12 +293,12 @@ files:
|
|
291
293
|
- test/vcr_cassettes/gbs/pagination.yml
|
292
294
|
- test/vcr_cassettes/gbs/error_condition.yml
|
293
295
|
- test/vcr_cassettes/gbs/search.yml
|
296
|
+
- test/vcr_cassettes/gbs/empty_results.yml
|
294
297
|
- test/unit/result_item_display_test.rb
|
295
298
|
- test/unit/eds_engine_test.rb
|
296
299
|
- test/unit/result_item_test.rb
|
297
300
|
- test/unit/item_decorators_test.rb
|
298
301
|
- test/unit/xerxes_engine_test.rb
|
299
|
-
- test/unit/#vcr_test.rb#
|
300
302
|
- test/unit/search_engine_test.rb
|
301
303
|
- test/unit/search_engine_base_test.rb
|
302
304
|
- test/unit/register_engine_test.rb
|
@@ -305,6 +307,7 @@ files:
|
|
305
307
|
- test/unit/scopus_engine_test.rb
|
306
308
|
- test/unit/openurl_creator_test.rb
|
307
309
|
- test/unit/ebsco_host_engine_test.rb
|
310
|
+
- test/unit/handle_highlight_tags_test.rb
|
308
311
|
- test/unit/primo_engine_test.rb
|
309
312
|
- test/unit/multi_searcher_test.rb
|
310
313
|
- test/unit/pagination_test.rb
|
@@ -324,7 +327,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
324
327
|
version: '0'
|
325
328
|
segments:
|
326
329
|
- 0
|
327
|
-
hash:
|
330
|
+
hash: 92914617605551034
|
328
331
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
329
332
|
none: false
|
330
333
|
requirements:
|
@@ -333,7 +336,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
333
336
|
version: '0'
|
334
337
|
segments:
|
335
338
|
- 0
|
336
|
-
hash:
|
339
|
+
hash: 92914617605551034
|
337
340
|
requirements: []
|
338
341
|
rubyforge_project:
|
339
342
|
rubygems_version: 1.8.24
|
@@ -344,7 +347,6 @@ summary: An abstraction/normalization layer for querying and displaying results
|
|
344
347
|
test_files:
|
345
348
|
- test/view/std_item_test.rb
|
346
349
|
- test/support/test_with_cassette.rb
|
347
|
-
- test/support/mock_engine.rb
|
348
350
|
- test/integration/navigation_test.rb
|
349
351
|
- test/dummy/app/controllers/application_controller.rb
|
350
352
|
- test/dummy/app/assets/javascripts/application.js
|
@@ -376,12 +378,14 @@ test_files:
|
|
376
378
|
- test/dummy/config.ru
|
377
379
|
- test/dummy/db/test.sqlite3
|
378
380
|
- test/dummy/log/test.log
|
381
|
+
- test/dummy/log/development.log
|
379
382
|
- test/helper/bento_search_helper_test.rb
|
380
383
|
- test/vcr_cassettes/summon/proper_tags_for_snippets.yml
|
381
384
|
- test/vcr_cassettes/summon/search.yml
|
382
385
|
- test/vcr_cassettes/summon/bad_auth.yml
|
383
386
|
- test/vcr_cassettes/xerxes/live_search.yml
|
384
387
|
- test/vcr_cassettes/primo/search_smoke_test.yml
|
388
|
+
- test/vcr_cassettes/primo/proper_tags_for_snippets.yml
|
385
389
|
- test/vcr_cassettes/ebscohost/live_search.yml
|
386
390
|
- test/vcr_cassettes/ebscohost/error_bad_db.yml
|
387
391
|
- test/vcr_cassettes/ebscohost/error_bad_password.yml
|
@@ -400,12 +404,12 @@ test_files:
|
|
400
404
|
- test/vcr_cassettes/gbs/pagination.yml
|
401
405
|
- test/vcr_cassettes/gbs/error_condition.yml
|
402
406
|
- test/vcr_cassettes/gbs/search.yml
|
407
|
+
- test/vcr_cassettes/gbs/empty_results.yml
|
403
408
|
- test/unit/result_item_display_test.rb
|
404
409
|
- test/unit/eds_engine_test.rb
|
405
410
|
- test/unit/result_item_test.rb
|
406
411
|
- test/unit/item_decorators_test.rb
|
407
412
|
- test/unit/xerxes_engine_test.rb
|
408
|
-
- test/unit/#vcr_test.rb#
|
409
413
|
- test/unit/search_engine_test.rb
|
410
414
|
- test/unit/search_engine_base_test.rb
|
411
415
|
- test/unit/register_engine_test.rb
|
@@ -414,6 +418,7 @@ test_files:
|
|
414
418
|
- test/unit/scopus_engine_test.rb
|
415
419
|
- test/unit/openurl_creator_test.rb
|
416
420
|
- test/unit/ebsco_host_engine_test.rb
|
421
|
+
- test/unit/handle_highlight_tags_test.rb
|
417
422
|
- test/unit/primo_engine_test.rb
|
418
423
|
- test/unit/multi_searcher_test.rb
|
419
424
|
- test/unit/pagination_test.rb
|
@@ -1,11 +0,0 @@
|
|
1
|
-
http://blacklight.mse.jhu.edu:3001/resolve?url_ver=Z39.88-2004
|
2
|
-
&url_ctx_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Actx
|
3
|
-
&ctx_ver=Z39.88-2004
|
4
|
-
&ctx_tim=2012-07-25T16%3A21%3A11-04%3A00
|
5
|
-
&ctx_id=
|
6
|
-
&ctx_enc=info%3Aofi%2Fenc%3AUTF-8
|
7
|
-
&rft.title=Monkey+Brains
|
8
|
-
&rft.creator=Will.i.am
|
9
|
-
&rft.pub=Absolute+Pitch%2C12+Dec+2007
|
10
|
-
&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc
|
11
|
-
&rfr_id=info%3Asid%2Fsummon.serialssolutions.com
|
data/test/support/mock_engine.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
class MockEngine
|
2
|
-
include BentoSearch::SearchEngine
|
3
|
-
|
4
|
-
def search_implementation(args)
|
5
|
-
results = BentoSearch::Results.new
|
6
|
-
1.upto(configuration.num_results) do |i|
|
7
|
-
results << BentoSearch::ResultItem.new(:title => "Item #{i}: #{args[:query]}", :link => configuration.link)
|
8
|
-
end
|
9
|
-
results.total_items = configuration.total_items
|
10
|
-
return results
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.default_configuration
|
14
|
-
{ :num_results => 10,
|
15
|
-
:total_items => 1000,
|
16
|
-
:link => "http://example.org"}
|
17
|
-
end
|
18
|
-
|
19
|
-
def sort_definitions
|
20
|
-
configuration.sort_definitions || {}
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
data/test/unit/#vcr_test.rb#
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
require 'httpclient'
|
2
|
-
require 'vcr'
|
3
|
-
require 'webmock'
|
4
|
-
require 'test/unit'
|
5
|
-
|
6
|
-
# To allow us to do real HTTP requests in a VCR.turned_off, we
|
7
|
-
# have to tell webmock to let us.
|
8
|
-
WebMock.allow_net_connect!
|
9
|
-
|
10
|
-
VCR.configure do |c|
|
11
|
-
c.cassette_library_dir = 'test/vcr_cassettes'
|
12
|
-
# webmock needed for HTTPClient testing
|
13
|
-
c.hook_into :webmock
|
14
|
-
end
|
15
|
-
|
16
|
-
class VcrTest < Test::Unit::TestCase
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
@@http_client = HTTPClient.new
|
22
|
-
|
23
|
-
|
24
|
-
def setup
|
25
|
-
@body = "{ \"UserId\":\"user\", \"Password\":\"password\" } "
|
26
|
-
# this was originally a real vendor URL, but test is reproducible
|
27
|
-
# even with this fake URL that isn't connectable.
|
28
|
-
# But reproduces with a real URL that
|
29
|
-
# accepts POSTs too.
|
30
|
-
@url = "http://example.org"
|
31
|
-
|
32
|
-
end
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
def test_get_one
|
37
|
-
VCR.use_cassette("test_one") do
|
38
|
-
response = @@http_client.post(@url, @body)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def test_get_two
|
43
|
-
VCR.use_cassette("test_two") do
|
44
|
-
response = @@http_client.post(@url, @body)
|
45
|
-
end
|
46
|
-
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
# If this VCR.turned_off is present, for some reason we get
|
51
|
-
# the "appears to be a bug in Webmock's" warning even when
|
52
|
-
# re-playing pre-recorded cassettes, otherwise only when
|
53
|
-
# recording.
|
54
|
-
def test_aaa_turned_off
|
55
|
-
VCR.turned_off do
|
56
|
-
response = @@http_client.post(@url, @body)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
end
|