crunchbase-ruby-library 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -3
- data/README.md +16 -10
- data/bin/console +2 -0
- data/lib/crunchbase.rb +1 -1
- data/lib/crunchbase/api.rb +2 -2
- data/lib/crunchbase/version.rb +1 -1
- data/spec/crunchbase.yml.example +1 -0
- data/spec/spec_helper.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c1369c879d7ae6abcc3c0691d052e349da787cb
|
4
|
+
data.tar.gz: 5a0767cf583d4ba492e8573e47bd8190180881a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53d5afedbb3347f6070c20ef3cb121a4f87b8597c5033145f29910e6df0c26ce1b0c4aad8b58be79fcd391fd441394ef0e749e3421758f9df68c0c7afd8a3313
|
7
|
+
data.tar.gz: 9edc9efb7e651c8535b12509ec3fe8caa8512092cf749ae6bc5b48a3a93186e126c13627da2d34f58cb6f83ecdf4e74de821dd2fc91dcde85da86ba0627113c0
|
data/.rubocop.yml
CHANGED
@@ -4,7 +4,7 @@ inherit_from: .rubocop_todo.yml
|
|
4
4
|
|
5
5
|
AllCops:
|
6
6
|
DisplayCopNames: true
|
7
|
-
TargetRubyVersion: 2.
|
7
|
+
TargetRubyVersion: 2.4
|
8
8
|
Exclude:
|
9
9
|
- '**/*.yml'
|
10
10
|
- 'tmp/**/*'
|
@@ -45,11 +45,11 @@ Style/StringLiteralsInInterpolation:
|
|
45
45
|
|
46
46
|
Style/CaseIndentation:
|
47
47
|
# Valid values are: case, end
|
48
|
-
|
48
|
+
EnforcedStyle: end
|
49
49
|
IndentOneStep: false
|
50
50
|
|
51
51
|
Lint/EndAlignment:
|
52
|
-
|
52
|
+
EnforcedStyleAlignWith: variable
|
53
53
|
|
54
54
|
Lint/UselessAssignment:
|
55
55
|
Enabled: false
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# CrunchBase
|
2
2
|
|
3
3
|
Crunchbase API v3.1 - Ruby Library [CrunchBase Data Hub](https://data.crunchbase.com/v3.1/docs/using-the-api).
|
4
4
|
|
@@ -22,13 +22,13 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
### Certificate (User Key)
|
24
24
|
|
25
|
-
Create the file `config/initializers/crunchbase.rb` in your rails project and add
|
25
|
+
Create the file `config/initializers/crunchbase.rb` in your rails project and add user key.
|
26
26
|
|
27
27
|
require 'crunchbase'
|
28
28
|
|
29
29
|
Crunchbase::API.key = 'user_key'
|
30
30
|
Crunchbase::API.debug = false
|
31
|
-
Crunchbase::API.
|
31
|
+
Crunchbase::API.timeout = 60 # Default value is 60
|
32
32
|
|
33
33
|
### Creating request client
|
34
34
|
|
@@ -66,14 +66,19 @@ Create the file `config/initializers/crunchbase.rb` in your rails project and ad
|
|
66
66
|
|
67
67
|
### Get Organization by the permalink
|
68
68
|
|
69
|
-
|
69
|
+
* response = client.get('facebook', 'Organization')
|
70
70
|
|
71
|
-
Relationship objects
|
71
|
+
- Relationship objects
|
72
|
+
[
|
73
|
+
primary_image founders current_team investors owned_by sub_organizations
|
74
|
+
headquarters offices products categories customers competitors
|
75
|
+
members memberships funding_rounds investments acquisitions acquired_by
|
76
|
+
ipo funds websites images videos news
|
77
|
+
]
|
72
78
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
past_team.results.collect { |p| [p.title, p.person.first_name] }
|
79
|
+
- Methods: Get Organization with one relationship data
|
80
|
+
* response = client.get('facebook', 'Organization', 'PastTeam')
|
81
|
+
* past_team.results.collect { |p| [p.title, p.person.first_name] }
|
77
82
|
|
78
83
|
....
|
79
84
|
|
@@ -113,7 +118,8 @@ Max 10 requests per search allowed.
|
|
113
118
|
|
114
119
|
### How to debug in the console
|
115
120
|
|
116
|
-
$ ruby bin/console
|
121
|
+
$ 1. ruby bin/console
|
122
|
+
$ 2. ./bin/console
|
117
123
|
=> client = Crunchbase::Client.new
|
118
124
|
=> ...
|
119
125
|
|
data/bin/console
CHANGED
@@ -7,8 +7,10 @@ require 'yaml'
|
|
7
7
|
|
8
8
|
# Setup the user key for API
|
9
9
|
yaml = YAML.load_file(File.join(File.dirname(__FILE__), '..', 'spec', 'crunchbase.yml'))
|
10
|
+
|
10
11
|
Crunchbase::API.key = yaml['key']
|
11
12
|
Crunchbase::API.debug = yaml['debug']
|
13
|
+
Crunchbase::API.timeout = yaml['timeout']
|
12
14
|
|
13
15
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
14
16
|
require "pry"
|
data/lib/crunchbase.rb
CHANGED
@@ -12,7 +12,7 @@ require 'crunchbase/api'
|
|
12
12
|
require 'crunchbase/exception'
|
13
13
|
|
14
14
|
module Crunchbase
|
15
|
-
API_VERSION = '
|
15
|
+
API_VERSION = 'v3.1'.freeze
|
16
16
|
API_BASE_URL = 'https://api.crunchbase.com'.freeze
|
17
17
|
WEB_SITE_URL = 'https://www.crunchbase.com'.freeze
|
18
18
|
IMAGE_URL = 'https://res.cloudinary.com/crunchbase-production/'.freeze
|
data/lib/crunchbase/api.rb
CHANGED
@@ -37,7 +37,7 @@ module Crunchbase
|
|
37
37
|
}.freeze
|
38
38
|
|
39
39
|
@redirect_limit = 2
|
40
|
-
@timeout
|
40
|
+
@timeout = 60
|
41
41
|
@debug = false
|
42
42
|
|
43
43
|
# Must be overridden in subclasses
|
@@ -54,7 +54,7 @@ module Crunchbase
|
|
54
54
|
attr_accessor :debug, :timeout, :redirect_limit
|
55
55
|
|
56
56
|
def api_url
|
57
|
-
API_BASE_URL
|
57
|
+
[API_BASE_URL, '/', API_VERSION, '/'].join
|
58
58
|
end
|
59
59
|
|
60
60
|
def single_entity(permalink, entity_name)
|
data/lib/crunchbase/version.rb
CHANGED
data/spec/crunchbase.yml.example
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -14,6 +14,7 @@ yaml = YAML.load_file(File.join(File.dirname(__FILE__), 'crunchbase.yml'))
|
|
14
14
|
|
15
15
|
Crunchbase::API.key = yaml['key']
|
16
16
|
Crunchbase::API.debug = yaml['debug']
|
17
|
+
Crunchbase::API.timeout = yaml['timeout']
|
17
18
|
|
18
19
|
Dir[File.dirname(__FILE__) + '/crunchbase/support/*.rb'].each { |file| require file }
|
19
20
|
|