Coder Social home page Coder Social logo

hubspot-ruby's People

Contributors

adimichele avatar alejeune avatar benliscio avatar blakewest avatar capelio avatar carolhsu avatar cbisnett avatar coxw avatar dam avatar dan987 avatar dinosimone avatar fonji avatar hundredwatt avatar loadkpi avatar lukeasrodgers avatar mwalsher avatar nandooliveira avatar ngsikai avatar nicholas-horton avatar paulodiniz avatar pieper126 avatar robnazzal avatar rudiney avatar sensadrome avatar srgoldman avatar strangewill avatar sviccari avatar trueinviso avatar vincenzor avatar yurikoval avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hubspot-ruby's Issues

Missing rake folder in public gem

After installing the gem I was unable to deploy my app due to the following rake error:

rake aborted!
LoadError: cannot load such file -- /Users/jeremylopez/.rvm/gems/ruby-2.2.3@awaken/gems/hubspot-ruby-0.2.0/lib/tasks/properties.rake
/Users/jeremylopez/.rvm/gems/ruby-2.2.3@awaken/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `load'
/Users/jeremylopez/.rvm/gems/ruby-2.2.3@awaken/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `block in load'
/Users/jeremylopez/.rvm/gems/ruby-2.2.3@awaken/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:240:in `load_dependency'
/Users/jeremylopez/.rvm/gems/ruby-2.2.3@awaken/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `load'
/Users/jeremylopez/.rvm/gems/ruby-2.2.3@awaken/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
/Users/jeremylopez/.rvm/gems/ruby-2.2.3@awaken/bin/ruby_executable_hooks:15:in `eval'
/Users/jeremylopez/.rvm/gems/ruby-2.2.3@awaken/bin/ruby_executable_hooks:15:in `<main>'

After navigating to the location of the gem, the lib folder had no tasks folder. After specifying in my gemfile to pull directly from your repo, everything worked. Figured this might be helpful to someone.

Publish newer versions?

The latest version available on rubygems.org is 0.1.8, and master currently sits at 0.1.12.

Concrete motivation for this request is the Contacts::find_by_email method. In the latest published version, the "batch mode" branch of logic within that method has a comment which reads TODO: Transform response, and fails to produce Hubspot::Contact instances.

The current version of contact.rb does consistently produce Hubspot::Contact instances in both batch and non-batch mode. This was added in 5fcfcab and it looks like any release beyond 0.1.8 (even just 0.1.9) would address this.

Hubspot::Contact.find_by_email generating error not returning nil

hubspot_contact = Hubspot::Contact.find_by_email email

Having problems with this code above. When the contact is not found, I was expecting it to be nil. Instead, I am getting a Hubspot::RequestError

