easy_hubspot 0.1.2 → 0.1.4

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: 37634f153087dd95c69c5f620df3ce0a4be007bd279ad16fc32aeeaf9ea9b9d3
4
- data.tar.gz: 2b5a1f0c7eba6c492947d940365d679998f667a9dbd34b84733f6af288c46325
3
+ metadata.gz: 7a389b7b8caa0c0734ed546248987c25dcb996ced3ce484851d02f982201abe6
4
+ data.tar.gz: 260d7d05818b8b13352d017c41b90ab3e2e0cadcec20ef993c04c3bcfe2553a9
5
5
  SHA512:
6
- metadata.gz: bb31ab138bbdab0624bb1752f88340d2c0c64fe25f56231045239c2d40255a5c0e36b1be41d02a328aada5170b3cfd6e621b5f092ce06c37b8e7872d5b36121f
7
- data.tar.gz: 938a8ca0967ebb75d838739cbf7f45c69b9b5959da98a5766e692eb9a74db292a542e8b208932aa4ec09432ab459f49220492ad99af9202aca780240e818aa36
6
+ metadata.gz: fb95d7dce8a97124d49c9c7e158ac56356de6ba3eaea3fc107b396a94b68cc06d9e4ed98bb6d5316207ff13f33cd83692b3d96fe07e7dc33beccc3c405fb347f
7
+ data.tar.gz: 467deef0357abba5b66fab33a33b87fc8acfc7d1b004bb34f4d24cffa0f2c11e1cafc28969b839f664a47f3eca0e61d41c089040a4c51ea07c68fc1d81efcfa8
data/Gemfile CHANGED
@@ -1,14 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source "https://rubygems.org"
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 "bundler", "~> 2.2"
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
- end
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 "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
- require "rubocop/rake_task"
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 = "https://github.com/oroth8/easy-hubspot"
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
 
@@ -36,10 +36,12 @@ Gem::Specification.new do |spec|
36
36
 
37
37
  # development dependencies
38
38
  spec.add_development_dependency 'bundler', '~> 2.0'
39
+ spec.add_development_dependency 'capybara', '~> 2.7'
39
40
  spec.add_development_dependency 'pry', '~> 0.13.1'
40
41
  spec.add_development_dependency 'rake', '~> 13.0'
41
42
  spec.add_development_dependency 'rspec', '~> 3.4.0'
42
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'
43
46
  spec.add_development_dependency 'webmock', '~> 3.14'
44
- spec.add_development_dependency 'capybara', '~> 2.7'
45
47
  end
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EasyHubspot
2
4
  # class EasyHubspot::Base
3
5
  class Base
4
6
  class << self
5
7
  def headers
6
- { "Content-Type": 'application/json',
7
- "Authorization": "Bearer #{EasyHubspot.configuration.access_token}" }
8
+ { "Content-Type" => 'application/json',
9
+ "Authorization" => "Bearer #{EasyHubspot.configuration.access_token}" }
8
10
  end
9
11
 
10
12
  def email?(string)
@@ -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:, headers:,
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:, headers:)
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:, headers:,
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:, headers:)
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
 
@@ -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'.freeze
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))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EasyHubspot
4
- VERSION = "0.1.2"
4
+ VERSION = '0.1.4'
5
5
  end
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.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owen Roth
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
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: '2.7'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.7'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: pry
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -95,33 +109,47 @@ dependencies:
95
109
  - !ruby/object:Gem::Version
96
110
  version: '1.2'
97
111
  - !ruby/object:Gem::Dependency
98
- name: webmock
112
+ name: rubocop-rake
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
115
  - - "~>"
102
116
  - !ruby/object:Gem::Version
103
- version: '3.14'
117
+ version: 0.6.0
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
122
  - - "~>"
109
123
  - !ruby/object:Gem::Version
110
- version: '3.14'
124
+ version: 0.6.0
111
125
  - !ruby/object:Gem::Dependency
112
- name: capybara
126
+ name: rubocop-rspec
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
129
  - - "~>"
116
130
  - !ruby/object:Gem::Version
117
- version: '2.7'
131
+ version: 2.18.1
118
132
  type: :development
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
136
  - - "~>"
123
137
  - !ruby/object:Gem::Version
124
- version: '2.7'
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'
125
153
  description: This gem is designed to make it easier to integrate with the Hubspot
126
154
  API
127
155
  email: