easy_hubspot 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ce154fdb34847454b688c962db16c2d70e1ea51f43f532f630552063fd206c6
4
- data.tar.gz: f8ede8f920e5359db248fb20a4a8e5194fe6f1344a29b720676b03e19f6761b1
3
+ metadata.gz: 8afd7c12ba165b752df83f2a711ad3220f0efb7f9fef8a73340ae9dd9c95adeb
4
+ data.tar.gz: dcd135320a2274849e576f7b2c5497a74323c1713b330f275c6c4f6dfa3cedef
5
5
  SHA512:
6
- metadata.gz: 303dbdc024cff0b52bbfd372987cbf83ee7b61d014d0bab2407a47c618e664632c69a2e1031f7a9cfa496ae359b3044b349691c6b4d654a1faa4b97d2c8e39b2
7
- data.tar.gz: ded9e8f4717f948498b3b2d5b2e7276057edd51ca7f61d897d079802cf2a3fb1584015ff98d0f233e6c0d68e992a5076a987a06e127187aa8a7debd6c8a12ec6
6
+ metadata.gz: 4b5da8b90ae02f92056d2af35dea0cbbe8207e84d486345dd89fd7d155b75a13680b735788f2e4b64ba3c9acc617830c8fe29feb3a5b3156c5ceb3cab3b2f724
7
+ data.tar.gz: c90fb31a0954a82c9bdfbf7c3b0c5df4fde0e4f5c40da12fa09f32afad0f8ca5c7679ae561ca52196b016bebf06bcdeb93edb6d14c57ed354b99b2faf5a75f95
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
- ## [Unreleased]
1
+ ## [Official Release]
2
+ - [0.1.7] - 2023-02-10
2
3
 
3
- ## [0.1.0] - 2023-02-08
4
+ ## [Unreleased]
4
5
 
5
- - Initial release
6
+ ## [Initial releases]
7
+ - [0.1.0] - 2023-02-08
8
+ - [0.1.1] - 2023-02-09
9
+ - [0.1.2] - 2023-02-09
10
+ - [0.1.3] - 2023-02-09
11
+ - [0.1.4] - 2023-02-09
12
+ - [0.1.5] - 2023-02-09
13
+ - [0.1.6] - 2023-02-09
data/README.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # EasyHubspot
2
- ![version](https://img.shields.io/badge/version-0.1.6-green)
2
+ ![version](https://img.shields.io/badge/version-0.1.7-green)
3
3
  [![CI](https://github.com/oroth8/easy_hubspot/actions/workflows/ci.yml/badge.svg)](https://github.com/oroth8/easy_hubspot/actions/workflows/ci.yml)
4
4
  [![Code Climate](https://codeclimate.com/github/oroth8/easy_hubspot/badges/gpa.svg)](https://codeclimate.com/github/oroth8/easy_hubspot)
5
5
 
6
- Work in progress: This gem is not ready for production use.
6
+ This is a lightweight wrapper for the Hubspot API. It is designed to be easy to use and to provide a simple setup for the most common use cases.
7
+
8
+ This gem utilizes the `v3` hubspot-api
7
9
 
8
- This is a lightweight wrapper for the Hubspot API. It is designed to be easy to use and to provide a simple interface for the most common use cases.
9
10
  ## Installation
10
11
 
11
12
  Add this line to your application's Gemfile:
@@ -33,6 +34,8 @@ rails g easy_hubspot:install
33
34
 
34
35
  ### Contacts
35
36
 
37
+ Please refrence the [hubspot docs](https://developers.hubspot.com/docs/api/crm/contacts)
38
+
36
39
  ```ruby
37
40
  # Create a contact
38
41
  EasyHubspot::Contact.create_contact(properties: { email: '', firstname: '', lastname: '' , etc: ''})
@@ -33,7 +33,10 @@ module EasyHubspot
33
33
  def parse_response(res)
34
34
  return if res.body.nil?
35
35
 
36
- JSON.parse res, symbolize_names: true
36
+ parsed_res = JSON.parse res, symbolize_names: true
37
+ raise EasyHubspot::HubspotApiError, parsed_res[:message] if parsed_res[:status] == 'error'
38
+
39
+ parsed_res
37
40
  end
38
41
  end
39
42
  end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EasyHubspot
4
+ class Error < StandardError; end
5
+ class HubspotApiError < Error; end
6
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EasyHubspot
4
- VERSION = '0.1.7'
4
+ VERSION = '0.1.8'
5
5
  end
data/lib/easy_hubspot.rb CHANGED
@@ -5,6 +5,7 @@ require 'easy_hubspot/client'
5
5
  require 'easy_hubspot/contact'
6
6
  require 'easy_hubspot/version'
7
7
  require 'easy_hubspot/generators/install_generator'
8
+ require 'easy_hubspot/exceptions'
8
9
 
9
10
  require 'httparty'
10
11
  require 'json'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_hubspot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owen Roth
@@ -184,6 +184,7 @@ files:
184
184
  - lib/easy_hubspot/base.rb
185
185
  - lib/easy_hubspot/client.rb
186
186
  - lib/easy_hubspot/contact.rb
187
+ - lib/easy_hubspot/exceptions.rb
187
188
  - lib/easy_hubspot/generators/install_generator.rb
188
189
  - lib/easy_hubspot/generators/templates/easy_hubspot.rb
189
190
  - lib/easy_hubspot/version.rb