Hubspot::RequestError: Response body: {"status":"error","message":"contact does not exist","correlationId":"e378d2f2-57f9-4e60-93ab-269681d419d4","requestId":"0043a897-2017-4735-945e-5ecad6fbe9cd"}
from /Users/csalvato/.rvm/gems/ruby-1.9.3-p551@powersupply/gems/hubspot-ruby-0.1.8/lib/hubspot/connection.rb:9:in `get_json'

In my code, I am trying to use begin -> rescue blocks, but that doesn't seem to be catching the error for proper handling either.

Creating Deals - Readme

I see that you can create a deal (def create!(portal_id, company_ids, vids, params={})), but what's the recommended call? I'd be happy to update the readme and submit a PR. :)

Get all companies not using the correct endpoint

It looks like Hubspot changed their endpoints last year for getting all companies or all deals. See this announcement: https://integrate.hubspot.com/t/upcoming-changes-to-recent-endpoints-for-companies-and-deals/1121

It seems like the Hubspot::Company.all method should be updated to use the new endpoint URL described here: https://developers.hubspot.com/docs/methods/companies/get-all-companies

I'm sure the same is true for deals, but my issue currently is with companies.

Threadsafe version

Is there a version of this gem that does configuration on an instance? I am building an integration with hubspot for multiple accounts so don't want to set my HAPI key on the class.

Hubspot depreciated v2 of Blog Topic API

Starting seeing this error today

[1] » Hubspot::Topic.list
Hubspot::RequestError: Response body:
...
HubSpot - Page not found

I have an email from them back on April 24, 2015 announcing Blog Topic API v3, which mentions v2 being depreciated around June 15th.

How can we help?

At Huntress Labs we use this gem to integrate with our HubSpot instance. I see there are several issues filed and a number of pull requests waiting to be reviewed and merged. I would like to help out maintaining this project since it's important to us. Would you mind adding me as a maintainer or would it be easier if we just fork the repository?

cc: @dan987

Discussion: API design

Goals to think about as we refactor and add support for new endpoints:

  • Avoid leaky abstractions (ex: surfacing HTTParty responses or errors to the gem user)
  • Include the Hubspot API error message when a request fails
  • Discuss “handling failure” on the README so readers know what to expect when a request fails

Speaking of handling failure... I've been thinking about two ways for this library to express failure:

  1. regard failure as a normal return value (aka, always return a Response-like object). This does not apply to the more exception 500-related status codes
  2. raise an exception for non-200 response codes.

I'm typically anti-exception and prefer to treat failure as a normal return value. The ruby community, especially those wrapping third-party APIs, strongly favor using exceptions.

To help us decide, let's consider these design options from the gem user's perspective:

# hubspot-ruby returns a Response object
class Account
 def self.update(account_id, params)
   response = Hubspot::Account.update(account_id, params)
   handle_response(response)
 end

 private
 def handle_response(response)
  if response.success?
    response.data
  else
   # error flow (maybe return the errors, log the failed request, etc)
  end
 end
end

# Pros
# - This design encourages gem users to consider error cases
# - Errors are part of the return value, not an exception
# - Favors conditionals over rescuing

# Cons
# - Handling each API response is more verbose as the gem user will call 
#   `response.success?` before accessing `response.data` 
# - This approach is less idiomatic in the Ruby community. Most API wrappers 
#   raise when a request returns an error
# hubspot-ruby raises for any non-200 response
class Account
 def self.update(account_id, params)
   Hubspot::Account.update(account_id, params)
 rescue Hubspot::Error => exception
   # error flow (maybe return the errors, log the failed request, etc)
 end
end

# Pros
# - This design doesn't require "success?" checks before accessing data. (example)

# Cons
# - Encourages/requires gem users to wrap API calls in a rescue
# - Gem users may forget to wrap an API call in a rescue, resulting in an exception

I would love your feedback on which approach (Response vs Exception) seems best to you.

Recent created contacts

HI, I see we have this for recently updated contacts. Do we have an endpoint that will return recently created contacts? If not, can I submit a pr to support this? We need this endpoint to bring down our call numbers to Hubspot. We are close to the limit. Thanks.

[Question] Get all contacts w/ Default Params and Email

I'm attempting to fetch all contacts w/ the Email address, First name, Last name, and Company.

When I run the following code, all I get is the Email Address. I've looked through the source code, but I'm unsure of how to correctly request the contact properties. How would I tweak my code in order to request multiple properties?

Hubspot::Contact.all({ property: 'email' }

Failure with Ruby 2.3.1

A script with just the line require 'hubspot-ruby' (everything else but the shebang line is commented out or after an exit) causes:

/Users/brandon/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/deprecation/proxy_wrappers.rb:124:in `initialize': undefined method `instance' for ActiveSupport::Deprecation:Class (NoMethodError)
Did you mean?  instance_of?
    from /Users/brandon/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/deprecation/proxy_wrappers.rb:10:in `new'
    from /Users/brandon/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/deprecation/proxy_wrappers.rb:10:in `new'
    from /Users/brandon/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/core_ext/load_error.rb:30:in `<top (required)>'
    from /Users/brandon/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/brandon/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/brandon/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/core_ext.rb:3:in `block in <top (required)>'
    from /Users/brandon/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/core_ext.rb:2:in `each'
    from /Users/brandon/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/core_ext.rb:2:in `<top (required)>'
    from /Users/brandon/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/brandon/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/brandon/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/hubspot-ruby-0.1.8/lib/hubspot-ruby.rb:1:in `<top (required)>'
    from /Users/brandon/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
    from /Users/brandon/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
    from /Users/brandon/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
    from post.rb:5:in `<main>'

Form encoding for submissions

In the Hubspot::FormConnection.submit method, the content type is set to 'application/x-www-form-urlencoded', but the body is still encoded to JSON. Per the documentation, the body should be form encoded, eg: firstname=TestContact&lastname=FormSub&email=formsub@hub...

No OAuth?

It looks like OAuth is the preferred way to connect to the API but that is not documented anywhere. Is it supported? I am not able to get a plain API key.

