easy_hubspot 0.1.3 → 0.1.5

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: 2516cce1efa500bfa9ba3e4bcbeaa867f3c7a247bb4d1124169f50fc11f7176a
4
- data.tar.gz: eb893c31abc5cfd6b6e839e596628c031f9210af449efc5cb7b997c811ac00f2
3
+ metadata.gz: 71b8b8b0adf023816a69c63eabce11490707324ca7f6dd7ad0a4c675079746c2
4
+ data.tar.gz: 415ce8982b292d1c76885629d6c8058fe95334197f233923efac196599c1f584
5
5
  SHA512:
6
- metadata.gz: 37ef0372ad8d0866297dfe1d598eb543c6ea323692d8a418c3235ed206c8d1c4776506f73ee6bb09707da9ef19416e38e5d28d96b66a95cafed778f66f4efaad
7
- data.tar.gz: acea1e334af4f0fbbaf5ce466e86062f562ee94b59855addb91063e93b1553fc74cadf0ebedcec229b4137240ea919f5092214326cdde263d44b9f00c0660a22
6
+ metadata.gz: 39589dcd934069589f8c345df8d60a54b2c047d000318e7491c90e54d9f7abe1bd15109df5a01ca5616bd110f4ace578cea138dd09fd7d03a74cf8156dafe873
7
+ data.tar.gz: 4ec10d8960dc10c34cc44671804ebd8c2db6ced6559b3739d37ebaf4534db640b62c499cab339f113ab3bb55a0def2c17657bd30121fe8f714dec95623dbc3bd
data/.rubocop.yml ADDED
@@ -0,0 +1,31 @@
1
+ require:
2
+ - rubocop-rspec
3
+ - rubocop-rake
4
+
5
+ AllCops:
6
+ TargetRubyVersion: 2.6.0
7
+
8
+ Style/HashSyntax:
9
+ Exclude:
10
+ - 'lib/easy_hubspot/client.rb'
11
+
12
+ Naming/AccessorMethodName:
13
+ Enabled: false
14
+ Include:
15
+ - 'lib/easy_hubspot/client.rb'
16
+
17
+ Layout/LineLength:
18
+ Max: 125
19
+
20
+ RSpec/BeforeAfterAll:
21
+ Enabled: false
22
+
23
+ RSpec/ContextWording:
24
+ Enabled: false
25
+
26
+ RSpec/MultipleExpectations:
27
+ Enabled: false
28
+
29
+ Style/StringLiterals:
30
+ Exclude:
31
+ - 'lib/easy_hubspot/base.rb'
data/easy_hubspot.gemspec CHANGED
@@ -16,9 +16,9 @@ Gem::Specification.new do |spec|
16
16
 
17
17
  # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
18
18
 
19
- # spec.metadata["homepage_uri"] = spec.homepage
20
- # spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
21
- # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
19
+ spec.metadata['homepage_uri'] = spec.homepage
20
+ spec.metadata['source_code_uri'] = spec.homepage
21
+ spec.metadata['changelog_uri'] = 'https://github.com/oroth8/easy-hubspot/blob/main/CHANGELOG.md'
22
22
 
23
23
  # Specify which files should be added to the gem when it is released.
24
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -5,17 +5,13 @@ module EasyHubspot
5
5
  class Base
6
6
  class << self
7
7
  def headers
8
- { "Content-Type": 'application/json',
9
- "Authorization": "Bearer #{EasyHubspot.configuration.access_token}" }
8
+ { "Content-Type" => 'application/json',
9
+ "Authorization" => "Bearer #{EasyHubspot.configuration.access_token}" }
10
10
  end
11
11
 
12
12
  def email?(string)
13
13
  URI::MailTo::EMAIL_REGEXP.match?(string)
14
14
  end
15
-
16
- def merge_path(path)
17
- EasyHubspot.configuration.base_url + path
18
- end
19
15
  end
20
16
  end
21
17
  end
@@ -7,40 +7,33 @@ module EasyHubspot
7
7
  CONTACT_ENDPOINT = 'crm/v3/objects/contacts'
8
8
 
9
9
  def get_contact(contact_id)
10
- path = merge_path(determine_endpoint(contact_id))
11
- Client.do_get(path, headers)
10
+ Client.do_get(determine_endpoint(contact_id), headers)
12
11
  end
13
12
 
14
13
  def get_contacts
15
- Client.do_get(contact_path, headers)
14
+ Client.do_get(CONTACT_ENDPOINT, headers)
16
15
  end
17
16
 
18
17
  def create_contact(body)
19
- Client.do_post(contact_path, body, headers)
18
+ Client.do_post(CONTACT_ENDPOINT, body, headers)
20
19
  end
21
20
 
22
21
  def update_contact(contact_id, body)
23
- path = merge_path(determine_endpoint(contact_id))
24
- Client.do_patch(path, body, headers)
22
+ Client.do_patch(determine_endpoint(contact_id), body, headers)
25
23
  end
26
24
 
27
25
  def delete_contact(contact_id)
28
- path = merge_path(determine_endpoint(contact_id))
29
- Client.do_delete(path, headers)
26
+ Client.do_delete(determine_endpoint(contact_id), headers)
30
27
  end
31
28
 
32
- def get_associated_contacts(contact_id, object_type, object_id, association_id)
33
- # TODO: Error handling arguments
34
- path = merge_path("#{CONTACT_ENDPOINT}/#{contact_id}/associations/#{object_type}/#{object_id}/#{association_id}")
35
- Client.do_get(path, headers)
36
- end
29
+ # def get_associated_contacts(contact_id, object_type, object_id, association_id)
30
+ # # TODO: Error handling arguments
31
+ # path = merge_path("#{CONTACT_ENDPOINT}/#{contact_id}/associations/#{object_type}/#{object_id}/#{association_id}")
32
+ # Client.do_get(path, headers)
33
+ # end
37
34
 
38
35
  private
39
36
 
40
- def contact_path
41
- merge_path(CONTACT_ENDPOINT)
42
- end
43
-
44
37
  def determine_endpoint(value)
45
38
  email_endpoint = "#{CONTACT_ENDPOINT}/#{value}?idProperty=email"
46
39
  id_endpoint = "#{CONTACT_ENDPOINT}/#{value}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EasyHubspot
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.5'
5
5
  end
data/lib/easy_hubspot.rb CHANGED
@@ -26,7 +26,7 @@ module EasyHubspot
26
26
 
27
27
  def initialize
28
28
  @access_token = ''
29
- @base_url = 'https://api.hubapi.com'
29
+ @base_url = 'https://api.hubapi.com/'
30
30
  end
31
31
  end
32
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_hubspot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owen Roth
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-09 00:00:00.000000000 Z
11
+ date: 2023-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -158,6 +158,7 @@ executables: []
158
158
  extensions: []
159
159
  extra_rdoc_files: []
160
160
  files:
161
+ - ".rubocop.yml"
161
162
  - CHANGELOG.md
162
163
  - Gemfile
163
164
  - LICENSE.txt
@@ -173,7 +174,10 @@ files:
173
174
  homepage: https://github.com/oroth8/easy-hubspot
174
175
  licenses:
175
176
  - MIT
176
- metadata: {}
177
+ metadata:
178
+ homepage_uri: https://github.com/oroth8/easy-hubspot
179
+ source_code_uri: https://github.com/oroth8/easy-hubspot
180
+ changelog_uri: https://github.com/oroth8/easy-hubspot/blob/main/CHANGELOG.md
177
181
  post_install_message:
178
182
  rdoc_options: []
179
183
  require_paths: