Skip to content

Commit

Permalink
Added algoliasearch [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Jun 17, 2019
1 parent aca8cad commit 17ddd6d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -7,6 +7,7 @@ gem "activerecord", require: "active_record"
gem "activeresource"
gem "active_shipping", git: "https://github.com/Shopify/active_shipping.git"
gem "airtable"
gem "algoliasearch"
gem "aws-sdk-s3"
#gem "azure_mgmt_compute"
gem "bitly"
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Expand Up @@ -76,6 +76,9 @@ GEM
akami (1.3.1)
gyoku (>= 0.4.0)
nokogiri
algoliasearch (1.26.0)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
amq-protocol (2.3.0)
arel (9.0.0)
aws-eventstream (1.0.3)
Expand Down Expand Up @@ -516,6 +519,7 @@ DEPENDENCIES
activerecord
activeresource
airtable
algoliasearch
aws-sdk-s3
bitly
bunny
Expand Down
15 changes: 15 additions & 0 deletions README.md
Expand Up @@ -81,6 +81,7 @@ Rack Middleware

- [airrecord](#airrecord)
- [airtable](#airtable)
- [algoliasearch](#algoliasearch)
- [aws-sdk](#aws-sdk)
- [azure](#azure)
- [bitly](#bitly)
Expand Down Expand Up @@ -869,6 +870,20 @@ Raises
- `Net::OpenTimeout` on connect timeout
- `Net::ReadTimeout` on read timeout

### algoliasearch

```ruby
Algolia.init(
connect_timeout: 1,
send_timeout: 1,
receive_timeout: 1,
batch_timeout: 1,
search_timeout: 1
)
```

Raises `Algolia::AlgoliaProtocolError`

### aws-sdk

```ruby
Expand Down
19 changes: 19 additions & 0 deletions test/algoliasearch_test.rb
@@ -0,0 +1,19 @@
require_relative "test_helper"

class AlgoliasearchTest < Minitest::Test
def test_connect
Algolia.init(application_id: "id", hosts: [connect_host], connect_timeout: 1)

assert_timeout(Algolia::AlgoliaProtocolError) do
Algolia::Index.new("index").search("hi")
end
end

def test_read
Algolia.init(application_id: "id", hosts: [read_host_and_port], receive_timeout: 1)

assert_timeout(Algolia::AlgoliaProtocolError) do
Algolia::Index.new("index").search("hi")
end
end
end

0 comments on commit 17ddd6d

Please sign in to comment.