Naming conventions

This is bordering on extreme pedantry, but v1.0 gives us the chance to standardise on the official HubSpot naming conventions in this code.

For example, Hubspot => HubSpot as a module name.

Also, the HubSpot term for the company identity is companyID (rather than vid, which typically refers to the contact ID).

Happy to submit a PR if this something worth considering at this forthcoming release?

Add support for access_token and oauth_token

Great work on this. Are you going to add support for other auth types?
I am using my access tokens from oauth and tweeked connection.rb to use it.

Hapikey is oauth key in my case.

auth = "Bearer " + Hubspot::Config.hapikey response = get(url, headers: { 'Content-Type' => 'application/json', 'Authorization' => auth }, format: :json)

Define a consistent return value for each action

The return values for each action vary for each class and vary for instance methods and class methods. This inconsistent behavior can be confusing to users and those interested in contributing to the library.

For example, depending on which class you're using, calling .update! or #update! will vary between returning a hash or an instance of the class.

How can we make this consistent and give our users the best experience?

Errno::ECONNRESET: Connection reset by peer - SSL_connect in Hubspot::Contact.create!("[email protected]", {firstname: "First", lastname: "Last"})

Sometimes I get an error when trying to create a contact, although the contact on the Hubspot side is created successfully. I use Ubuntu 16.04 and Ruby 2.4.1. Earlier a similar problem was opened here, but it was closed.
Request Hubspot :: Contact.create_or_update! ([{Email: '[email protected]', firstname: 'First', lastname: 'Last'}]) gives the same result.

Unable to load properties.rake

LoadError: cannot load such file -- /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/bundler/gems/hubspot-ruby-8db4406cdf5a/lib/tasks/properties.rake

Heroku won't publish. I'm pulling directly from the repo, so maybe it's my own fault (had to do that to get certain functions to work). Any advice appreciated!

-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.5.3
###### WARNING:
       Removing `Gemfile.lock` because it was generated on Windows.
       Bundler will do a full resolve so native gems are handled properly.
       This may result in unexpected gem versions being used in your app.
       In rare occasions Bundler may not be able to resolve your dependencies at all.
       https://devcenter.heroku.com/articles/bundler-windows-gemfile
