juicer-client 1.1.0 → 1.1.1

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: 427f04d658cf29b4589b1fb322d51485742b6bb3
4
- data.tar.gz: 7a1a2aa498ff8beaff557423f7caa996ea9cb3c5
3
+ metadata.gz: bdb73311c4a89561de69bc19fddb8cb331ba73b5
4
+ data.tar.gz: e33e77dfc8afd4a9b7d4a34e14c69bb43c5fc7ce
5
5
  SHA512:
6
- metadata.gz: 2e7f86ddac59c84017c3bda094fc6689037ea6eef2b7969d59f32c11ecbfaec6560251efc10b39621c6b41ca06ec62378b3845b538da660794882d17fd2206b4
7
- data.tar.gz: b4b550ea714f5c59c90681ea34c196aca66fcc0568d32cb251689ca85860aa66d96f30930ed5820922bcf045e73f9e400021f8413a1c16d22542e29d7ca66b48
6
+ metadata.gz: c80f07b3b4d8c8813ee0e27c81db565838f15697823f4e65d2d0394386b7518f789ccafc874148a01451f5ebf93f97e1524a38c78ac01f39ec6710947458b38b
7
+ data.tar.gz: 87572ae27003b4694908e9f4d2b22d0dfba9be7a0726a3b1391dfc67030dade09156276e65c42f865e0edefe1b3b60ea8dea9c7a33e6e8b90d9c66959f2e4a94
@@ -1,4 +1,5 @@
1
1
  # @author Karl Sutt
2
+ require 'juicer/client'
2
3
 
3
4
  class Juicer
4
5
 
@@ -50,6 +51,7 @@ class Juicer
50
51
  # of results.
51
52
  #
52
53
  # @param opts [Hash] a Hash of filter options.
54
+ #
53
55
  # Possible keys are:
54
56
  #
55
57
  # * `text` - a search term, corresponds to Lucene syntax.
@@ -79,15 +81,16 @@ class Juicer
79
81
  # find semantically similar documents.
80
82
  #
81
83
  # @param cps_id [String] the `cps_id` of an article.
82
- # @param opts [Hash] a Hash of query options
84
+ # @param opts [Hash] a Hash of query options.
85
+ #
83
86
  # Possible keys are:
84
87
  #
85
88
  # * `size` - how many results to return. Results are ordered by their
86
89
  # "match" score, i.e how similar they are to a given article, and the
87
90
  # top `size` results are returned.
88
- # * `product` - an [Array] of products to scope to. See {#products}.
89
- # @return [Array<Hash>] list of similar articles. Currently capped to 10 most
90
- # similar.
91
+ # * `product` - a list of products to scope to. See {#products}.
92
+ # @return [Array<Hash>] list of similar articles. Defaults to 10 most similar
93
+ # across all products.
91
94
  #
92
95
  def similar_articles(cps_id, opts = {})
93
96
  @client.request(:get, "articles/#{cps_id}/similar", opts)["results"]
@@ -97,15 +100,16 @@ class Juicer
97
100
  # algorithm to find semantically similar documents.
98
101
  #
99
102
  # @param text [String] a blob of text.
100
- # @param opts [Hash] a Hash of query options
103
+ # @param opts [Hash] a Hash of query options.
104
+ #
101
105
  # Possible keys are:
102
106
  #
103
107
  # * `size` - how many results to return. Results are ordered by their
104
108
  # "match" score, i.e how similar they are to the given blob of text, and
105
109
  # the top `size` results are returned.
106
- # * `product` - an [Array] of products to scope to. See {#products}.
107
- # @return [Array<Hash>] list of similar articles. Currently capped to 10 most
108
- # similar.
110
+ # * `product` - a list of products to scope to. See {#products}.
111
+ # @return [Array<Hash>] list of similar articles. Defaults to 10 most similar
112
+ # across all products.
109
113
  #
110
114
  def similar_to(text, opts = {})
111
115
  body = { like_text: URI.encode(text) }.to_json
@@ -1,3 +1,3 @@
1
1
  class Juicer
2
- VERSION = "1.1.0".freeze
2
+ VERSION = "1.1.1".freeze
3
3
  end
@@ -1,5 +1,5 @@
1
1
  require 'juicer'
2
- require 'juicer/client'
3
2
  require 'webmock/rspec'
4
3
 
5
4
  WebMock.disable_net_connect!(allow_localhost: true)
5
+ HTTPI.log = false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: juicer-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Sutt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-21 00:00:00.000000000 Z
11
+ date: 2014-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpi