exa-rb 1.0.0 → 1.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 +4 -4
- data/README.md +6 -6
- data/lib/exa/contents_result.rb +7 -0
- data/lib/exa/find_similar_result.rb +7 -0
- data/lib/exa/search_result.rb +7 -0
- data/lib/exa/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 217e30c7475a064fe3e6c931f37f2d1a3c91c93288e9c2dfb0d6cce59c150fd1
|
|
4
|
+
data.tar.gz: a0ee59434fc75c2ef9368fc632ff432c97090f6bd5429a384d33dea84ed36e81
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 86c8628fbb5a248beb68563180a54f8d84c2a105ad73a9d697636582a0bcb4017ed44e618c06291751dc72b25b01c3dff2f268ba92d222bdfdba3ee2530767d2
|
|
7
|
+
data.tar.gz: 683957160daa5b79187d1faf2b2859df3d546637807e94d9dd8b6d3eff38b56fabbe1cc067f1cc0eaa0e8583f6e2b0e06634e4e1ad9b7876830db39a13e41ed2
|
data/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Exa.api_key ENV[ 'EXA_API_KEY' ]
|
|
|
9
9
|
|
|
10
10
|
response = Exa.search( 'best practices for Ruby API design' )
|
|
11
11
|
if response.success?
|
|
12
|
-
response.result.
|
|
12
|
+
response.result.each do | result |
|
|
13
13
|
puts result.title
|
|
14
14
|
puts result.url
|
|
15
15
|
end
|
|
@@ -81,7 +81,7 @@ Exa.api_key ENV[ 'EXA_API_KEY' ]
|
|
|
81
81
|
|
|
82
82
|
response = Exa.search( 'machine learning tutorials' )
|
|
83
83
|
if response.success?
|
|
84
|
-
response.result.
|
|
84
|
+
response.result.each do | result |
|
|
85
85
|
puts result.title
|
|
86
86
|
puts result.url
|
|
87
87
|
end
|
|
@@ -126,7 +126,7 @@ end
|
|
|
126
126
|
response = Exa.search( 'Ruby dependency injection patterns', options )
|
|
127
127
|
|
|
128
128
|
if response.success?
|
|
129
|
-
response.result.
|
|
129
|
+
response.result.each do | result |
|
|
130
130
|
puts result.title
|
|
131
131
|
puts result.url
|
|
132
132
|
puts result.summary
|
|
@@ -152,7 +152,7 @@ end
|
|
|
152
152
|
response = Exa.find_similar( 'https://www.ruby-lang.org/en/', options )
|
|
153
153
|
|
|
154
154
|
if response.success?
|
|
155
|
-
response.result.
|
|
155
|
+
response.result.each do | result |
|
|
156
156
|
puts result.title
|
|
157
157
|
puts result.url
|
|
158
158
|
puts result.summary
|
|
@@ -212,7 +212,7 @@ end
|
|
|
212
212
|
response = Exa.contents( urls, options )
|
|
213
213
|
|
|
214
214
|
if response.success?
|
|
215
|
-
response.result.
|
|
215
|
+
response.result.each do | result |
|
|
216
216
|
puts result.title
|
|
217
217
|
puts result.text
|
|
218
218
|
end
|
|
@@ -232,7 +232,7 @@ response = Exa.search( query, options )
|
|
|
232
232
|
|
|
233
233
|
if response.success?
|
|
234
234
|
result = response.result
|
|
235
|
-
result.
|
|
235
|
+
result.each do | item |
|
|
236
236
|
puts item.title
|
|
237
237
|
end
|
|
238
238
|
else
|
data/lib/exa/contents_result.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'forwardable'
|
|
2
|
+
|
|
1
3
|
module Exa
|
|
2
4
|
|
|
3
5
|
ContentsResultItemSchema = DynamicSchema::Struct.define do
|
|
@@ -22,6 +24,11 @@ module Exa
|
|
|
22
24
|
end
|
|
23
25
|
|
|
24
26
|
class ContentsResult < ContentsResultSchema
|
|
27
|
+
extend Forwardable
|
|
28
|
+
include Enumerable
|
|
29
|
+
|
|
30
|
+
def_delegators :results, :each, :[], :count, :size, :length, :first, :last, :empty?
|
|
31
|
+
|
|
25
32
|
def success?
|
|
26
33
|
true
|
|
27
34
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'forwardable'
|
|
2
|
+
|
|
1
3
|
module Exa
|
|
2
4
|
|
|
3
5
|
FindSimilarResultItemSchema = DynamicSchema::Struct.define do
|
|
@@ -24,6 +26,11 @@ module Exa
|
|
|
24
26
|
end
|
|
25
27
|
|
|
26
28
|
class FindSimilarResult < FindSimilarResultSchema
|
|
29
|
+
extend Forwardable
|
|
30
|
+
include Enumerable
|
|
31
|
+
|
|
32
|
+
def_delegators :results, :each, :[], :count, :size, :length, :first, :last, :empty?
|
|
33
|
+
|
|
27
34
|
def success?
|
|
28
35
|
true
|
|
29
36
|
end
|
data/lib/exa/search_result.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'forwardable'
|
|
2
|
+
|
|
1
3
|
module Exa
|
|
2
4
|
|
|
3
5
|
SearchResultItemSchema = DynamicSchema::Struct.define do
|
|
@@ -34,6 +36,11 @@ module Exa
|
|
|
34
36
|
end
|
|
35
37
|
|
|
36
38
|
class SearchResult < SearchResultSchema
|
|
39
|
+
extend Forwardable
|
|
40
|
+
include Enumerable
|
|
41
|
+
|
|
42
|
+
def_delegators :results, :each, :[], :count, :size, :length, :first, :last, :empty?
|
|
43
|
+
|
|
37
44
|
def success?
|
|
38
45
|
true
|
|
39
46
|
end
|
data/lib/exa/version.rb
CHANGED