-----> Installing dependencies using bundler 1.15.2
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
       The git source `git://github.com/adimichele/hubspot-ruby.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
       fatal: not a git repository (or any parent up to mount point /)
       Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
       Fetching git://github.com/adimichele/hubspot-ruby.git
       Fetching gem metadata from https://rails-assets.org/..
       Fetching gem metadata from https://rubygems.org/...........
       Fetching version metadata from https://rails-assets.org/..
       Fetching version metadata from https://rubygems.org/..
       Fetching dependency metadata from https://rails-assets.org/..
       Fetching dependency metadata from https://rubygems.org/.
       Resolving dependencies...
       Using rake 12.3.1
       Using concurrent-ruby 1.1.3
       Using minitest 5.11.3
       Using thread_safe 0.3.6
       Using builder 3.2.3
       Using erubi 1.7.1
       Using mini_portile2 2.3.0
       Using crass 1.0.4
       Using rack 2.0.6
       Using nio4r 2.3.1
       Using websocket-extensions 0.1.3
       Using mini_mime 1.0.1
       Using coffee-script-source 1.12.2
       Using execjs 2.7.0
       Using method_source 0.9.2
       Using thor 0.20.3
       Using formtastic_i18n 0.6.0
       Using kaminari-core 1.1.1
       Using arel 9.0.0
       Using rb-fsevent 0.10.3
       Using ffi 1.9.25
       Using mimemagic 0.3.2
       Using bcrypt 3.1.12
       Using msgpack 1.2.4
       Using popper_js 1.14.5
       Using bundler 1.15.2
       Using chartkick 3.0.1
       Using climate_control 0.2.0
       Using orm_adapter 0.5.0
       Using mini_magick 4.9.2
       Using liquid 4.0.1
       Using temple 0.8.0
       Using tilt 2.0.8
       Using mime-types-data 3.2018.0812
       Using multi_xml 0.6.0
       Using multi_json 1.13.1
       Using libv8 6.7.288.46.1 (x86_64-linux)
       Using mysql2 0.5.2
       Using pg 1.1.3
       Using puma 3.12.0
       Using truncate_html 0.9.3
       Using uk_postcode 2.1.3
       Using i18n 1.1.1
       Using sitemap_generator 6.0.1
       Using nokogiri 1.8.5
       Using rack-test 1.1.0
       Using sprockets 4.0.0.beta4
       Using warden 1.2.8
       Using tzinfo 1.2.5
       Using websocket-driver 0.7.0
       Using autoprefixer-rails 9.3.1
       Using uglifier 3.2.0
       Using mail 2.7.1
       Using coffee-script 2.4.1
       Using rb-inotify 0.9.10
       Using ruby-vips 2.0.13
       Using marcel 0.3.3
       Using bootsnap 1.3.2
       Using terrapin 0.6.0
       Using mime-types 3.2.2
       Using mini_racer 0.2.4
       Using haml 5.0.4
       Fetching activesupport 5.2.1.1
       Using sass-listen 4.0.0
       Using image_processing 1.7.1
       Using cocaine 0.6.0
       Using httparty 0.16.3
       Using loofah 2.2.3
       Using sass 3.7.2
       Using ckeditor 4.2.4
       Using rails-html-sanitizer 1.0.4
       Using bootstrap 4.1.3
       Installing activesupport 5.2.1.1
       Using rails-dom-testing 2.0.3
       Using globalid 0.4.1
       Using arbre 1.1.1
       Fetching activemodel 5.2.1.1
       Using groupdate 4.1.0
       Using hubspot-ruby 0.5.0 from git://github.com/adimichele/hubspot-ruby.git (at master@8db4406)
       Using jbuilder 2.8.0
       Fetching actionview 5.2.1.1
       Fetching activejob 5.2.1.1
       Installing activejob 5.2.1.1
       Installing activemodel 5.2.1.1
       Installing actionview 5.2.1.1
       Fetching activerecord 5.2.1.1
       Installing activerecord 5.2.1.1
       Fetching actionpack 5.2.1.1
       Using kaminari-actionview 1.1.1
       Installing actionpack 5.2.1.1
       Using kaminari-activerecord 1.1.1
       Using friendly_id 5.2.4
       Using nilify_blanks 1.3.0
       Using kaminari 1.1.1
       Fetching actioncable 5.2.1.1
       Fetching actionmailer 5.2.1.1
       Fetching railties 5.2.1.1
       Installing actioncable 5.2.1.1
       Installing actionmailer 5.2.1.1
       Installing railties 5.2.1.1
       Using formtastic 3.1.5
       Using has_scope 0.7.2
       Using ransack 2.1.0
       Fetching activestorage 5.2.1.1
       Installing activestorage 5.2.1.1
       Using sprockets-rails 3.2.1
       Using responders 2.4.0
       Using jquery-rails 4.3.3
       Using coffee-rails 4.2.2
       Fetching rails 5.2.1.1
       Using font-awesome-rails 4.7.0.4
       Using sass-rails 5.0.7
       Using inherited_resources 1.9.0
       Using devise 4.5.0
       Using activeadmin 1.4.2
       Using formadmin 0.2.1
       Installing rails 5.2.1.1
       Using exception_handler 0.8.0.0
       Using fl 0.3.9 from source at `vendor/gems/fl`
       Bundle complete! 21 Gemfile dependencies, 108 gems now installed.
       Gems in the groups development and test were not installed.
       Bundled gems are installed into ./vendor/bundle.
       Bundle completed (9.40s)
       Cleaning up the bundler cache.
       The git source `git://github.com/adimichele/hubspot-ruby.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
       Removing activestorage (5.2.1)
       Removing rails (5.2.1)
       Removing activesupport (5.2.1)
       Removing activejob (5.2.1)
       Removing actioncable (5.2.1)
       Removing activemodel (5.2.1)
       Removing railties (5.2.1)
       Removing actionmailer (5.2.1)
       Removing activerecord (5.2.1)
       Removing actionpack (5.2.1)
       Removing actionview (5.2.1)
       Removing hubspot-ruby (009520d38b31)
       The latest bundler is 2.0.0.pre.2, but you are currently running 1.15.2.
       To update, run `gem install bundler --pre`
