not_so_easy_hubspot 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +33 -0
- data/CHANGELOG.md +17 -0
- data/Gemfile +19 -0
- data/LICENSE.txt +21 -0
- data/README.md +167 -0
- data/Rakefile +12 -0
- data/config/initializers/not_so_easy_hubspot.rb +6 -0
- data/lib/not_so_easy_hubspot/base.rb +17 -0
- data/lib/not_so_easy_hubspot/client.rb +45 -0
- data/lib/not_so_easy_hubspot/contact.rb +47 -0
- data/lib/not_so_easy_hubspot/deal.rb +36 -0
- data/lib/not_so_easy_hubspot/exceptions.rb +6 -0
- data/lib/not_so_easy_hubspot/generators/install_generator.rb +16 -0
- data/lib/not_so_easy_hubspot/generators/templates/not_so_easy_hubspot.rb +6 -0
- data/lib/not_so_easy_hubspot/version.rb +5 -0
- data/lib/not_so_easy_hubspot.rb +35 -0
- data/not_so_easy_hubspot.gemspec +49 -0
- data/sig/not_so_easy_hubspot.rbs +4 -0
- metadata +233 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1916f490e8d341c09fb2cb66a9bd35b5a7506f18ea2336bbdeedd994e74c8c49
|
4
|
+
data.tar.gz: e1ce94ea8673002aaa58ef4c6a024a9093609f10a07199f6061e7719543f716f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2886de210e2ddc0ceb774820df27f5e7c3ca9f32f0d24d88abefc7e0be2ce26a49894cdc07ca0c08749f9a617112ae07b6de04b441412ba3db76c7b09a79b281
|
7
|
+
data.tar.gz: '08cfa044c51d7b74c98ff6bbfd81de6c0b20655daf11b97e8124672967fdf8f0d816daa99084edbc18fc4bca37f3500f322b1f13ad19c292a6bf6787be7bc962'
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
- rubocop-rake
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
TargetRubyVersion: 2.6.0
|
7
|
+
|
8
|
+
Style/HashSyntax:
|
9
|
+
Exclude:
|
10
|
+
- 'lib/not_so_easy_hubspot/client.rb'
|
11
|
+
|
12
|
+
Naming/AccessorMethodName:
|
13
|
+
Enabled: false
|
14
|
+
Include:
|
15
|
+
- 'lib/not_so_easy_hubspot/client.rb'
|
16
|
+
|
17
|
+
Layout/LineLength:
|
18
|
+
Enabled: true
|
19
|
+
Exclude:
|
20
|
+
- 'spec/**/*'
|
21
|
+
|
22
|
+
RSpec/BeforeAfterAll:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
RSpec/ContextWording:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
RSpec/MultipleExpectations:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Style/StringLiterals:
|
32
|
+
Exclude:
|
33
|
+
- 'lib/not_so_easy_hubspot/base.rb'
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
## [Official Release]
|
2
|
+
- [1.0.0] - 2023-02-22 https://github.com/oroth8/not_so_easy_hubspot/pull/10
|
3
|
+
|
4
|
+
## [Unreleased]
|
5
|
+
|
6
|
+
## [Initial releases (Beta)]
|
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
|
14
|
+
- [0.1.7] - 2023-02-10
|
15
|
+
- [0.1.8] - 2023-02-10
|
16
|
+
- [0.1.9] - 2023-02-14 https://github.com/oroth8/not_so_easy_hubspot/pull/6
|
17
|
+
- [0.1.10] - 2023-02-14 https://github.com/oroth8/not_so_easy_hubspot/pull/7
|
data/Gemfile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in not_so_easy_hubspot.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
group :development, :test do
|
9
|
+
gem 'bundler', '~> 2.2'
|
10
|
+
gem 'rspec', '~> 3.0'
|
11
|
+
gem 'rubocop', '~> 1.21'
|
12
|
+
gem 'solargraph'
|
13
|
+
end
|
14
|
+
|
15
|
+
group :test do
|
16
|
+
gem 'pry', '~> 0.14.2'
|
17
|
+
gem 'rake', '~> 13.0'
|
18
|
+
gem 'simplecov', '~> 0.17.0'
|
19
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2023 Owen Roth
|
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.
|
data/README.md
ADDED
@@ -0,0 +1,167 @@
|
|
1
|
+
# NotSoEasyHubspot
|
2
|
+
Stable: ![stable version](https://img.shields.io/badge/version-1.0.0-green)
|
3
|
+
Latest: ![latest version](https://img.shields.io/badge/version-1.0.0-yellow)
|
4
|
+
[![CI](https://github.com/oroth8/not_so_easy_hubspot/actions/workflows/ci.yml/badge.svg)](https://github.com/oroth8/not_so_easy_hubspot/actions/workflows/ci.yml)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/oroth8/not_so_easy_hubspot/badges/gpa.svg)](https://codeclimate.com/github/oroth8/not_so_easy_hubspot)
|
6
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/c55dfda6142769b8209c/test_coverage)](https://codeclimate.com/github/oroth8/not_so_easy_hubspot/test_coverage)
|
7
|
+
|
8
|
+
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.
|
9
|
+
|
10
|
+
This gem utilizes the `v3` hubspot-api
|
11
|
+
|
12
|
+
## CRM Objects
|
13
|
+
- [Contacts](#contacts)
|
14
|
+
- [Deals](#deals)
|
15
|
+
|
16
|
+
- [Error Handling](#error-handling)
|
17
|
+
|
18
|
+
### Dependencies
|
19
|
+
- [gem "httparty", "~> 0.21.0"](https://github.com/jnunemaker/httparty)
|
20
|
+
|
21
|
+
### Compatibility
|
22
|
+
- `ruby >= 2.6.10`
|
23
|
+
- `rails >= 6.0`
|
24
|
+
|
25
|
+
## Installation
|
26
|
+
|
27
|
+
Add this line to your application's Gemfile:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
gem 'not_so_easy_hubspot'
|
31
|
+
```
|
32
|
+
|
33
|
+
## Usage
|
34
|
+
|
35
|
+
Add the following to your `config/initializers/not_so_easy_hubspot.rb` file:
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
NotSoEasyHubspot.config do |c|
|
39
|
+
c.access_token = 'YOUR API KEY'
|
40
|
+
c.base_url = 'https://api.hubapi.com/'
|
41
|
+
end
|
42
|
+
```
|
43
|
+
|
44
|
+
Or run the generator:
|
45
|
+
|
46
|
+
```bash
|
47
|
+
rails g not_so_easy_hubspot:install
|
48
|
+
```
|
49
|
+
|
50
|
+
### Contacts
|
51
|
+
|
52
|
+
Please refrence the [hubspot docs](https://developers.hubspot.com/docs/api/crm/contacts)
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
# Create a contact
|
56
|
+
# required: body
|
57
|
+
# returns: parsed hubspot contact
|
58
|
+
NotSoEasyHubspot::Contact.create_contact(properties: { email: '', firstname: '', lastname: '' , etc: ''})
|
59
|
+
|
60
|
+
# Update a contact
|
61
|
+
# required: contact_id, body
|
62
|
+
# - contact_id: can be a hubspot contact_id or email
|
63
|
+
# returns: parsed hubspot contact
|
64
|
+
NotSoEasyHubspot::Contact.update_contact(123, properties: { email: '', firstname: '', lastname: '' , etc: ''})
|
65
|
+
|
66
|
+
# Get a contact
|
67
|
+
# required: contact_id
|
68
|
+
# - contact_id: can be a hubspot contact_id or email
|
69
|
+
# returns: parsed hubspot contact
|
70
|
+
NotSoEasyHubspot::Contact.get_contact(123)
|
71
|
+
# or
|
72
|
+
NotSoEasyHubspot::Contact.get_contact('test@gmail.com')
|
73
|
+
|
74
|
+
# Get all contacts
|
75
|
+
# returns: parsed hubspot contacts
|
76
|
+
NotSoEasyHubspot::Contact.get_contacts
|
77
|
+
|
78
|
+
# Delete a contact
|
79
|
+
# required: contact_id
|
80
|
+
# - contact_id: can be a hubspot contact_id or email
|
81
|
+
# returns: {status: 'success'}
|
82
|
+
NotSoEasyHubspot::Contact.delete_contact(123)
|
83
|
+
# or
|
84
|
+
NotSoEasyHubspot::Contact.delete_contact('test@gmail.com')
|
85
|
+
|
86
|
+
# Update or Create a contact
|
87
|
+
# required: email, body
|
88
|
+
# returns: parsed hubspot contact
|
89
|
+
NotSoEasyHubspot::Contact.update_or_create_contact(properties: { email: '', firstname: '', lastname: '' , etc: ''})
|
90
|
+
|
91
|
+
|
92
|
+
# Parse hubspot contact example
|
93
|
+
{:id=>"701",
|
94
|
+
:properties=>
|
95
|
+
{:createdate=>"2023-02-08T20:10:36.858Z",
|
96
|
+
:email=>"amber_becker@quigley.io",
|
97
|
+
:firstname=>"Amber",
|
98
|
+
:hs_content_membership_status=>"inactive",
|
99
|
+
:hs_is_contact=>"true",
|
100
|
+
:hs_is_unworked=>"true",
|
101
|
+
:hs_object_id=>"701",
|
102
|
+
:hs_pipeline=>"contacts-lifecycle-pipeline",
|
103
|
+
:lastmodifieddate=>"2023-02-14T18:24:07.654Z",
|
104
|
+
:lastname=>"Quigley",
|
105
|
+
:lifecyclestage=>"lead"},
|
106
|
+
:createdAt=>"2023-02-08T20:10:36.858Z",
|
107
|
+
:updatedAt=>"2023-02-14T18:24:07.654Z",
|
108
|
+
:archived=>false}
|
109
|
+
```
|
110
|
+
|
111
|
+
### Deals
|
112
|
+
```ruby
|
113
|
+
# Create a deal
|
114
|
+
# required: body
|
115
|
+
# returns: parsed hubspot deal
|
116
|
+
NotSoEasyHubspot::Deal.create_deal(properties: { dealname: '', amount: '', etc: ''})
|
117
|
+
|
118
|
+
# Update a deal
|
119
|
+
# required: deal_id, body
|
120
|
+
# - deal_id: must be a hubspot deal_id
|
121
|
+
# returns: parsed hubspot deal
|
122
|
+
NotSoEasyHubspot::Deal.update_deal(123, properties: { dealname: '', amount: '', etc: ''})
|
123
|
+
|
124
|
+
# Get a deal
|
125
|
+
# required: deal_id
|
126
|
+
# - deal_id: must be a hubspot deal_id
|
127
|
+
# returns: parsed hubspot deal
|
128
|
+
NotSoEasyHubspot::Deal.get_deal(123)
|
129
|
+
|
130
|
+
# Get all deals
|
131
|
+
# returns: parsed hubspot deals
|
132
|
+
NotSoEasyHubspot::Deal.get_deals
|
133
|
+
|
134
|
+
# Delete a deal
|
135
|
+
# required: deal_id
|
136
|
+
# - deal_id: must be a hubspot deal_id
|
137
|
+
# returns: {status: 'success'}
|
138
|
+
NotSoEasyHubspot::Deal.delete_deal(123)
|
139
|
+
```
|
140
|
+
|
141
|
+
## Error Handling
|
142
|
+
|
143
|
+
```ruby
|
144
|
+
def call
|
145
|
+
begin
|
146
|
+
NotSoEasyHubspot::Contact.create_contact(body)
|
147
|
+
rescue NotSoEasyHubspot::HubspotApiError => e
|
148
|
+
# handle error code
|
149
|
+
# e.message = 'Contact already exists. Existing ID: 801'
|
150
|
+
Rails.logger.info(e.message)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
```
|
154
|
+
|
155
|
+
## Development
|
156
|
+
|
157
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
158
|
+
|
159
|
+
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 the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
160
|
+
|
161
|
+
## Contributing
|
162
|
+
|
163
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/oroth8/not_so_easy_hubspot.
|
164
|
+
|
165
|
+
## License
|
166
|
+
|
167
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NotSoEasyHubspot
|
4
|
+
# class NotSoEasyHubspot::Base
|
5
|
+
class Base
|
6
|
+
class << self
|
7
|
+
def headers
|
8
|
+
{ "Content-Type" => 'application/json',
|
9
|
+
"Authorization" => "Bearer #{NotSoEasyHubspot.configuration.access_token}" }
|
10
|
+
end
|
11
|
+
|
12
|
+
def email?(string)
|
13
|
+
URI::MailTo::EMAIL_REGEXP.match?(string)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NotSoEasyHubspot
|
4
|
+
# NotSoEasyHubspot::Client
|
5
|
+
class Client
|
6
|
+
class << self
|
7
|
+
def do_get(path = nil, headers = {})
|
8
|
+
response = HTTParty.get("#{NotSoEasyHubspot.configuration.base_url}#{path}", headers: headers,
|
9
|
+
format: :plain)
|
10
|
+
parse_response(response)
|
11
|
+
end
|
12
|
+
|
13
|
+
def do_post(path = nil, body = {}, headers = {})
|
14
|
+
response = HTTParty.post("#{NotSoEasyHubspot.configuration.base_url}#{path}", body: body, headers: headers,
|
15
|
+
format: :plain)
|
16
|
+
parse_response(response)
|
17
|
+
end
|
18
|
+
|
19
|
+
def do_patch(path = nil, body = {}, headers = {})
|
20
|
+
response = HTTParty.patch("#{NotSoEasyHubspot.configuration.base_url}#{path}", body: body, headers: headers,
|
21
|
+
format: :plain)
|
22
|
+
parse_response(response)
|
23
|
+
end
|
24
|
+
|
25
|
+
def do_delete(path = nil, headers = {})
|
26
|
+
response = HTTParty.delete("#{NotSoEasyHubspot.configuration.base_url}#{path}", headers: headers,
|
27
|
+
format: :plain)
|
28
|
+
parse_response(response).nil? ? { status: 'success' } : parse_response(response)
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def parse_response(res)
|
34
|
+
return { status: 'error', message: '404 Not Found' } if res.code == 404
|
35
|
+
|
36
|
+
return if res.body.nil? || res.body.empty?
|
37
|
+
|
38
|
+
parsed_res = JSON.parse res, symbolize_names: true
|
39
|
+
raise NotSoEasyHubspot::HubspotApiError, parsed_res[:message] if parsed_res[:status] == 'error'
|
40
|
+
|
41
|
+
parsed_res
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NotSoEasyHubspot
|
4
|
+
# class NotSoEasyHubspot::Contact
|
5
|
+
class Contact < NotSoEasyHubspot::Base
|
6
|
+
class << self
|
7
|
+
CONTACT_ENDPOINT = 'crm/v3/objects/contacts'
|
8
|
+
|
9
|
+
def get_contact(contact_id)
|
10
|
+
Client.do_get(determine_endpoint(contact_id), headers)
|
11
|
+
end
|
12
|
+
|
13
|
+
def get_contacts
|
14
|
+
Client.do_get(CONTACT_ENDPOINT, headers)
|
15
|
+
end
|
16
|
+
|
17
|
+
def create_contact(body)
|
18
|
+
Client.do_post(CONTACT_ENDPOINT, body, headers)
|
19
|
+
end
|
20
|
+
|
21
|
+
def update_contact(contact_id, body)
|
22
|
+
Client.do_patch(determine_endpoint(contact_id), body, headers)
|
23
|
+
end
|
24
|
+
|
25
|
+
def delete_contact(contact_id)
|
26
|
+
Client.do_delete(determine_endpoint(contact_id), headers)
|
27
|
+
end
|
28
|
+
|
29
|
+
def update_or_create_contact(email, body)
|
30
|
+
res = get_contact(email)
|
31
|
+
if res && res[:id]
|
32
|
+
update_contact(email, body)
|
33
|
+
else
|
34
|
+
create_contact(body)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def determine_endpoint(value)
|
41
|
+
email_endpoint = "#{CONTACT_ENDPOINT}/#{value}?idProperty=email"
|
42
|
+
id_endpoint = "#{CONTACT_ENDPOINT}/#{value}"
|
43
|
+
email?(value.to_s) ? email_endpoint : id_endpoint
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NotSoEasyHubspot
|
4
|
+
# class NotSoEasyHubspot::deal
|
5
|
+
class Deal < NotSoEasyHubspot::Base
|
6
|
+
class << self
|
7
|
+
DEAL_ENDPOINT = 'crm/v3/objects/deals'
|
8
|
+
|
9
|
+
def get_deal(deal_id)
|
10
|
+
Client.do_get(deal_id_endpoint(deal_id), headers)
|
11
|
+
end
|
12
|
+
|
13
|
+
def get_deals
|
14
|
+
Client.do_get(DEAL_ENDPOINT, headers)
|
15
|
+
end
|
16
|
+
|
17
|
+
def create_deal(body)
|
18
|
+
Client.do_post(DEAL_ENDPOINT, body, headers)
|
19
|
+
end
|
20
|
+
|
21
|
+
def update_deal(deal_id, body)
|
22
|
+
Client.do_patch(deal_id_endpoint(deal_id), body, headers)
|
23
|
+
end
|
24
|
+
|
25
|
+
def delete_deal(deal_id)
|
26
|
+
Client.do_delete(deal_id_endpoint(deal_id), headers)
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def deal_id_endpoint(deal_id)
|
32
|
+
"#{DEAL_ENDPOINT}/#{deal_id}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators'
|
4
|
+
|
5
|
+
module NotSoEasyHubspot
|
6
|
+
module Generators
|
7
|
+
# InstallGenerator
|
8
|
+
class InstallGenerator < Rails::Generators::Base
|
9
|
+
source_root File.expand_path('templates', __dir__)
|
10
|
+
desc 'This generator creates an initializer file at config/initializers'
|
11
|
+
def copy_initializer
|
12
|
+
copy_file 'not_so_easy_hubspot.rb', 'config/initializers/not_so_easy_hubspot.rb'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'not_so_easy_hubspot/base'
|
4
|
+
require 'not_so_easy_hubspot/client'
|
5
|
+
require 'not_so_easy_hubspot/contact'
|
6
|
+
require 'not_so_easy_hubspot/deal'
|
7
|
+
require 'not_so_easy_hubspot/version'
|
8
|
+
require 'not_so_easy_hubspot/generators/install_generator'
|
9
|
+
require 'not_so_easy_hubspot/exceptions'
|
10
|
+
|
11
|
+
require 'httparty'
|
12
|
+
require 'json'
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
# NotSoEasyHubspot
|
16
|
+
module NotSoEasyHubspot
|
17
|
+
class << self
|
18
|
+
attr_accessor :configuration
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.config
|
22
|
+
self.configuration ||= Configuration.new
|
23
|
+
yield(configuration)
|
24
|
+
end
|
25
|
+
|
26
|
+
# NotSoEasyHubspot::Configuration
|
27
|
+
class Configuration
|
28
|
+
attr_accessor :access_token, :base_url
|
29
|
+
|
30
|
+
def initialize
|
31
|
+
@access_token = ''
|
32
|
+
@base_url = 'https://api.hubapi.com/'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/not_so_easy_hubspot/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'not_so_easy_hubspot'
|
7
|
+
spec.version = NotSoEasyHubspot::VERSION
|
8
|
+
spec.authors = ['Clément Lucas']
|
9
|
+
spec.email = ['clmtlucas@gmail.com']
|
10
|
+
|
11
|
+
spec.summary = 'An easier way to integrate with the Hubspot API'
|
12
|
+
spec.description = 'This gem is designed to make it easier to integrate with the Hubspot API'
|
13
|
+
spec.homepage = 'https://github.com/Clothparency/not_so_easy_hubspot'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
spec.required_ruby_version = '>= 2.6.0'
|
16
|
+
|
17
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
|
18
|
+
|
19
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
20
|
+
spec.metadata['source_code_uri'] = spec.homepage
|
21
|
+
spec.metadata['changelog_uri'] = 'https://github.com/Clothparency/not_so_easy_hubspot/blob/main/CHANGELOG.md'
|
22
|
+
|
23
|
+
# Specify which files should be added to the gem when it is released.
|
24
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
|
+
spec.files = Dir.chdir(__dir__) do
|
26
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|circleci)|appveyor)})
|
28
|
+
end
|
29
|
+
end
|
30
|
+
spec.bindir = 'exe'
|
31
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
|
+
spec.require_paths = ['lib']
|
33
|
+
|
34
|
+
# dependencies
|
35
|
+
spec.add_dependency 'httparty', '~> 0.21.0'
|
36
|
+
|
37
|
+
# development dependencies
|
38
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
39
|
+
spec.add_development_dependency 'capybara', '~> 3.36'
|
40
|
+
spec.add_development_dependency 'generator_spec', '~> 0.9.4'
|
41
|
+
spec.add_development_dependency 'pry', '~> 0.14.2'
|
42
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
43
|
+
spec.add_development_dependency 'rspec', '~> 3.12.0'
|
44
|
+
spec.add_development_dependency 'rubocop', '~> 1.2'
|
45
|
+
spec.add_development_dependency 'rubocop-rake', '~> 0.6.0'
|
46
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.18.1'
|
47
|
+
spec.add_development_dependency 'simplecov', '~> 0.17.0'
|
48
|
+
spec.add_development_dependency 'webmock', '~> 3.14'
|
49
|
+
end
|
metadata
ADDED
@@ -0,0 +1,233 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: not_so_easy_hubspot
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Clément Lucas
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-07-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: httparty
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.21.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.21.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: capybara
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.36'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.36'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: generator_spec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.9.4
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.9.4
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.14.2
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.14.2
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '13.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '13.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 3.12.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 3.12.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '1.2'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '1.2'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop-rake
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.6.0
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 0.6.0
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop-rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 2.18.1
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 2.18.1
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: simplecov
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 0.17.0
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 0.17.0
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: webmock
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '3.14'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '3.14'
|
181
|
+
description: This gem is designed to make it easier to integrate with the Hubspot
|
182
|
+
API
|
183
|
+
email:
|
184
|
+
- clmtlucas@gmail.com
|
185
|
+
executables: []
|
186
|
+
extensions: []
|
187
|
+
extra_rdoc_files: []
|
188
|
+
files:
|
189
|
+
- ".rubocop.yml"
|
190
|
+
- CHANGELOG.md
|
191
|
+
- Gemfile
|
192
|
+
- LICENSE.txt
|
193
|
+
- README.md
|
194
|
+
- Rakefile
|
195
|
+
- config/initializers/not_so_easy_hubspot.rb
|
196
|
+
- lib/not_so_easy_hubspot.rb
|
197
|
+
- lib/not_so_easy_hubspot/base.rb
|
198
|
+
- lib/not_so_easy_hubspot/client.rb
|
199
|
+
- lib/not_so_easy_hubspot/contact.rb
|
200
|
+
- lib/not_so_easy_hubspot/deal.rb
|
201
|
+
- lib/not_so_easy_hubspot/exceptions.rb
|
202
|
+
- lib/not_so_easy_hubspot/generators/install_generator.rb
|
203
|
+
- lib/not_so_easy_hubspot/generators/templates/not_so_easy_hubspot.rb
|
204
|
+
- lib/not_so_easy_hubspot/version.rb
|
205
|
+
- not_so_easy_hubspot.gemspec
|
206
|
+
- sig/not_so_easy_hubspot.rbs
|
207
|
+
homepage: https://github.com/Clothparency/not_so_easy_hubspot
|
208
|
+
licenses:
|
209
|
+
- MIT
|
210
|
+
metadata:
|
211
|
+
homepage_uri: https://github.com/Clothparency/not_so_easy_hubspot
|
212
|
+
source_code_uri: https://github.com/Clothparency/not_so_easy_hubspot
|
213
|
+
changelog_uri: https://github.com/Clothparency/not_so_easy_hubspot/blob/main/CHANGELOG.md
|
214
|
+
post_install_message:
|
215
|
+
rdoc_options: []
|
216
|
+
require_paths:
|
217
|
+
- lib
|
218
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: 2.6.0
|
223
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
224
|
+
requirements:
|
225
|
+
- - ">="
|
226
|
+
- !ruby/object:Gem::Version
|
227
|
+
version: '0'
|
228
|
+
requirements: []
|
229
|
+
rubygems_version: 3.4.10
|
230
|
+
signing_key:
|
231
|
+
specification_version: 4
|
232
|
+
summary: An easier way to integrate with the Hubspot API
|
233
|
+
test_files: []
|