crunchbase4 0.2.2 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +20 -2
- data/lib/crunchbase/searches/client.rb +3 -1
- data/lib/crunchbase/utilities/search_query_parameters.rb +7 -6
- data/lib/crunchbase/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce0e0ef863b2ccbcdf683719fb8a36ba0a900208e1a6ff13a69b6c8f7f6acd90
|
4
|
+
data.tar.gz: 4ec2bfcea56efe70cff7e9831de381b46fb5fb0811db889dd70fb17c111f393c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b84de4848db6f199c01a30f6f36111abc0ce26e11d1dc81c64c229be4c5e405cbe403c05ba8021361088da78dd5c1a7806a1d0d251b0e7f9851d2fef492df6a
|
7
|
+
data.tar.gz: 88d4857e5118750877df2c3a4e0833f0c44d5b1c04dbad092b5771c56e1ec1177d639817f50bd9f29cdaedb5e9ddbe5e5b5043a7d8bec6bb3e2cc5ebb1454367
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
crunchbase4 (0.2.
|
4
|
+
crunchbase4 (0.2.4)
|
5
5
|
faraday
|
6
6
|
faraday_curl
|
7
7
|
faraday_middleware
|
@@ -17,8 +17,25 @@ GEM
|
|
17
17
|
crack (0.4.3)
|
18
18
|
safe_yaml (~> 1.0.0)
|
19
19
|
diff-lcs (1.5.0)
|
20
|
-
faraday (1.0
|
20
|
+
faraday (1.8.0)
|
21
|
+
faraday-em_http (~> 1.0)
|
22
|
+
faraday-em_synchrony (~> 1.0)
|
23
|
+
faraday-excon (~> 1.1)
|
24
|
+
faraday-httpclient (~> 1.0.1)
|
25
|
+
faraday-net_http (~> 1.0)
|
26
|
+
faraday-net_http_persistent (~> 1.1)
|
27
|
+
faraday-patron (~> 1.0)
|
28
|
+
faraday-rack (~> 1.0)
|
21
29
|
multipart-post (>= 1.2, < 3)
|
30
|
+
ruby2_keywords (>= 0.0.4)
|
31
|
+
faraday-em_http (1.0.0)
|
32
|
+
faraday-em_synchrony (1.0.0)
|
33
|
+
faraday-excon (1.1.0)
|
34
|
+
faraday-httpclient (1.0.1)
|
35
|
+
faraday-net_http (1.0.1)
|
36
|
+
faraday-net_http_persistent (1.2.0)
|
37
|
+
faraday-patron (1.0.0)
|
38
|
+
faraday-rack (1.0.0)
|
22
39
|
faraday_curl (0.0.2)
|
23
40
|
faraday (>= 0.9.0)
|
24
41
|
faraday_middleware (1.2.0)
|
@@ -64,6 +81,7 @@ GEM
|
|
64
81
|
ruby-progressbar (~> 1.7)
|
65
82
|
unicode-display_width (>= 1.4.0, < 2.0)
|
66
83
|
ruby-progressbar (1.10.1)
|
84
|
+
ruby2_keywords (0.0.5)
|
67
85
|
safe_yaml (1.0.5)
|
68
86
|
unicode-display_width (1.7.0)
|
69
87
|
vcr (6.0.0)
|
@@ -73,8 +73,10 @@ module Crunchbase
|
|
73
73
|
'field_ids' => field_ids,
|
74
74
|
'order' => @conditions['order'],
|
75
75
|
'query' => @conditions['query'],
|
76
|
+
'before_id' => @conditions['before_id'],
|
77
|
+
'after_id' => @conditions['after_id'],
|
76
78
|
'limit' => limit
|
77
|
-
}
|
79
|
+
}.delete_if { |_, v| v.nil? }
|
78
80
|
end
|
79
81
|
end
|
80
82
|
end
|
@@ -11,7 +11,7 @@ module Crunchbase
|
|
11
11
|
#
|
12
12
|
# Search Query Parameters
|
13
13
|
#
|
14
|
-
#
|
14
|
+
# order_field_ids: sort field, default field will be updated_at
|
15
15
|
# field_ids: array of field_id strings
|
16
16
|
# Fields to include as columns in the search result entities
|
17
17
|
# query: Search query to perform on the designated entity
|
@@ -26,11 +26,12 @@ module Crunchbase
|
|
26
26
|
# Used to paginate search results to the next page.
|
27
27
|
# after_id should be the uuid of the last item in the current page. May not be provided simultaneously with before_id.
|
28
28
|
def query_parameters(args)
|
29
|
-
|
29
|
+
order_field_ids = args[:order_field_ids] || ['updated_at']
|
30
|
+
order_conditions = order_field_ids.map { |field_id| { 'field_id' => field_id, 'sort' => (args[:sort] || 'desc'), 'nulls' => 'last' } }
|
30
31
|
|
31
32
|
params = {
|
32
33
|
'field_ids' => default_field_ids + (args[:field_ids] || []).uniq,
|
33
|
-
'order' =>
|
34
|
+
'order' => order_conditions,
|
34
35
|
'limit' => args[:limit] || 1000
|
35
36
|
}
|
36
37
|
|
@@ -39,7 +40,7 @@ module Crunchbase
|
|
39
40
|
'query' => [
|
40
41
|
{
|
41
42
|
'type' => 'predicate',
|
42
|
-
'field_id' =>
|
43
|
+
'field_id' => order_field_ids[0],
|
43
44
|
'operator_id' => 'gte',
|
44
45
|
'values' => [
|
45
46
|
args[:date]
|
@@ -48,8 +49,8 @@ module Crunchbase
|
|
48
49
|
]
|
49
50
|
)
|
50
51
|
end
|
51
|
-
params
|
52
|
-
params
|
52
|
+
params['before_id'] = args[:before_id] unless args[:before_id].nil?
|
53
|
+
params['after_id'] = args[:after_id] unless args[:after_id].nil?
|
53
54
|
params
|
54
55
|
end
|
55
56
|
|
data/lib/crunchbase/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crunchbase4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Encore Shao
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|