-----> Installing node-v8.10.0-linux-x64
-----> Detecting rake tasks
 !
 !     Could not detect rake tasks
 !     ensure you can run `$ bundle exec rake -P` against your app
 !     and using the production group of your Gemfile.
 !     fatal: not a git repository (or any parent up to mount point /)
 !     Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
 !     rake aborted!
 !     LoadError: cannot load such file -- /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/bundler/gems/hubspot-ruby-8db4406cdf5a/lib/tasks/properties.rake
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1.1/lib/active_support/dependencies.rb:281:in `block in load'
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1.1/lib/active_support/dependencies.rb:253:in `load_dependency'
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1.1/lib/active_support/dependencies.rb:281:in `load'
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/rake_module.rb:29:in `load_rakefile'
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/default_loader.rb:11:in `load'
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:781:in `load_imports'
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:711:in `raw_load_rakefile'
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:104:in `block in load_rakefile'
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:103:in `load_rakefile'
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:82:in `block in run'
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
 !     /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
 !     vendor/bundle/bin/rake:17:in `load'
 !     vendor/bundle/bin/rake:17:in `<main>'
 !
/app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/rake_runner.rb:106:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
ensure you can run `$ bundle exec rake -P` against your app
and using the production group of your Gemfile.
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
rake aborted!
LoadError: cannot load such file -- /tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/bundler/gems/hubspot-ruby-8db4406cdf5a/lib/tasks/properties.rake
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1.1/lib/active_support/dependencies.rb:281:in `block in load'
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1.1/lib/active_support/dependencies.rb:253:in `load_dependency'
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1.1/lib/active_support/dependencies.rb:281:in `load'
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/rake_module.rb:29:in `load_rakefile'
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/default_loader.rb:11:in `load'
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:781:in `load_imports'
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:711:in `raw_load_rakefile'
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:104:in `block in load_rakefile'
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:103:in `load_rakefile'
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:82:in `block in run'
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
/tmp/build_f0ce8a789b1c37c39ede7535e17d3270/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
vendor/bundle/bin/rake:17:in `load'
vendor/bundle/bin/rake:17:in `<main>'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/ruby.rb:860:in `rake'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/rails4.rb:84:in `block (2 levels) in run_assets_precompile_rake_task'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/base.rb:134:in `log'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/rails4.rb:78:in `block in run_assets_precompile_rake_task'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:in `block in instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/base.rb:48:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/base.rb:44:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/rails4.rb:77:in `run_assets_precompile_rake_task'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/ruby.rb:109:in `block (2 levels) in compile'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/ruby.rb:881:in `allow_git'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/ruby.rb:103:in `block in compile'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:in `block in instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/base.rb:48:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/base.rb:44:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/ruby.rb:92:in `compile'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/rails2.rb:62:in `block in compile'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:in `block in instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/base.rb:48:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/base.rb:44:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/rails2.rb:60:in `compile'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/rails3.rb:42:in `block in compile'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:in `block in instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/base.rb:48:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/base.rb:44:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/rails3.rb:41:in `compile'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/rails4.rb:41:in `block in compile'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:in `block in instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/base.rb:48:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/base.rb:44:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/rails4.rb:40:in `compile'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/bin/support/ruby_compile:20:in `block (2 levels) in <main>'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/base.rb:134:in `log'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/bin/support/ruby_compile:19:in `block in <main>'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:35:in `block in trace'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:in `block in instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:in `instrument'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:35:in `trace'
	from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/bin/support/ruby_compile:15:in `<main>'
 !     Push rejected, failed to compile Ruby app.
 !     Push failed

CompanyProperties using outdated endpoints

The CompanyProperties endpoints are outdated and need to be updated to reflect the CompanyProperty HubSpot API docs.

Work to be done: Update the CompanyProperty endpoints (currently referencing /companies/v2/properties and /companies/v2/groups/) to the newer endpoints: /properties/v1/companies/properties.

Do the old endpoints still work?
Yes. They work because HubSpot is redirecting these old URLs to hit the new endpoints, resulting in a response from the new endpoint.

uninitialized constant Hubspot::Company

I've installed the gem in my rails gemfile.

All of the other module subclasses are recognized and work as expected, but for some reason ::Company does not exist.

 Hubspot::Company
