crunchbase4 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4317bd93d0d27af2af5fa3ee7ecfb5bfd2c4c9b37ab8a17d11d5db5730985e26
4
+ data.tar.gz: 8b961f21ae443862cd22fd22595c1f69c7519745461eb07a112c628b83d3746a
5
+ SHA512:
6
+ metadata.gz: ad8b0f747d0df8c38d1f4c0f14468c753e4473d9ac581593739a7cf1ae0e0abadd593fc214760efc3e713bfeb70a37096cd5373de5e205e53081a2f2fe8741db
7
+ data.tar.gz: ab491bf0ac55c60c649c338d58f1cd83b8ca2aa2af7bb214ef2f782d9a7f2d02831e2c864b782b5febe7ef4ae4de1b8401476bd6c918118ef737869c0764f8a6
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/crunchbase.yml
9
+ /tmp/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1 @@
1
+ inherit_from: .rubocop_todo.yml
@@ -0,0 +1,35 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2020-06-03 22:43:16 +0800 using RuboCop version 0.85.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 2
10
+ # Configuration parameters: IgnoredMethods.
11
+ Metrics/AbcSize:
12
+ Max: 17
13
+
14
+ # Offense count: 1
15
+ # Configuration parameters: CountComments.
16
+ Metrics/ClassLength:
17
+ Max: 138
18
+
19
+ # Offense count: 1
20
+ # Configuration parameters: IgnoredMethods.
21
+ Metrics/CyclomaticComplexity:
22
+ Max: 8
23
+
24
+ # Offense count: 7
25
+ # Configuration parameters: CountComments, ExcludedMethods.
26
+ Metrics/MethodLength:
27
+ Max: 86
28
+
29
+ # Offense count: 1
30
+ # Configuration parameters: IgnoredMethods.
31
+ Metrics/PerceivedComplexity:
32
+ Max: 8
33
+
34
+ Metrics/BlockLength:
35
+ Max: 200
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.6.1
6
+ before_install: gem install bundler -v 2.1.4
File without changes
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at encore@ekohe.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [https://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: https://contributor-covenant.org
74
+ [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in crunchbase4.gemspec
6
+ gemspec
7
+
8
+ gem 'rake', '~> 12.0'
9
+ gem 'rspec', '~> 3.0'
@@ -0,0 +1,82 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ crunchbase4 (0.1.0)
5
+ faraday
6
+ faraday_middleware
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ addressable (2.7.0)
12
+ public_suffix (>= 2.0.2, < 5.0)
13
+ ast (2.4.0)
14
+ coderay (1.1.3)
15
+ crack (0.4.3)
16
+ safe_yaml (~> 1.0.0)
17
+ diff-lcs (1.3)
18
+ faraday (1.0.1)
19
+ multipart-post (>= 1.2, < 3)
20
+ faraday_middleware (1.0.0)
21
+ faraday (~> 1.0)
22
+ hashdiff (1.0.1)
23
+ method_source (1.0.0)
24
+ multipart-post (2.1.1)
25
+ parallel (1.19.1)
26
+ parser (2.7.1.3)
27
+ ast (~> 2.4.0)
28
+ pry (0.13.1)
29
+ coderay (~> 1.1)
30
+ method_source (~> 1.0)
31
+ public_suffix (4.0.5)
32
+ rainbow (3.0.0)
33
+ rake (12.3.3)
34
+ regexp_parser (1.7.0)
35
+ rexml (3.2.4)
36
+ rspec (3.9.0)
37
+ rspec-core (~> 3.9.0)
38
+ rspec-expectations (~> 3.9.0)
39
+ rspec-mocks (~> 3.9.0)
40
+ rspec-core (3.9.2)
41
+ rspec-support (~> 3.9.3)
42
+ rspec-expectations (3.9.2)
43
+ diff-lcs (>= 1.2.0, < 2.0)
44
+ rspec-support (~> 3.9.0)
45
+ rspec-mocks (3.9.1)
46
+ diff-lcs (>= 1.2.0, < 2.0)
47
+ rspec-support (~> 3.9.0)
48
+ rspec-support (3.9.3)
49
+ rubocop (0.85.0)
50
+ parallel (~> 1.10)
51
+ parser (>= 2.7.0.1)
52
+ rainbow (>= 2.2.2, < 4.0)
53
+ regexp_parser (>= 1.7)
54
+ rexml
55
+ rubocop-ast (>= 0.0.3)
56
+ ruby-progressbar (~> 1.7)
57
+ unicode-display_width (>= 1.4.0, < 2.0)
58
+ rubocop-ast (0.0.3)
59
+ parser (>= 2.7.0.1)
60
+ ruby-progressbar (1.10.1)
61
+ safe_yaml (1.0.5)
62
+ unicode-display_width (1.7.0)
63
+ vcr (6.0.0)
64
+ webmock (3.8.3)
65
+ addressable (>= 2.3.6)
66
+ crack (>= 0.3.2)
67
+ hashdiff (>= 0.4.0, < 2.0.0)
68
+
69
+ PLATFORMS
70
+ ruby
71
+
72
+ DEPENDENCIES
73
+ crunchbase4!
74
+ pry
75
+ rake (~> 12.0)
76
+ rspec (~> 3.0)
77
+ rubocop
78
+ vcr
79
+ webmock
80
+
81
+ BUNDLED WITH
82
+ 2.1.4
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Encore Shao
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,139 @@
1
+ # Crunchbase
2
+
3
+ A Ruby Library for Crunchbase API v4 - [CB-v4 Doc](https://app.swaggerhub.com/apis/Crunchbase/crunchbase-enterprise_api/1.0.1)
4
+
5
+ [![Gem Version](https://badge.fury.io/rb/crunchbase4.svg)](https://badge.fury.io/rb/crunchbase4)
6
+ [![Build Status](https://travis-ci.org/encoreshao/crunchbase4.svg?branch=master)](https://travis-ci.org/encoreshao/crunchbase4)
7
+ [![Coverage Status](https://coveralls.io/repos/github/encoreshao/crunchbase4/badge.svg)](https://coveralls.io/github/encoreshao/crunchbase4)
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'crunchbase4', github: 'ekohe/crunchbase4'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle install
20
+
21
+ ## Usage
22
+
23
+ ## Configure your API certificate
24
+
25
+ ```
26
+ require 'crunchbase4'
27
+
28
+ CB_CONFIG = YAML.load(File.read('crunchbase.yml'))
29
+ Crunchbase.config do |c|
30
+ c.user_key = CB_CONFIG['user_key']
31
+ end
32
+
33
+ OR
34
+
35
+ Crunchbase.config.user_key = CB_CONFIG['user_key']
36
+ ```
37
+
38
+ ## get the organization data
39
+
40
+ ```
41
+ pry(main)> client = Crunchbase::Client.new
42
+ pry(main)> response = client.organization('ekohe')
43
+ => #<Crunchbase::Entities::Organization:0x00007fbc5cfdf2f8
44
+ @acquirer_identifier=nil,
45
+ @aliases=nil,
46
+ @categories=["Apps", "Artificial Intelligence", "Big Data", "E-Commerce", "Enterprise Software", "FinTech", "iOS", "Retail", "UX Design"],
47
+ @category_groups=["Apps", "Artificial Intelligence", "Commerce and Shopping", "Data and Analytics", "Design", "Financial Services", "Mobile", "Platforms", "Science and Engineering", "Software"],
48
+ @closed_on=nil,
49
+ @company_type="for_profit",
50
+ @contact_email="info@ekohe.com",
51
+ @created_at="2013-05-14T14:28:38Z",
52
+ @delisted_on=nil,
53
+ @demo_days=nil,
54
+ @description=
55
+ ...>
56
+ pry(main)> response.name
57
+ => "Ekohe"
58
+ pry(main)> response.permalink
59
+ => "ekohe"
60
+ ```
61
+
62
+ OR if you want to get the json data, please call `response.as_json` in your project.
63
+
64
+
65
+ ## get the person data
66
+
67
+ ```
68
+ pry(main)> client = Crunchbase::Client.new
69
+ pry(main)> response = client.person('mark-zuckerberg')
70
+ => #<Crunchbase::Entities::Person:0x00007ffbf201d178
71
+ @aliases=["Zuck"],
72
+ @born_on="1984-05-14",
73
+ @created_at="2007-05-26T04:51:46Z",
74
+ @description=
75
+ "Mark Zuckerberg is the founder and CEO of Facebook, which he started in his college dorm room in 2004 with roomates Dustin Moskovitz and Chris Hughes and from New York.\r\n\r\nZuckerberg is responsible for setting the overall direction and product strategy for the company. He leads the design of Facebook's service and development of its core technology and infrastructure. Mark studied computer science at Harvard University before moving the company to Palo Alto, California.\r\n\r\nEarlier in life, Zuckerberg developed a music recommendation system called Synapse and a peer-to-peer client called Wirehog. However, he abandoned both to pursue new projects.\r\n\r\nZuckerberg attended Harvard University and studied computer science before founding Facebook.\r\n\r\nWhile at Harvard, Zuckerberg created Facemash, a website that compared students' dorm photos side-by-side in a fashion similar to HOT or NOT. Harvard administration was not amused, and Zuckerberg faced subsequent disciplinary action. Less than three months later, he launched Facebook.\r\n\r\nIn September 2010, Zuckerberg donated $100 million to the Newark Public School System to help renovate and revamp the system.\r\n\r\nZuckerberg won the 2007 Crunchie Award for 'Best Startup CEO.' He was the Time Magazine 2010 Person Of The Year. He also won the 2012 Crunchie Award for CEO of the year.",
76
+ @died_on=nil,
77
+ @entity_def_id="person",
78
+ @entity_id="mark-zuckerberg",
79
+ @facebook="https://www.facebook.com/zuck",
80
+ @facet_ids=["investor", "rank"],
81
+ @first_name="Mark",
82
+ @gender="male",
83
+ @identifier="Mark Zuckerberg",
84
+ ...>
85
+ pry(main)> response.name
86
+ => "Mark Zuckerberg"
87
+ pry(main)> response.permalink
88
+ => "mark-zuckerberg"
89
+ ```
90
+
91
+ OR if you want to get the json data, please call `response.as_json` in your project.
92
+
93
+ ```
94
+ pry(main)> response.as_json
95
+ => {:born_on=>"1984-05-14",
96
+ :created_at=>"2007-05-26T04:51:46Z",
97
+ :died_on=>nil,
98
+ :entity_def_id=>"person",
99
+ :facebook=>"https://www.facebook.com/zuck",
100
+ :facet_ids=>["investor", "rank"],
101
+ :first_name=>"Mark",
102
+ :gender=>"male",
103
+ :identifier=>"Mark Zuckerberg",
104
+ :image_id=>"v1448830269/gzcifut4c2xah95x0ewd.jpg",
105
+ :image_url=>"https://res.cloudinary.com/crunchbase-production/image/upload/v1448830269/gzcifut4c2xah95x0ewd.jpg",
106
+ :investor_stage=>["seed"],
107
+ :investor_type=>["investment_partner", "angel"],
108
+ :last_name=>"Zuckerberg",
109
+ :layout_id=>"investor",
110
+ :linkedin=>nil,
111
+ :location_group_identifiers=>["San Francisco Bay Area", "Silicon Valley", "West Coast", "Western US"],
112
+ :location_identifiers=>["Palo Alto", "California", "United States", "North America"],
113
+ :middle_name=>nil,
114
+ :num_articles=>31046,
115
+ :num_current_advisor_jobs=>4,
116
+ :num_current_jobs=>7,
117
+ :num_event_appearances=>6,
118
+ :num_exits=>nil,
119
+ ....>
120
+ ```
121
+
122
+ ## Development
123
+
124
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
125
+
126
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
127
+
128
+ ## Contributing
129
+
130
+ Bug reports and pull requests are welcome on GitHub at https://github.com/encoreshao/crunchbase4. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/encoreshao/crunchbase4/blob/master/CODE_OF_CONDUCT.md).
131
+
132
+
133
+ ## License
134
+
135
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
136
+
137
+ ## Code of Conduct
138
+
139
+ Everyone interacting in the Crunchbase project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/encoreshao/crunchbase4/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'crunchbase'
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ require 'pry'
12
+ Pry.start
13
+
14
+ # require 'irb'
15
+ # IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/crunchbase/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'crunchbase4'
7
+ spec.version = Crunchbase::VERSION
8
+ spec.authors = ['Encore Shao']
9
+ spec.email = ['encore.shao@gmail.com']
10
+
11
+ spec.summary = 'Ruby Library for Crunchbase API Version 4.0'
12
+ spec.description = 'A Ruby wrapper for Crunchbase API version 4.0, crunchbase build new API interface by GraphQL'
13
+ spec.homepage = 'https://github.com/encoreshao/crunchbase4'
14
+ spec.license = 'MIT'
15
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
16
+ spec.post_install_message = 'Thanks for installing!'
17
+
18
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
19
+
20
+ spec.metadata['homepage_uri'] = spec.homepage
21
+ spec.metadata['source_code_uri'] = 'https://github.com/encoreshao/crunchbase4'
22
+ spec.metadata['changelog_uri'] = 'https://github.com/encoreshao/crunchbase4/CHANGELOG.md'
23
+
24
+ # Specify which files should be added to the gem when it is released.
25
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
26
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
27
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
+ end
29
+
30
+ spec.bindir = 'bin'
31
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
+ spec.require_paths = ['lib']
33
+
34
+ spec.add_dependency 'faraday'
35
+ spec.add_dependency 'faraday_middleware'
36
+
37
+ # VCR for testing APIs
38
+ spec.add_development_dependency 'vcr'
39
+ spec.add_development_dependency 'webmock'
40
+ # Rubocop
41
+ spec.add_development_dependency 'rubocop'
42
+ # For debug binding.pry
43
+ spec.add_development_dependency 'pry'
44
+ end