ruby_hubspot_api 0.1.1 → 0.1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -1
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/lib/hubspot/resource.rb +11 -8
- data/lib/hubspot/version.rb +1 -1
- data/ruby_hubspot_api.gemspec +8 -8
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b77e20469ffc97b7330e7a163ee5ed4d43b1bef4a17ee7a1eb38663157d3faab
|
4
|
+
data.tar.gz: 52088790ea4ccea816e0b2efc0846331dcffbc29fd0d01c80e16baa9dbafb331
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eab5e7e4ab612428b97b31b81c06c25562f6dd0ef89eba5f47628bb1dbc79dd84fa893c868f6515f0f2d2b435016e8ed50c897e7aa97ac66355b136c1778aea3
|
7
|
+
data.tar.gz: '08dbe5b3847885d286e7f26142e8d2925583195d1c624158d165e023cc2fc3b7cb4482eab4db459c3ecf50aae226457a3487e3fbe8242eb8c59c346c1e0132bb'
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
|
2
|
+
## v0.1.1
|
2
3
|
|
3
4
|
- initial setup
|
4
5
|
- Setup the configuration block
|
@@ -41,3 +42,13 @@
|
|
41
42
|
- Test that we only get the properties we ask for or the defaults
|
42
43
|
- Flatten the properties array into a comma separated list
|
43
44
|
- Improve the intialiser
|
45
|
+
- Update the changeling and link in gem spec
|
46
|
+
- adds the version numbers to the gemspec
|
47
|
+
- Fix dependencies
|
48
|
+
- bump version
|
49
|
+
|
50
|
+
## v0.1.0
|
51
|
+
|
52
|
+
- adds the version numbers to the gemspec
|
53
|
+
- Fix dependencies
|
54
|
+
- bump version
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -137,14 +137,14 @@ contacts.each do |contact|
|
|
137
137
|
end
|
138
138
|
|
139
139
|
# Search for companies with number of employees greater than or equal to 100
|
140
|
-
companies = Hubspot::Company.search(number_of_employees_gte: 100)
|
140
|
+
companies = Hubspot::Company.search(query: { number_of_employees_gte: 100 })
|
141
141
|
|
142
142
|
companies.each do |company|
|
143
143
|
puts "Found: #{company.name}, Employees: #{company.number_of_employees}"
|
144
144
|
end
|
145
145
|
|
146
146
|
# Search for contacts with email in a specific list (IN operator)
|
147
|
-
contacts = Hubspot::Contact.search(email_in: ['user1@example.com', 'user2@example.com'])
|
147
|
+
contacts = Hubspot::Contact.search(query: { email_in: ['user1@example.com', 'user2@example.com'] })
|
148
148
|
|
149
149
|
contacts.each do |contact|
|
150
150
|
puts "Found: #{contact.email}"
|
data/lib/hubspot/resource.rb
CHANGED
@@ -134,12 +134,10 @@ module Hubspot
|
|
134
134
|
filter_groups = [{ filters: [] }]
|
135
135
|
|
136
136
|
filters.each do |key, value|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
value: value
|
142
|
-
}
|
137
|
+
filter = extract_property_and_operator(key)
|
138
|
+
value_key = value.is_a?(Array) ? :values : :value
|
139
|
+
filter[value_key] = value
|
140
|
+
filter_groups.first[:filters] << filter
|
143
141
|
end
|
144
142
|
|
145
143
|
filter_groups
|
@@ -148,11 +146,16 @@ module Hubspot
|
|
148
146
|
# Extract property name and operator from the key
|
149
147
|
def extract_property_and_operator(key)
|
150
148
|
OPERATOR_MAP.each do |suffix, hubspot_operator|
|
151
|
-
|
149
|
+
if key.to_s.end_with?(suffix)
|
150
|
+
return {
|
151
|
+
propertyName: key.to_s.sub(suffix, ''),
|
152
|
+
operator: hubspot_operator
|
153
|
+
}
|
154
|
+
end
|
152
155
|
end
|
153
156
|
|
154
157
|
# Default to 'EQ' operator if no suffix is found
|
155
|
-
|
158
|
+
{ propertyName: key.to_s, operator: 'EQ' }
|
156
159
|
end
|
157
160
|
end
|
158
161
|
|
data/lib/hubspot/version.rb
CHANGED
data/ruby_hubspot_api.gemspec
CHANGED
@@ -40,14 +40,14 @@ Gem::Specification.new do |spec|
|
|
40
40
|
# Define development dependencies
|
41
41
|
spec.add_development_dependency 'rake', '>= 11.0', '< 14.0'
|
42
42
|
|
43
|
-
spec.
|
44
|
-
spec.
|
45
|
-
spec.
|
46
|
-
spec.
|
47
|
-
spec.
|
48
|
-
spec.
|
49
|
-
spec.
|
50
|
-
spec.
|
43
|
+
spec.add_development_dependency 'bundler', '>= 2.0'
|
44
|
+
spec.add_development_dependency 'dotenv', '>= 2.0'
|
45
|
+
spec.add_development_dependency 'pry', '>= 0.1'
|
46
|
+
spec.add_development_dependency 'pry-byebug', '>= 3.0'
|
47
|
+
spec.add_development_dependency 'rspec', '>= 3.0'
|
48
|
+
spec.add_development_dependency 'simplecov', '>= 0.22', '< 1.0'
|
49
|
+
spec.add_development_dependency 'vcr', '>= 6.0'
|
50
|
+
spec.add_development_dependency 'webmock', '>= 3.0'
|
51
51
|
|
52
52
|
# Define runtime dependencies
|
53
53
|
spec.add_runtime_dependency 'httparty', '>= 0.1', '< 1.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_hubspot_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.1
|
4
|
+
version: 0.1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Brook
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -37,7 +37,7 @@ dependencies:
|
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '2.0'
|
40
|
-
type: :
|
40
|
+
type: :development
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
@@ -51,7 +51,7 @@ dependencies:
|
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '2.0'
|
54
|
-
type: :
|
54
|
+
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0.1'
|
68
|
-
type: :
|
68
|
+
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
@@ -79,7 +79,7 @@ dependencies:
|
|
79
79
|
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '3.0'
|
82
|
-
type: :
|
82
|
+
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
@@ -93,7 +93,7 @@ dependencies:
|
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '3.0'
|
96
|
-
type: :
|
96
|
+
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
@@ -110,7 +110,7 @@ dependencies:
|
|
110
110
|
- - "<"
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '1.0'
|
113
|
-
type: :
|
113
|
+
type: :development
|
114
114
|
prerelease: false
|
115
115
|
version_requirements: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
@@ -127,7 +127,7 @@ dependencies:
|
|
127
127
|
- - ">="
|
128
128
|
- !ruby/object:Gem::Version
|
129
129
|
version: '6.0'
|
130
|
-
type: :
|
130
|
+
type: :development
|
131
131
|
prerelease: false
|
132
132
|
version_requirements: !ruby/object:Gem::Requirement
|
133
133
|
requirements:
|
@@ -141,7 +141,7 @@ dependencies:
|
|
141
141
|
- - ">="
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '3.0'
|
144
|
-
type: :
|
144
|
+
type: :development
|
145
145
|
prerelease: false
|
146
146
|
version_requirements: !ruby/object:Gem::Requirement
|
147
147
|
requirements:
|