NameError: uninitialized constant Hubspot::Company
    from (irb):19
    from /home/andrew/.rvm/gems/ruby-2.3.0/gems/railties-4.2.3/lib/rails/commands/console.rb:110:in `start'
    from /home/andrew/.rvm/gems/ruby-2.3.0/gems/railties-4.2.3/lib/rails/commands/console.rb:9:in `start'
    from /home/andrew/.rvm/gems/ruby-2.3.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:68:in `console'
    from /home/andrew/.rvm/gems/ruby-2.3.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /home/andrew/.rvm/gems/ruby-2.3.0/gems/railties-4.2.3/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:9:in `require'
    from bin/rails:9:in `<main>'

My Code:

    company = Hubspot::Company.create!(name, {company_domain_name: realtor_url, phone_number: phone} )

Multi-tenancy support / dynamically set the api key?

I'm currently setting my hubspot API key in a 'hubspot.rb' file in config/initializers:

Hubspot.configure(hapikey: Rails.application.secrets.hubspot_api_key)

This works fine for a single-tenant application. For multi-tenancy, I'm storing the account's API key in the database (encrypted), like a couple of other integrations my software uses. For example, for Mailgun, I'm setting the account specific info (API Key, etc) dynamically when sending mail.

Is there any way to dynamically set the hubspot api key instead of setting it once, application wide, in an initializer?

Cannot use create_or_update! without passing email in properties

...specifically for a set of contacts who do not have a :vid or the :vid is not known.

The create_or_update! function does not remove the:email from the contact_hash, before converting the hash_to_properties.

I am seeing some activity logged on "merged contacts" (whose email has become a comma-separated list of emails), indicating the email is being changed through the API. For some reason, the email never actually changes, despite activity being logged.

I'm not intending to update the :email field. Though, I'm not sure how to use create_or_update!, keeping the :email field as the identifier, without inadvertently modifying contacts where the email does not match up exactly.

Is the email being intentionally passed in properties:, even when the :email is being used as the identifier? Any thoughts on whether or not this is an issue?

I'd be happy to write up a PR. :)

SSL Connection Reset in find_by_email

We keep seeing intermittent errors on the SSL connection getting reset.
The error message reads: Errno::ECONNRESET: Connection reset by peer - SSL_connect.
It keeps happening in the find_by_email call.

As a user of the API, is there special precautions that we need to take?

ContactProperties using outdated endpoints

The ContactProperties endpoints are outdated and need to be updated to reflect the ContactProperty HubSpot API docs.

Work to be done: Update the ContactProperty endpoints (currently referencing /contacts/v2/properties and /contacts/v2/groups/) to the newer endpoints: /properties/v1/contacts/properties.

Do the old endpoints still work?
Yes. They work because HubSpot is redirecting these old URLs to hit the new endpoints, resulting in a response from the new endpoint.

Contacts API test failure

Discovered by @patrickdavey during pull request #2.

 1) Contacts API Live test finds a contact by utk
     Failure/Error: Hubspot::Contact.find_by_utk("f844d2217850188692f2610c717c2e9b").should be_present
       expected present? to return true, got false
     # ./spec/live/contacts_integration_spec.rb:30:in `block (2 levels) in <top (required)>'
     # ./spec/support/cassette_helper.rb:5:in `block in extended'

Add Appraisal

A description of Appraisal and it's purpose:

Appraisal integrates with bundler and rake to test your library against different versions of dependencies in repeatable scenarios called "appraisals." Appraisal is designed to make it easy to check for regressions in your library without interfering with day-to-day development using Bundler.

Requires ActiveSupport::Autoload

Was attempting to use this in a plain ruby project and this simple program

require 'dotenv'
require 'pry'
Dotenv.load

require 'hubspot-ruby'

Throws the following error:

