crunchbase-ruby-library 0.3.6 → 0.3.7
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 +5 -5
- data/.rubocop.yml +0 -65
- data/.rubocop_todo.yml +54 -16
- data/Gemfile +1 -0
- data/Rakefile +1 -0
- data/bin/console +1 -1
- data/crunchbase-ruby-library.gemspec +2 -2
- data/lib/crunchbase.rb +1 -0
- data/lib/crunchbase/api.rb +1 -0
- data/lib/crunchbase/client.rb +1 -0
- data/lib/crunchbase/model/acquired_by.rb +0 -1
- data/lib/crunchbase/model/acquiree.rb +0 -1
- data/lib/crunchbase/model/acquirer.rb +0 -1
- data/lib/crunchbase/model/acquisition.rb +0 -1
- data/lib/crunchbase/model/address.rb +0 -1
- data/lib/crunchbase/model/advisory_role.rb +0 -1
- data/lib/crunchbase/model/batch_search.rb +0 -1
- data/lib/crunchbase/model/board_members_and_advisor.rb +0 -1
- data/lib/crunchbase/model/category.rb +0 -1
- data/lib/crunchbase/model/competitor.rb +0 -1
- data/lib/crunchbase/model/current_team.rb +0 -1
- data/lib/crunchbase/model/customer.rb +0 -1
- data/lib/crunchbase/model/degree.rb +3 -4
- data/lib/crunchbase/model/entity.rb +8 -5
- data/lib/crunchbase/model/error.rb +0 -1
- data/lib/crunchbase/model/founded_company.rb +0 -1
- data/lib/crunchbase/model/founder.rb +0 -1
- data/lib/crunchbase/model/fund.rb +1 -0
- data/lib/crunchbase/model/fund_raise.rb +1 -0
- data/lib/crunchbase/model/funding_round.rb +1 -1
- data/lib/crunchbase/model/headquarter.rb +0 -1
- data/lib/crunchbase/model/image.rb +0 -1
- data/lib/crunchbase/model/investment.rb +0 -1
- data/lib/crunchbase/model/investor.rb +0 -1
- data/lib/crunchbase/model/ipo.rb +0 -1
- data/lib/crunchbase/model/job.rb +8 -7
- data/lib/crunchbase/model/location.rb +0 -1
- data/lib/crunchbase/model/member.rb +0 -1
- data/lib/crunchbase/model/membership.rb +0 -1
- data/lib/crunchbase/model/new.rb +0 -1
- data/lib/crunchbase/model/office.rb +0 -1
- data/lib/crunchbase/model/organization.rb +14 -16
- data/lib/crunchbase/model/organization_summary.rb +0 -1
- data/lib/crunchbase/model/owned_by.rb +0 -1
- data/lib/crunchbase/model/parent_location.rb +0 -1
- data/lib/crunchbase/model/past_team.rb +0 -1
- data/lib/crunchbase/model/person.rb +9 -8
- data/lib/crunchbase/model/person_summary.rb +0 -1
- data/lib/crunchbase/model/primary_affiliation.rb +3 -4
- data/lib/crunchbase/model/primary_image.rb +0 -1
- data/lib/crunchbase/model/primary_location.rb +0 -1
- data/lib/crunchbase/model/product.rb +0 -1
- data/lib/crunchbase/model/product_summary.rb +1 -0
- data/lib/crunchbase/model/school.rb +0 -1
- data/lib/crunchbase/model/search.rb +0 -1
- data/lib/crunchbase/model/search_result.rb +1 -3
- data/lib/crunchbase/model/simple_organization.rb +0 -1
- data/lib/crunchbase/model/sub_organization.rb +0 -1
- data/lib/crunchbase/model/video.rb +0 -1
- data/lib/crunchbase/model/website.rb +0 -1
- data/lib/crunchbase/version.rb +1 -1
- data/spec/crunchbase/data/organizations/crunchbase.json +2853 -1344
- data/spec/crunchbase/model/funding_round_spec.rb +2 -2
- data/spec/crunchbase/model/organization_spec.rb +170 -146
- data/spec/crunchbase/support/api_helper.rb +8 -5
- data/spec/spec_helper.rb +1 -0
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 035b17e4db96ed91ac46095be4bc775dad93062408b1ff1b9b8b40f641570357
|
4
|
+
data.tar.gz: f3b7534bfaf1494f76ac9d08535787412e9828e1e9f0fcae7ed73d826c8b7a35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7383ecfeb84864295c6dc163d6da678e85082973e73b0cb0cde3a55ad8406264bd95ceea01c378aeb72a01b6c7bcfbe5417d28afceb28322d6fe73ff984ee72e
|
7
|
+
data.tar.gz: 9ea83223558b62835bc716305438aa4bf922a4a94bdba87a8dd335dec8f275ddfe7afaed4a99bbef6eaa4f2f94fa7643f1a9236c26569988cf66ae195350d5b1
|
data/.rubocop.yml
CHANGED
@@ -1,66 +1 @@
|
|
1
|
-
# This is the configuration used to check the rubocop source code.
|
2
|
-
|
3
1
|
inherit_from: .rubocop_todo.yml
|
4
|
-
|
5
|
-
AllCops:
|
6
|
-
DisplayCopNames: true
|
7
|
-
TargetRubyVersion: 2.4
|
8
|
-
Exclude:
|
9
|
-
- '**/*.yml'
|
10
|
-
- 'tmp/**/*'
|
11
|
-
|
12
|
-
Style/StringLiterals:
|
13
|
-
Enabled: false
|
14
|
-
|
15
|
-
Documentation:
|
16
|
-
Enabled: false
|
17
|
-
|
18
|
-
Style/RegexpLiteral:
|
19
|
-
Enabled: false
|
20
|
-
|
21
|
-
Style/SpaceInsideHashLiteralBraces:
|
22
|
-
Enabled: false
|
23
|
-
|
24
|
-
Style/DotPosition:
|
25
|
-
EnforcedStyle: trailing
|
26
|
-
|
27
|
-
Style/FormatString:
|
28
|
-
Enabled: false
|
29
|
-
|
30
|
-
Lint/AssignmentInCondition:
|
31
|
-
Enabled: false
|
32
|
-
|
33
|
-
Style/EmptyLinesAroundAccessModifier:
|
34
|
-
Enabled: false
|
35
|
-
|
36
|
-
Style/SingleLineBlockParams:
|
37
|
-
Enabled: false
|
38
|
-
|
39
|
-
Style/NumericLiterals:
|
40
|
-
Exclude:
|
41
|
-
- 'spec/**/*'
|
42
|
-
|
43
|
-
Style/StringLiteralsInInterpolation:
|
44
|
-
Enabled: false
|
45
|
-
|
46
|
-
Style/CaseIndentation:
|
47
|
-
# Valid values are: case, end
|
48
|
-
EnforcedStyle: end
|
49
|
-
IndentOneStep: false
|
50
|
-
|
51
|
-
Lint/EndAlignment:
|
52
|
-
EnforcedStyleAlignWith: variable
|
53
|
-
|
54
|
-
Lint/UselessAssignment:
|
55
|
-
Enabled: false
|
56
|
-
|
57
|
-
Style/NumericLiterals:
|
58
|
-
Enabled: false
|
59
|
-
|
60
|
-
Metrics/BlockLength:
|
61
|
-
Exclude:
|
62
|
-
- "**/*_spec.rb"
|
63
|
-
|
64
|
-
Metrics/ModuleLength:
|
65
|
-
Exclude:
|
66
|
-
- "**/*_spec.rb"
|
data/.rubocop_todo.yml
CHANGED
@@ -1,47 +1,85 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2019-12-07 15:33:05 +0800 using RuboCop version 0.77.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
9
|
+
# Offense count: 1
|
10
|
+
Lint/DuplicateMethods:
|
11
|
+
Exclude: false
|
12
|
+
|
13
|
+
# Offense count: 2
|
14
|
+
Lint/UriEscapeUnescape:
|
15
|
+
Exclude:
|
16
|
+
- 'lib/crunchbase/api.rb'
|
17
|
+
|
18
|
+
# Offense count: 5
|
10
19
|
Metrics/AbcSize:
|
11
|
-
Max:
|
20
|
+
Max: 23
|
21
|
+
|
22
|
+
Metrics/ModuleLength:
|
23
|
+
Max: 468
|
24
|
+
|
25
|
+
# Offense count: 22
|
26
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
27
|
+
# ExcludedMethods: refine
|
28
|
+
Metrics/BlockLength:
|
29
|
+
Max: 368
|
12
30
|
|
13
31
|
# Offense count: 1
|
14
32
|
# Configuration parameters: CountComments.
|
15
33
|
Metrics/ClassLength:
|
16
|
-
Max:
|
34
|
+
Max: 152
|
17
35
|
|
18
36
|
# Offense count: 1
|
19
37
|
Metrics/CyclomaticComplexity:
|
20
38
|
Max: 7
|
21
39
|
|
22
|
-
# Offense count:
|
23
|
-
# Configuration parameters:
|
24
|
-
# URISchemes: http, https
|
25
|
-
Metrics/LineLength:
|
26
|
-
Max: 267
|
27
|
-
|
28
|
-
# Offense count: 7
|
29
|
-
# Configuration parameters: CountComments.
|
40
|
+
# Offense count: 4
|
41
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
30
42
|
Metrics/MethodLength:
|
31
43
|
Max: 28
|
32
44
|
|
33
|
-
# Offense count:
|
34
|
-
#
|
45
|
+
# Offense count: 50
|
46
|
+
# Cop supports --auto-correct.
|
47
|
+
# Configuration parameters: AutoCorrect, EnforcedStyle.
|
35
48
|
# SupportedStyles: nested, compact
|
36
49
|
Style/ClassAndModuleChildren:
|
37
50
|
Enabled: false
|
38
51
|
|
39
|
-
# Offense count:
|
52
|
+
# Offense count: 44
|
40
53
|
Style/Documentation:
|
41
54
|
Enabled: false
|
42
55
|
|
43
|
-
# Offense count:
|
56
|
+
# Offense count: 2
|
44
57
|
# Configuration parameters: MinBodyLength.
|
45
58
|
Style/GuardClause:
|
59
|
+
Exclude: false
|
60
|
+
|
61
|
+
# Offense count: 3
|
62
|
+
# Cop supports --auto-correct.
|
63
|
+
# Configuration parameters: Strict.
|
64
|
+
Style/NumericLiterals:
|
65
|
+
MinDigits: 11
|
66
|
+
|
67
|
+
Style/RedundantFreeze:
|
68
|
+
Enabled: false
|
69
|
+
|
70
|
+
Style/PercentLiteralDelimiters:
|
46
71
|
Enabled: false
|
47
72
|
|
73
|
+
# Offense count: 3
|
74
|
+
# Cop supports --auto-correct.
|
75
|
+
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
76
|
+
# SupportedStyles: single_quotes, double_quotes
|
77
|
+
Style/StringLiterals:
|
78
|
+
Exclude: false
|
79
|
+
|
80
|
+
# Offense count: 146
|
81
|
+
# Cop supports --auto-correct.
|
82
|
+
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
83
|
+
# URISchemes: http, https
|
84
|
+
Metrics/LineLength:
|
85
|
+
Max: 234
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
lib = File.expand_path('
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
5
|
require 'crunchbase/version'
|
6
6
|
|
@@ -20,8 +20,8 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
22
|
spec.add_development_dependency 'bundler'
|
23
|
-
spec.add_development_dependency 'rake'
|
24
23
|
spec.add_development_dependency 'pry'
|
24
|
+
spec.add_development_dependency 'rake'
|
25
25
|
spec.add_development_dependency 'rspec'
|
26
26
|
spec.add_development_dependency 'rspec-its'
|
27
27
|
spec.add_development_dependency 'rubocop'
|
data/lib/crunchbase.rb
CHANGED
data/lib/crunchbase/api.rb
CHANGED
@@ -134,6 +134,7 @@ module Crunchbase
|
|
134
134
|
# JSON contains an error.
|
135
135
|
def get_json_response(uri)
|
136
136
|
raise Exception, 'User key required, visit https://data.crunchbase.com/v3.1/docs' unless @key
|
137
|
+
|
137
138
|
uri += "#{uri =~ /\?/ ? '&' : '?'}user_key=#{@key}"
|
138
139
|
|
139
140
|
resp = Timeout.timeout(@timeout) do
|
data/lib/crunchbase/client.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
3
|
module Crunchbase::Model
|
@@ -14,9 +13,9 @@ module Crunchbase::Model
|
|
14
13
|
def initialize(json)
|
15
14
|
super
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
return if (relationships = json['relationships']).nil?
|
17
|
+
|
18
|
+
instance_relationships_object(Crunchbase::Model::School, 'school', relationships['school'])
|
20
19
|
end
|
21
20
|
|
22
21
|
def property_keys
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
3
|
module Crunchbase
|
@@ -13,8 +12,12 @@ module Crunchbase
|
|
13
12
|
instance_variable_set('@uuid', json['uuid'] || nil)
|
14
13
|
|
15
14
|
properties = json['properties'] || {}
|
16
|
-
property_keys.each
|
17
|
-
|
15
|
+
property_keys.each do |v|
|
16
|
+
instance_variable_set("@#{v}", properties[v])
|
17
|
+
end
|
18
|
+
date_keys.each do |v|
|
19
|
+
instance_variable_set("@#{v}", properties[v].nil? ? nil : Date.parse(properties[v]))
|
20
|
+
end
|
18
21
|
|
19
22
|
instance_timestamps(properties)
|
20
23
|
|
@@ -40,7 +43,7 @@ module Crunchbase
|
|
40
43
|
return Time.parse(date) if date.is_a?(String)
|
41
44
|
|
42
45
|
Time.at(date)
|
43
|
-
rescue
|
46
|
+
rescue StandardError
|
44
47
|
nil
|
45
48
|
end
|
46
49
|
|
@@ -61,7 +64,7 @@ module Crunchbase
|
|
61
64
|
end
|
62
65
|
|
63
66
|
def relationship_lists
|
64
|
-
{
|
67
|
+
{}
|
65
68
|
end
|
66
69
|
|
67
70
|
def set_relationships_object(kclass, key, list)
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
3
|
module Crunchbase::Model
|
@@ -22,6 +21,7 @@ module Crunchbase::Model
|
|
22
21
|
|
23
22
|
relationships = json['relationships']
|
24
23
|
return if relationships.nil?
|
24
|
+
|
25
25
|
relationship_with_funded(relationships['funded_organization'])
|
26
26
|
end
|
27
27
|
|