easy_hubspot 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -6
- data/Rakefile +3 -3
- data/easy_hubspot.gemspec +4 -6
- data/lib/easy_hubspot/base.rb +2 -0
- data/lib/easy_hubspot/client.rb +11 -8
- data/lib/easy_hubspot/contact.rb +3 -1
- data/lib/easy_hubspot/version.rb +1 -1
- data/lib/easy_hubspot.rb +2 -0
- metadata +31 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2516cce1efa500bfa9ba3e4bcbeaa867f3c7a247bb4d1124169f50fc11f7176a
|
4
|
+
data.tar.gz: eb893c31abc5cfd6b6e839e596628c031f9210af449efc5cb7b997c811ac00f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37ef0372ad8d0866297dfe1d598eb543c6ea323692d8a418c3235ed206c8d1c4776506f73ee6bb09707da9ef19416e38e5d28d96b66a95cafed778f66f4efaad
|
7
|
+
data.tar.gz: acea1e334af4f0fbbaf5ce466e86062f562ee94b59855addb91063e93b1553fc74cadf0ebedcec229b4137240ea919f5092214326cdde263d44b9f00c0660a22
|
data/Gemfile
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
source
|
3
|
+
source 'https://rubygems.org'
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in easy_hubspot.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
8
|
group :development, :test do
|
9
|
-
gem
|
10
|
-
gem "rake", "~> 13.0"
|
11
|
-
gem "rspec", "~> 3.0"
|
12
|
-
gem "rubocop", "~> 1.21"
|
9
|
+
gem 'bundler', '~> 2.2'
|
13
10
|
gem 'pry', '~> 0.13.1'
|
14
|
-
|
11
|
+
gem 'rake', '~> 13.0'
|
12
|
+
gem 'rspec', '~> 3.0'
|
13
|
+
gem 'rubocop', '~> 1.21'
|
14
|
+
end
|
data/Rakefile
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rspec/core/rake_task'
|
5
5
|
|
6
6
|
RSpec::Core::RakeTask.new(:spec)
|
7
7
|
|
8
|
-
require
|
8
|
+
require 'rubocop/rake_task'
|
9
9
|
|
10
10
|
RuboCop::RakeTask.new
|
11
11
|
|
data/easy_hubspot.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
|
11
11
|
spec.summary = 'An easier way to integrate with the Hubspot API'
|
12
12
|
spec.description = 'This gem is designed to make it easier to integrate with the Hubspot API'
|
13
|
-
spec.homepage =
|
13
|
+
spec.homepage = 'https://github.com/oroth8/easy-hubspot'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
spec.required_ruby_version = '>= 2.6.0'
|
16
16
|
|
@@ -31,19 +31,17 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
32
|
spec.require_paths = ['lib']
|
33
33
|
|
34
|
-
# runtime dependencies
|
35
|
-
spec.add_runtime_dependency 'json', '~> 2.6.3'
|
36
|
-
spec.add_runtime_dependency 'uri', '~> 0.12.0'
|
37
|
-
|
38
34
|
# dependencies
|
39
35
|
spec.add_dependency 'httparty', '~> 0.21.0'
|
40
36
|
|
41
37
|
# development dependencies
|
42
38
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
39
|
+
spec.add_development_dependency 'capybara', '~> 2.7'
|
43
40
|
spec.add_development_dependency 'pry', '~> 0.13.1'
|
44
41
|
spec.add_development_dependency 'rake', '~> 13.0'
|
45
42
|
spec.add_development_dependency 'rspec', '~> 3.4.0'
|
46
43
|
spec.add_development_dependency 'rubocop', '~> 1.2'
|
44
|
+
spec.add_development_dependency 'rubocop-rake', '~> 0.6.0'
|
45
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.18.1'
|
47
46
|
spec.add_development_dependency 'webmock', '~> 3.14'
|
48
|
-
spec.add_development_dependency 'capybara', '~> 2.7'
|
49
47
|
end
|
data/lib/easy_hubspot/base.rb
CHANGED
data/lib/easy_hubspot/client.rb
CHANGED
@@ -1,43 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module EasyHubspot
|
4
|
+
# EasyHubspot::Client
|
2
5
|
class Client
|
3
6
|
class << self
|
4
7
|
def do_get(path = nil, headers = {}, format_plain: true)
|
5
8
|
if format_plain
|
6
|
-
response = HTTParty.get("#{EasyHubspot.configuration.base_url}#{path}", headers
|
9
|
+
response = HTTParty.get("#{EasyHubspot.configuration.base_url}#{path}", headers: headers,
|
7
10
|
format: :plain)
|
8
11
|
parse_response(response)
|
9
12
|
else
|
10
|
-
HTTParty.get("#{EasyHubspot.configuration.base_url}#{path}", headers:)
|
13
|
+
HTTParty.get("#{EasyHubspot.configuration.base_url}#{path}", headers: headers)
|
11
14
|
end
|
12
15
|
end
|
13
16
|
|
14
17
|
def do_post(path = nil, body = {}, headers = {}, format_plain: true)
|
15
18
|
if format_plain
|
16
|
-
response = HTTParty.post("#{EasyHubspot.configuration.base_url}#{path}", body
|
19
|
+
response = HTTParty.post("#{EasyHubspot.configuration.base_url}#{path}", body: body, headers: headers,
|
17
20
|
format: :plain)
|
18
21
|
parse_response(response)
|
19
22
|
else
|
20
|
-
HTTParty.post("#{EasyHubspot.configuration.base_url}#{path}", body
|
23
|
+
HTTParty.post("#{EasyHubspot.configuration.base_url}#{path}", body: body, headers: headers)
|
21
24
|
end
|
22
25
|
end
|
23
26
|
|
24
27
|
def do_patch(path = nil, body = {}, headers = {}, format_plain: true)
|
25
28
|
if format_plain
|
26
|
-
response = HTTParty.patch("#{EasyHubspot.configuration.base_url}#{path}", body
|
29
|
+
response = HTTParty.patch("#{EasyHubspot.configuration.base_url}#{path}", body: body, headers: headers,
|
27
30
|
format: :plain)
|
28
31
|
parse_response(response)
|
29
32
|
else
|
30
|
-
HTTParty.patch("#{EasyHubspot.configuration.base_url}#{path}", body
|
33
|
+
HTTParty.patch("#{EasyHubspot.configuration.base_url}#{path}", body: body, headers: headers)
|
31
34
|
end
|
32
35
|
end
|
33
36
|
|
34
37
|
def do_delete(path = nil, headers = {}, format_plain: true)
|
35
38
|
if format_plain
|
36
|
-
response = HTTParty.delete("#{EasyHubspot.configuration.base_url}#{path}", headers
|
39
|
+
response = HTTParty.delete("#{EasyHubspot.configuration.base_url}#{path}", headers: headers,
|
37
40
|
format: :plain)
|
38
41
|
parse_response(response)
|
39
42
|
else
|
40
|
-
HTTParty.delete("#{EasyHubspot.configuration.base_url}#{path}", headers:)
|
43
|
+
HTTParty.delete("#{EasyHubspot.configuration.base_url}#{path}", headers: headers)
|
41
44
|
end
|
42
45
|
end
|
43
46
|
|
data/lib/easy_hubspot/contact.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module EasyHubspot
|
2
4
|
# class EasyHubspot::Contact
|
3
5
|
class Contact < EasyHubspot::Base
|
4
6
|
class << self
|
5
|
-
CONTACT_ENDPOINT = 'crm/v3/objects/contacts'
|
7
|
+
CONTACT_ENDPOINT = 'crm/v3/objects/contacts'
|
6
8
|
|
7
9
|
def get_contact(contact_id)
|
8
10
|
path = merge_path(determine_endpoint(contact_id))
|
data/lib/easy_hubspot/version.rb
CHANGED
data/lib/easy_hubspot.rb
CHANGED
@@ -9,6 +9,7 @@ require 'httparty'
|
|
9
9
|
require 'json'
|
10
10
|
require 'uri'
|
11
11
|
|
12
|
+
# EasyHubspot
|
12
13
|
module EasyHubspot
|
13
14
|
class << self
|
14
15
|
attr_accessor :configuration
|
@@ -19,6 +20,7 @@ module EasyHubspot
|
|
19
20
|
yield(configuration)
|
20
21
|
end
|
21
22
|
|
23
|
+
# EasyHubspot::Configuration
|
22
24
|
class Configuration
|
23
25
|
attr_accessor :access_token, :base_url
|
24
26
|
|
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.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Owen Roth
|
@@ -11,61 +11,47 @@ cert_chain: []
|
|
11
11
|
date: 2023-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 2.6.3
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 2.6.3
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: uri
|
14
|
+
name: httparty
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - "~>"
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
19
|
+
version: 0.21.0
|
34
20
|
type: :runtime
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
24
|
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
26
|
+
version: 0.21.0
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
28
|
+
name: bundler
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
31
|
- - "~>"
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
48
|
-
type: :
|
33
|
+
version: '2.0'
|
34
|
+
type: :development
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
38
|
- - "~>"
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
40
|
+
version: '2.0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
42
|
+
name: capybara
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
45
|
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: '2.
|
47
|
+
version: '2.7'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: '2.
|
54
|
+
version: '2.7'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: pry
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,33 +109,47 @@ dependencies:
|
|
123
109
|
- !ruby/object:Gem::Version
|
124
110
|
version: '1.2'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
112
|
+
name: rubocop-rake
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
128
114
|
requirements:
|
129
115
|
- - "~>"
|
130
116
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
117
|
+
version: 0.6.0
|
132
118
|
type: :development
|
133
119
|
prerelease: false
|
134
120
|
version_requirements: !ruby/object:Gem::Requirement
|
135
121
|
requirements:
|
136
122
|
- - "~>"
|
137
123
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
124
|
+
version: 0.6.0
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
126
|
+
name: rubocop-rspec
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
142
128
|
requirements:
|
143
129
|
- - "~>"
|
144
130
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
131
|
+
version: 2.18.1
|
146
132
|
type: :development
|
147
133
|
prerelease: false
|
148
134
|
version_requirements: !ruby/object:Gem::Requirement
|
149
135
|
requirements:
|
150
136
|
- - "~>"
|
151
137
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
138
|
+
version: 2.18.1
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: webmock
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '3.14'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '3.14'
|
153
153
|
description: This gem is designed to make it easier to integrate with the Hubspot
|
154
154
|
API
|
155
155
|
email:
|