/Users/justin/.gem/ruby/2.2.5/gems/activesupport-4.2.6/lib/active_support/number_helper.rb:3:in `<module:NumberHelper>': uninitialized constant ActiveSupport::Autoload (NameError)
    from /Users/justin/.gem/ruby/2.2.5/gems/activesupport-4.2.6/lib/active_support/number_helper.rb:2:in `<module:ActiveSupport>'
    from /Users/justin/.gem/ruby/2.2.5/gems/activesupport-4.2.6/lib/active_support/number_helper.rb:1:in `<top (required)>'
    from /Users/justin/.rubies/ruby-2.2.5/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Users/justin/.rubies/ruby-2.2.5/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Users/justin/.gem/ruby/2.2.5/gems/activesupport-4.2.6/lib/active_support/core_ext/numeric/conversions.rb:2:in `<top (required)>'
    from /Users/justin/.rubies/ruby-2.2.5/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Users/justin/.rubies/ruby-2.2.5/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Users/justin/.gem/ruby/2.2.5/gems/activesupport-4.2.6/lib/active_support/core_ext/numeric.rb:3:in `<top (required)>'
    from /Users/justin/.rubies/ruby-2.2.5/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require'
    from /Users/justin/.rubies/ruby-2.2.5/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require'
    from /Users/justin/.gem/ruby/2.2.5/gems/activesupport-4.2.6/lib/active_support/core_ext.rb:2:in `block in <top (required)>'
    from /Users/justin/.gem/ruby/2.2.5/gems/activesupport-4.2.6/lib/active_support/core_ext.rb:1:in `each'
    from /Users/justin/.gem/ruby/2.2.5/gems/activesupport-4.2.6/lib/active_support/core_ext.rb:1:in `<top (required)>'
    from /Users/justin/.rubies/ruby-2.2.5/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require'
    from /Users/justin/.rubies/ruby-2.2.5/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require'
    from /Users/justin/.gem/ruby/2.2.5/gems/hubspot-ruby-0.1.8/lib/hubspot-ruby.rb:1:in `<top (required)>'
    from /Users/justin/.rubies/ruby-2.2.5/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
    from /Users/justin/.rubies/ruby-2.2.5/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
    from /Users/justin/.rubies/ruby-2.2.5/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
    from app.rb:5:in `<main>'

Hubspot::Form#submit requires the `:portal_id` parameter

Hubspot::Form#submit

The SUBMIT_DATA_PATH constant includes a :portal_id parameter: '/uploads/form/v2/:portal_id/:form_guid'

However, the submit instance method only passes the :form_guid in as a param: Hubspot::Connection.post_json(FORM_PATH, params: { form_guid: @guid }, body: opts)

So, when I attempted to use the submit method, an exception was raised:

Hubspot::ConfigurationError: 'portal_id' not configured
        from /Users/jason/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/hubspot-ruby-0.1.8/lib/hubspot/config.rb:24:in `block in ensure!'
        from /Users/jason/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/hubspot-ruby-0.1.8/lib/hubspot/config.rb:23:in `each'
        from /Users/jason/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/hubspot-ruby-0.1.8/lib/hubspot/config.rb:23:in `ensure!'
        from /Users/jason/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/hubspot-ruby-0.1.8/lib/hubspot/connection.rb:47:in `generate_url'
        from /Users/jason/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/hubspot-ruby-0.1.8/lib/hubspot/connection.rb:91:in `submit'
        from /Users/jason/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/hubspot-ruby-0.1.8/lib/hubspot/form.rb:66:in `submit'

Not sure what the appropriate resolution is, I can see 2 possiblities:

  1. include a :portal_id key in the opts hash
  2. Global configure the portal_id

Properties API not allowing to create property with 'date' as datatype

I am trying to create property with date as datatype in Hubspot through contact properties API. But it is raising error Invalid type : date when I make API call to create property using following API method -

Hubspot::ContactProperties.create!({params})

Seems this issue is due to following definition of PROPERTY_SPECS constant in hubspot/properties.rb where date is not listed in valid_types -

PROPERTY_SPECS = {
group_field_names: %w(name displayName displayOrder properties),
field_names: %w(name groupName description fieldType formField type displayOrder label options),
valid_field_types: %w(textarea select text date file number radio checkbox),
valid_types: %w(string number bool datetime enumeration),
options: %w(description value label hidden displayOrder)
}

Although date is listed as valid datatype in Hubspot contact properties API - http://developers.hubspot.com/docs/methods/contacts/v2/create_contacts_property

Do we need to add date as valid type here?

Any help will be highly appreciated.

Thank you.

Form API Submission Format

It appears that the form submission is encoded as JSON. While it will post successfully, it creates an entry with no contact information. According to the API documentation, the form fields should be URI encoded.

opts[:body].to_json should be changed to URI.encode(opts[:body].map{|k,v| "#{k}=#{v}"}.join("&")) inside submit of FormsConnection < Connection.

Gem fails to initialize on Windows

lib/hubspot/config.rb:

DEFAULT_LOGGER = Logger.new('/dev/null')

This line causes a problem when the gem is initialized via Gemfile. This is because doing this on Windows will result in the exception:
No such file or directory @ rb_sysopen - /dev/null (Errno::ENOENT)

The better, platform independent approach is to use it like this:
DEFAULT_LOGGER = Logger.new(nil)

This would fix the problem.

P.S. I still don't like that we are instantiating a new Logger instance during gem initialization. This is just not needed at this point.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.